ön izleme kartları güncellendi

yirmi-bir
murat emir cabaroğlu 4 years ago
parent edbe0a1b63
commit 2830c10cef
  1. 88
      layouts/live/list.html
  2. 24
      layouts/partials/head.html

@ -1,88 +0,0 @@
{{ define "main" }}
{{ .Content }}
<nav class="live-tab-switcher">
{{ range $index, $room := $.Site.Data.live }}
<a class="live-tab-link{{ if ($index) eq 0 }} active {{end}}" id="button-{{$room.navId}}" onClick="switchTabs(event, '{{$room.navId}}')" href="#room-{{$room.navId}}">{{$room.name}}</a>
{{end}}
</nav>
<section class="live-section">
{{ range $index, $room := $.Site.Data.live }}
<div id="room-{{$room.navId}}" class="live-player-wrapper {{ if ($index) eq 1 }} live-tab-d-none {{end}}">
<video-js
id="player-{{$room.navId}}"
data-setup="{}"
>
<source src="{{ $room.url }}">
</video-js>
</div>
{{ end }}
<iframe src="https://kiwiirc.com/client/chat.freenode.net/?&theme=cli#ozgurkon" class="live-chat"></iframe>
</section>
{{end}}
{{ define "scripts"}}
<script type="text/javascript" src="https://vjs.zencdn.net/7.8.1/video.js"></script>
<script type="text/javascript" src="https://unpkg.com/@videojs/http-streaming@1.13.3/dist/videojs-http-streaming.min.js"></script>
<script type="text/javascript">
const players = {
{{ range $room := $.Site.Data.live }}
{{ $room.navId}}: videojs('player-{{$room.navId}}', {
controls: true,
aspectRatio: '16:9'
}),
{{end}}
}
const roomAkgul = document.getElementById('room-akgul');
const roomUckan = document.getElementById('room-uckan');
const buttonAkgul = document.getElementById('button-akgul');
const buttonUckan = document.getElementById('button-uckan');
function switchTabs(event, id) {
event.preventDefault();
pausePlayer(id);
if(id === "akgul") {
setActive(buttonAkgul);
notActive(buttonUckan);
show(roomAkgul);
hide(roomUckan);
}
if(id === "uckan") {
setActive(buttonUckan);
notActive(buttonAkgul);
hide(roomAkgul);
show(roomUckan);
}
}
function pausePlayer(id) {
const playerToPause = (id === "akgul") ? "uckan" : "akgul";
players[id].play();
players[playerToPause].pause();
}
function show(el) {
if(el.classList.contains('live-tab-d-none')) return el.classList.remove('live-tab-d-none');
}
function hide(el) {
if(!el.classList.contains('live-tab-d-none')) return el.classList.add('live-tab-d-none');
}
function setActive(el) {
if(!el.classList.contains('active')) return el.classList.add('active');
}
function notActive(el) {
if(el.classList.contains('active')) return el.classList.remove('active');
}
setTimeout(() => {
document.getElementById("button-akgul").click();
},3000);
</script>
{{ end }}

@ -43,33 +43,29 @@
{{ if .IsHome }}
<meta property="og:title" content="{{ .Site.Title }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ozgurkon.org" />
<meta property="og:url" content="https://ozgurkon.org/2021" />
<meta property="og:description" content="{{ $.Site.Params.description }}" />
<meta property="og:image" content="/tn.png" />
<meta property="og:site_name" content="ÖzgürKon 2020" />
<meta property="og:image" content="/images/logos/ozgurkon_only_logo.svg" />
<meta property="og:site_name" content="ÖzgürKon 2021" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@OzgurKonorg" />
<meta name="twitter:title" content="ÖzgürKon 2020">
<meta name="twitter:title" content="ÖzgürKon 2021">
<meta name="twitter:description" content="{{ $.Site.Params.description }}">
<meta name="twitter:creator" content="@OzgurKonorg" />
<meta name="twitter:image" content="https://ozgurkon.org/tn.png?1234">
<meta name="twitter:image" content="https://ozgurkon.org/tn.png">
{{ else }}
<meta property="og:title" content="{{ .Page.Title }} - {{ .Site.Title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://ozgurkon.org" />
<meta property="og:url" content="https://ozgurkon.org/2021" />
<meta property="og:description" content="{{ .Page.Summary }}" />
<meta property="og:image" content="/tn.png" />
<meta property="og:site_name" content="ÖzgürKon 2020" />
<meta property="og:image" content="/images/logos/ozgurkon_only_logo.svg" />
<meta property="og:site_name" content="ÖzgürKon 2021" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@OzgurKonorg" />
<meta name="twitter:title" content="{{ .Page.Title }} - ÖzgürKon 2020">
<meta name="twitter:title" content="{{ .Page.Title }} - ÖzgürKon 2021">
<meta name="twitter:description" content="{{ .Page.Summary }}">
<meta name="twitter:creator" content="@OzgurKonorg" />
<meta name="twitter:image" content="https://ozgurkon.org/tn.png?1234">
{{ if (.Type) eq "live" }}
<link href="https://vjs.zencdn.net/7.8.1/video-js.css" rel="stylesheet">
{{ end }}
<meta name="twitter:image" content="https://ozgurkon.org/images/logos/ozgurkon_only_logo.svg">
{{ end }}
<link href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}"/>

Loading…
Cancel
Save