|
36 | 36 |
|
37 | 37 | <body>
|
38 | 38 | <main>
|
39 |
| - <header> |
40 |
| - <div class="foreground"> |
41 |
| - <img src="images/homepage/logo_circle.png" class="logo"> |
42 |
| - |
43 |
| - <div class="title">WEEKLY FLUTTER SPACE</div> |
44 |
| - |
45 |
| - <!-- This spacer has size zero unless screen is narrow --> |
46 |
| - <!-- On narrow screen, this spacer takes up the same height as the phone image --> |
47 |
| - <div class="spacer-for-narrow"> </div> |
48 |
| - |
49 |
| - <div class="upsell">Join us every week for 
 any and all Flutter topics!</div> |
50 |
| - |
51 |
| - <div class="hosts"> |
52 |
| - <p class="title">HOSTS</p> |
53 |
| - <div class="host-container"> |
54 |
| - <div class="host matt"> |
55 |
| - <img src="/images/homepage/photo_matt.png"> |
56 |
| - <p>Matt Carroll</p> |
57 |
| - </div> |
58 |
| - <div class="host ray"> |
59 |
| - <img src="/images/homepage/photo_ray.png"> |
60 |
| - <p>Ray Li</p> |
61 |
| - </div> |
62 |
| - </div> |
| 39 | + <div id="mainPane"> |
| 40 | + <div style="flex: 2;"> </div> |
| 41 | + |
| 42 | + <header> |
| 43 | + <img id="mascot" src="/images/homepage/dash-astronaut.png"> |
| 44 | + <h1>Flutter Spaces</h1> |
| 45 | + <div class="divider"> </div> |
| 46 | + <span class="subtitle">Weekly Flutter Conversations</span> |
| 47 | + </header> |
| 48 | + |
| 49 | + <div style="flex: 2;"> </div> |
| 50 | + |
| 51 | + <div id="episodePlayer"> |
| 52 | + <div id="playerContainer" style="margin: auto; max-width: 500px; height: 200px; overflow: hidden;"> |
| 53 | + <iframe style="width: 100%; height: 200px;" frameborder="no" scrolling="no" allow="clipboard-write" seamless src="https://player.captivate.fm/episode/{{ loadedEpisodes[0].id }}"></iframe> |
63 | 54 | </div>
|
64 | 55 | </div>
|
65 | 56 |
|
66 |
| - <div class="background"> |
67 |
| - <div class="waves-and-phone"> |
68 |
| - <div class="sound-waves-left"> </div> |
69 |
| - <div class="phone"> |
70 |
| - <img src="/images/homepage/phone-space-preview.png"> |
71 |
| - |
72 |
| - <div class="next-show-date"> |
73 |
| - <p class="title">NEXT SPACE</p> |
74 |
| - <!-- This display date is filled by JS --> |
75 |
| - <p id="nextShowDate" class="date"> </p> |
76 |
| - </div> |
| 57 | + <div style="flex: 2;"> </div> |
| 58 | + |
| 59 | + <div id="nextShowCalendar"> |
| 60 | + <div style="display: flex; flex-direction: row; align-items: flex-start;"> |
| 61 | + <div style="font-size: 30px; margin-right: 8px; margin-top:-4px;">📅</div> |
| 62 | + <div style="display: flex; flex-direction: column;"> |
| 63 | + <h3>Next Space</h3> |
| 64 | + <p id="nextShowDate"> </p> |
77 | 65 | </div>
|
78 |
| - <div class="sound-waves-right"> </div> |
79 | 66 | </div>
|
| 67 | + <a target="_blank" href="https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NWxsNHN2dHZqZ2U0Zm1xZWZkM3ZrMzdsdGRfMjAyNTAxMjJUMjAwMDAwWiBlODJhNDE5M2IwODVhOWYwOTAyMjU5YzJmNjIwNDkxYjUyYTk1MmUxMWQxOTRmMTkzODM0ZTMxZmRhZDE1N2NiQGc&tmsrc=e82a4193b085a9f0902259c2f620491b52a952e11d194f193834e31fdad157cb%40group.calendar.google.com&scp=ALL">Add to Calendar</a> |
80 | 68 | </div>
|
81 |
| - </header> |
82 | 69 |
|
83 |
| - <div id="x-divider" style="display: flex;"> |
84 |
| - <hr class="divider" style="flex: 1; align-self: center;"> |
85 |
| - <img src="/images/homepage/x-logo.png" class="logo"> |
86 |
| - <hr class="divider" style="flex: 1; align-self: center;"> |
87 |
| - </div> |
| 70 | + <div style="flex: 2;"> </div> |
88 | 71 |
|
89 |
| - <p class="follow-hosts">Follow <a href="https://x.com/suprdeclarative" target="_blank">Matt</a> and <a href="https://x.com/RayLiVerified" target="_blank">Ray</a> on X</p> |
90 |
| - |
91 |
| - <div id="post-timeline"> |
92 |
| - {% for episode in episodes %} |
93 |
| - |
94 |
| - {% if episode.podcast_id %} |
95 |
| - <div style="margin: auto; max-width: 500px; height: 200px; margin-bottom: 20px; border-radius: 6px; overflow: hidden;"><iframe style="width: 100%; height: 200px;" frameborder="no" scrolling="no" allow="clipboard-write" seamless src="https://player.captivate.fm/episode/{{ episode.podcast_id }}"></iframe></div> |
96 |
| - {% endif %} |
97 |
| - |
98 |
| - <br><br><br> |
99 |
| - {% endfor %} |
| 72 | + <div id="attribution"> |
| 73 | + <p>Built with ❤️ by <a href="https://superdeclarative.com" target="_blank">Matt Carroll</a></p> |
| 74 | + </div> |
| 75 | + </div> |
100 | 76 |
|
101 |
| - <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
| 77 | + <div id="episodeDirectoryPane"> |
| 78 | + <div id="episodeDirectoryWindow"> |
| 79 | + {% for episode in loadedEpisodes %} |
| 80 | + <div class="episode-list-item" episodeId="{{ episode.id }}"> |
| 81 | + <div class="content"> |
| 82 | + <h4>{{ episode.title }}</h4> |
| 83 | + <p class="date">{{ episode.date }}</p> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + {% endfor %} |
| 87 | + </div> |
102 | 88 | </div>
|
103 | 89 | </main>
|
104 |
| - <footer> |
105 |
| - <hr class="divider"> |
106 |
| - <h4>BROUGHT TO YOU BY</h4> |
107 |
| - <p><a href="https://codelessly.com/" target="_blank">Codelessy</a> <a href="https://flutterbountyhunters.com" target="_blank">Flutter Bounty Hunters</a> <a href="https://superdeclarative.com" target="_blank">SuperDeclarative!</a></p> |
108 |
| - </footer> |
109 | 90 |
|
110 | 91 | <script>
|
111 | 92 | onload = (function() {
|
| 93 | + // Select the first episode because Captivate automatically puts |
| 94 | + // that episode in the show player. |
| 95 | + document.querySelector('.episode-list-item').classList.add('selected'); |
| 96 | +
|
112 | 97 | // Find the date of the next show.
|
113 | 98 | var nextShowDate = new Date({{ calendar.next.timestamp }});
|
114 | 99 |
|
|
127 | 112 |
|
128 | 113 | // Set the next show date display string.
|
129 | 114 | var nextShowDateDisplay = document.getElementById("nextShowDate");
|
130 |
| - nextShowDateDisplay.innerHTML = formattedDate + "<BR>" + formattedTime; |
| 115 | + nextShowDateDisplay.innerHTML = formattedDate + " • " + formattedTime; |
| 116 | + }); |
| 117 | +
|
| 118 | + // Attach click handlers to all episodes in the directory. |
| 119 | + const episodeListItems = document.querySelectorAll('.episode-list-item'); |
| 120 | + episodeListItems.forEach(episode => { |
| 121 | + episode.addEventListener('click', () => { |
| 122 | + var episodeId = episode.getAttribute("episodeId"); |
| 123 | + console.log("Loading episode: " + episodeId); |
| 124 | +
|
| 125 | + var episodePlayer = document.getElementById("playerContainer"); |
| 126 | + episodePlayer.innerHTML = `<iframe style="width: 100%; height: 200px;" frameborder="no" scrolling="no" allow="clipboard-write" seamless src="https://player.captivate.fm/episode/${episodeId}"></iframe>`; |
| 127 | +
|
| 128 | + // Remove the "selected" class from all items |
| 129 | + episodeListItems.forEach(el => el.classList.remove('selected')); |
| 130 | +
|
| 131 | + // Add the "selected" class to the clicked item |
| 132 | + episode.classList.add('selected'); |
| 133 | + }); |
131 | 134 | });
|
132 | 135 | </script>
|
133 | 136 | </body>
|
|
0 commit comments