Spaces:
Running
Running
Update templates/interface.html
Browse files- templates/interface.html +9 -16
templates/interface.html
CHANGED
@@ -53,7 +53,7 @@
|
|
53 |
<!-- Add other input fields and elements here -->
|
54 |
<div>
|
55 |
<button type="submit" id="synthesize_button">Synthesize</button>
|
56 |
-
|
57 |
</div>
|
58 |
|
59 |
{% if file_url %}
|
@@ -63,14 +63,14 @@
|
|
63 |
Your browser does not support the audio element.
|
64 |
</audio>
|
65 |
<a href="{{ file_url }}" download>Download Audio</a>
|
66 |
-
|
67 |
-
|
68 |
// Get references to the checkbox and audio elements
|
69 |
-
|
70 |
-
|
71 |
|
72 |
// Add an event listener to the checkbox
|
73 |
-
|
74 |
// If the checkbox is checked, add the autoplay attribute
|
75 |
if (playCheckbox.checked) {
|
76 |
audioPlayer.setAttribute("autoplay", "");
|
@@ -78,21 +78,14 @@
|
|
78 |
// If the checkbox is unchecked, remove the autoplay attribute
|
79 |
audioPlayer.removeAttribute("autoplay");
|
80 |
}
|
81 |
-
|
82 |
-
</script>
|
83 |
|
84 |
|
85 |
|
86 |
</form>
|
87 |
|
88 |
-
|
89 |
-
// JavaScript function for handling the "Exit" button click
|
90 |
-
function closeGUI() {
|
91 |
-
// Add logic to close the GUI if needed
|
92 |
-
alert("Closing the GUI");
|
93 |
-
}
|
94 |
-
</script>
|
95 |
-
|
96 |
<!-- Add any JavaScript scripts or functions here -->
|
97 |
</body>
|
98 |
</html>
|
|
|
53 |
<!-- Add other input fields and elements here -->
|
54 |
<div>
|
55 |
<button type="submit" id="synthesize_button">Synthesize</button>
|
56 |
+
|
57 |
</div>
|
58 |
|
59 |
{% if file_url %}
|
|
|
63 |
Your browser does not support the audio element.
|
64 |
</audio>
|
65 |
<a href="{{ file_url }}" download>Download Audio</a>
|
66 |
+
{% endif %}
|
67 |
+
<script>
|
68 |
// Get references to the checkbox and audio elements
|
69 |
+
const playCheckbox = document.getElementById("play");
|
70 |
+
const audioPlayer = document.getElementById("audio-player");
|
71 |
|
72 |
// Add an event listener to the checkbox
|
73 |
+
playCheckbox.addEventListener("change", function () {
|
74 |
// If the checkbox is checked, add the autoplay attribute
|
75 |
if (playCheckbox.checked) {
|
76 |
audioPlayer.setAttribute("autoplay", "");
|
|
|
78 |
// If the checkbox is unchecked, remove the autoplay attribute
|
79 |
audioPlayer.removeAttribute("autoplay");
|
80 |
}
|
81 |
+
});
|
82 |
+
</script>
|
83 |
|
84 |
|
85 |
|
86 |
</form>
|
87 |
|
88 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
<!-- Add any JavaScript scripts or functions here -->
|
90 |
</body>
|
91 |
</html>
|