summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-05-16 19:50:15 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-05-16 19:50:15 -0400
commita00c0aab1eb5a7a55bef8ca08115bdd722ab5699 (patch)
tree45b5c4cc8c380d0630a8e0185af7229f26dc754a /index.js
parent4941a1874b6ca9d142d94df70b2aec5e0b35b94e (diff)
Moved the frontend directory up so that it no longer exists
Diffstat (limited to 'index.js')
-rw-r--r--index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..e05b25c
--- /dev/null
+++ b/index.js
@@ -0,0 +1,28 @@
+/// <reference path="scripts/jquery-3.5.1.min.js"/>
+
+(function() {
+ function main() {
+
+ // Retrieve the navbar
+ $.get('/navbar.html', function(pData) {
+ $('nav').html(pData);
+
+ // Set selected tab as selected
+ $('nav').find('a').removeClass('nav-selected');
+ $('nav').find('a[href="' + window.location.pathname + '"').addClass('nav-selected');
+ });
+
+ // Set up show/hide functionality on the play/stop buttons
+ $('.play_button').on('click', function() {
+ $(this).hide();
+ $(this).parent().find('.stop_button').show();
+ });
+
+ $('.stop_button').on('click', function() {
+ $(this).hide();
+ $(this).parent().find('.play_button').show();
+ });
+ }
+
+ $(document).ready(main);
+})()