<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>
        {{ app_config['web_page']['title']|e }}
    </title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett">
    <link rel="preload" href="/static/fonts/noto-sans-display-latin-500.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/static/fonts/fira-code-v12-latin-500.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/static/fonts/fira-code-v12-latin-600.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/static/fonts/fira-code-v12-latin-700.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/static/fonts/noto-sans-display-latin-500italic.woff2" as="font" type="font/woff2"
        crossorigin>
    <script type="module" src="/static/webplayer.js"></script>
    <link rel="stylesheet" href="/static/main.css">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <style>
        #podcast_select,
        #podcast-player-cover,
        .file-list {
            display: none;
        }
    </style>
    <noscript>
        <style>
            #file_list,
            #breadcrumb {
                display: block !important;
            }
        </style>
    </noscript>
</head>

<body>
    <main class="contained-content">
        <h1>{{ app_config['web_page']['title']|e }}</h1>
        {{ header | safe }}
        <noscript>
            <p>This does not work without Javascript enabled!</p>
        </noscript>
        <p>Use a podcast app per the guide if you want to track what you have listened to.</p>
        <div class="custom-select">
            <select id="podcast_select" onchange="loadPodcast(event)">
                <option value="">Select a podcast</option>
                {% for podcast in podcasts %}<option
                    value="{{app_config['inet_path']}}rss/{{ podcast['name_one_word']}}">{{ podcast['new_name'] }}
                </option>{% endfor %}
            </select>
        </div>
        <ul id="podcast-episode-list" class="file-list"></ul>
    </main>
    <div class="podcast-player-offset"></div>
    <div class="podcast-player-footer">
        <div class="podcast-player">
            <hr>
            <div id="podcast-player-cover-container">
                <img id="podcast-player-cover" src="/static/transparent.png" alt="Podcast cover">
            </div>
            <div id="episode-name-and-player-container">
                <p class="podcast-player-text" id="podcast_player_podcast_name">-</p>
                <p class="podcast-player-text" id="podcast_player_episode_name">No episode loaded</p>
                <audio id="podcast-audio-player" class="contained-content" controls preload="metadata" />
            </div>
        </div>
    </div>
</body>

</html>
