episodes as $key => $ep) {
- echo "
-
{$ep->title}
-
{$ep->pubDate}
-
{$ep->desc}
-
+ echo "
+
{$ep->title}
+
{$ep->pubDate}
+
{$ep->desc}
+
";
} ?>
diff --git a/tools/script.js b/tools/script.js
index 2576ed0..78fa345 100644
--- a/tools/script.js
+++ b/tools/script.js
@@ -1,9 +1,39 @@
"use strict";
+function getPubDate(epNum) {
+ const epData = document.getElementsByClassName("ep"+epNum+"-pubDate")
+ return epData[0].innerHTML;
+}
+
+function getDesc(epNum) {
+ const epData = document.getElementsByClassName("ep"+epNum+"-desc")
+ return epData[0].innerHTML;
+}
+
+function getAudioSource(epNum) {
+ const epData = document.getElementsByClassName("ep"+epNum+"-audio")
+ return epData[0].innerHTML;
+}
+
window.addEventListener("DOMContentLoaded", function () {
console.log(
"Hewo, c'est renarde 🦊, la créatrice de ce site.\nSi tu veux trouver le code source du site c'est par ici -> "
+ 'https://forgejo.la-taniere-solidaire.gay/Renarde/site-web-le-plus-beau-des-voyages'
);
+
+ const epSelect = document.getElementById("episode-selection");
+ const dPubDate = document.getElementsByClassName("dPubDate");
+ const dDesc = document.getElementsByClassName("dDesc");
+ const dAudio = document.getElementsByClassName("dAudio");
+
+ epSelect.addEventListener('change',function() {
+ dPubDate[0].innerHTML = getPubDate(epSelect.value);
+ dDesc[0].innerHTML = getDesc(epSelect.value);
+ dAudio[0].innerHTML = getAudioSource(epSelect.value);
+ dAudio[0].load()
+
+ })
+
+
})