commit fdb7d28880a0f89e781b4cca220531d2c8f411fb
parent dfeccdbc78257677180522f3119a923da2d6ad12
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date: Sun, 26 Apr 2020 12:15:03 -0700
Implement thankyou screen.
Diffstat:
2 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/Songs2Slides/static/index.js b/Songs2Slides/static/index.js
@@ -63,6 +63,10 @@ async function SubmitSongs() {
// Download powerpoint
download(await rawResponse.blob());
+
+ // Show and hide elements
+ document.getElementById("songs").hidden = true;
+ document.getElementById("thankyou").hidden = false;
}
@@ -108,12 +112,35 @@ async function SubmitLyrics() {
// Download powerpoint
download(await rawResponse.blob());
+
+ // Show and hide elements
+ document.getElementById("lyricsContainer").hidden = true;
+ document.getElementById("thankyou").hidden = false;
}
// Makes the songs div visible
-function Reset() {
+function Back() {
document.getElementById("songs").hidden = false;
document.getElementById("lyricsContainer").hidden = true;
+ document.getElementById("thankyou").hidden = true;
+}
+
+
+
+// Makes the songs div visible and removes songs
+function Reset() {
+ // Remove songs
+ songs = document.getElementsByClassName("song");
+ while (songs.length > 0) {
+ // Get song
+ songs[0].parentNode.removeChild(songs[0]);
+ }
+
+ // Add blank song
+ AddSong();
+
+ // Makes songs visible
+ Back();
}
\ No newline at end of file
diff --git a/Songs2Slides/templates/index.html b/Songs2Slides/templates/index.html
@@ -19,7 +19,7 @@
<button onclick="ReviewLyrics();">Review Lyrics</button><br/><br/>
<template id="songTemplate">
- <div>
+ <div class="song">
<input type="text" class="title" placeholder="Song Title"/>
<input type="text" class="artist" placeholder="Song Artist"/>
<a id="remove" class="songRemove">╳</a>
@@ -33,7 +33,12 @@
<textarea rows="10" id="lyrics">Loading lyrics...</textarea><br/>
<button id="submitLyricsButton" onclick="SubmitLyrics();">Create Powerpoint</button>
- <a id="lyricsBack" href="javascript:Reset()">Back</a>
+ <a id="lyricsBack" href="javascript:Back()">Back</a>
+ </div>
+
+ <div id="thankyou" hidden>
+ Thankyou for using Songs2Slides<br/><br/>
+ Click <a href="javascript:Reset()">here</a> to create another PowerPoint.
</div>
</body>
</html>
\ No newline at end of file