<?php
require_once('../../init.php');
?>

Vvveb.SectionsGroup['radyo'] = [
    "radyo/header",
    "radyo/hero",
    "radyo/live",
    "radyo/schedule",
    "radyo/footer"
];

Vvveb.Sections.add("radyo/header", {
name: "<?= lang('sections.radyo_header', [], 'Radyo Header') ?>",
image: "<?= SITE_THEME_URL ?>/assets/preview/header.png",
html: `
<header class="radio-header">
  <div class="container">
    <a href="<?=DOMAIN?>" class="logo">
      <img src="<?= image(settings('logo', m_get_session('editor_lang'))) ?>" alt="<?= settings('site_title', m_get_session('editor_lang')) ?>">
    </a>
    <nav>
      <ul class="menu" data-component-menu data-v-module="menu" data-v-source="automatic" data-v-style="style1" data-vvveb-disabled-noback>
        <li><a href="<?=DOMAIN?>"><?= lang('mobile.nav.home') ?></a></li>
        <li><a href="<?=DOMAIN?>/canli"><?= lang('radyo.live', [], 'Canlı Dinle') ?></a></li>
        <li><a href="<?=DOMAIN?>/yayin-akisi"><?= lang('radyo.schedule', [], 'Yayın Akışı') ?></a></li>
        <li><a href="<?=DOMAIN?>/haberler"><?= lang('sections.blog_style_1') ?></a></li>
        <li><a href="<?=DOMAIN?>/iletisim"><?= lang('mobile.nav.contact') ?></a></li>
      </ul>
    </nav>
  </div>
</header>
`
});

Vvveb.Sections.add("radyo/hero", {
name: "<?= lang('sections.radyo_hero', [], 'Radyo Hero') ?>",
image: "<?= SITE_THEME_URL ?>/assets/preview/hero.png",
html: `
<section class="radio-hero" aria-label="hero">
  <div class="container">
    <div class="hero-content">
      <h1 class="title"><?= settings('site_title', m_get_session('editor_lang')) ?></h1>
      <p class="subtitle"><?= settings('seo_description', m_get_session('editor_lang')) ?></p>
      <a href="<?=DOMAIN?>/canli" class="btn">
        <span class="span"><?= lang('radyo.listen_now', [], 'Şimdi Dinle') ?></span>
      </a>
    </div>
  </div>
  <div class="background-container"><img src="<?= SITE_THEME_URL ?>/assets/images/hero.jpg"></div>
</section>
`
});

Vvveb.Sections.add("radyo/footer", {
name: "<?= lang('sections.radyo_footer', [], 'Radyo Footer') ?>",
image: "<?= SITE_THEME_URL ?>/assets/preview/footer.png",
html: `
<footer class="radio-footer">
  <div class="container">
    <div class="footer-brand">
      <a href="#" class="logo">
        <img src="<?= image(settings('logo', m_get_session('editor_lang'))) ?>" alt="<?= settings('site_title', m_get_session('editor_lang')) ?>">
      </a>
      <p class="footer-text"><?= settings('footer_text', m_get_session('editor_lang')) ?></p>
    </div>
    <ul class="footer-list">
      <li><a href="tel:<?= settings('phone', m_get_session('editor_lang')) ?>"><?= settings('phone', m_get_session('editor_lang')) ?></a></li>
      <li><a href="mailto:<?= settings('email', m_get_session('editor_lang')) ?>"><?= settings('email', m_get_session('editor_lang')) ?></a></li>
      <li><address><?= settings('address', m_get_session('editor_lang')) ?></address></li>
    </ul>
  </div>
</footer>
`
});



Vvveb.Sections.add("radyo/live", {
name: "<?= lang('sections.radyo_live', [], 'Radyo Canlı Yayın') ?>",
image: "<?= SITE_THEME_URL ?>/assets/preview/live.png",
html: `
<section class="radio-live" data-component="live-player">
  <div class="container">
    <div class="live-card">
      <div class="live-info">
        <div class="badge">LIVE</div>
        <h2 class="title"><?= lang('radyo.live', [], 'Canlı Dinle') ?></h2>
        <p class="desc"><?= lang('radyo.live.desc', [], 'Şimdi yayındayız, dinlemeye başlamak için oynat tuşuna basın.') ?></p>
      </div>
      <div class="live-controls" data-vvveb-disabled-noback>
        <audio id="radio-audio" src="<?= theme_settings('radio_stream_url', m_get_session('editor_lang')) ?: '' ?>"></audio>
        <button class="btn play" onclick="(function(el){var a=document.getElementById('radio-audio'); if(!a) return; if(a.paused){ a.play(); el.classList.add('is-playing'); } else { a.pause(); el.classList.remove('is-playing'); } })(this)">
          <span><?= lang('radyo.listen_now', [], 'Şimdi Dinle') ?></span>
        </button>
      </div>
    </div>
  </div>
</section>
`
});

Vvveb.Sections.add("radyo/schedule", {
name: "<?= lang('sections.radyo_schedule', [], 'Radyo Yayın Akışı') ?>",
image: "<?= SITE_THEME_URL ?>/assets/preview/schedule.png",
html: `
<section class="radio-schedule" data-component="schedule">
  <div class="container">
    <h2 class="section-title"><?= lang('radyo.schedule', [], 'Yayın Akışı') ?></h2>
    <div class="schedule-list" data-vvveb-disabled-noback>
      <ul class="list">
        <li class="item">
          <span class="time">06:00 - 08:00</span>
          <span class="program"><?= lang('radyo.program.morning', [], 'Sabah Programı') ?></span>
        </li>
        <li class="item">
          <span class="time">08:00 - 10:00</span>
          <span class="program"><?= lang('radyo.program.news', [], 'Haberler') ?></span>
        </li>
        <li class="item">
          <span class="time">10:00 - 12:00</span>
          <span class="program"><?= lang('radyo.program.music', [], 'Müzik Kuşağı') ?></span>
        </li>
      </ul>
    </div>
    <div class="schedule-cta">
      <a href="<?=DOMAIN?>/yayin-akisi" class="btn"><?= lang('radyo.schedule.view_all', [], 'Tüm Yayın Akışı') ?></a>
    </div>
  </div>
</section>
`
});


