From 0f892fe89aeb74d67bc30b128bd542cdec881b29 Mon Sep 17 00:00:00 2001 From: Andy Hubert Date: Tue, 23 Jul 2024 18:16:14 +0000 Subject: [PATCH] abi: made funcs to move between pages --- abi/main.js | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/abi/main.js b/abi/main.js index ecbfc0d..92d39f1 100644 --- a/abi/main.js +++ b/abi/main.js @@ -1,9 +1,44 @@ -// document.querySelector('#stick-figure').innerHTML = "" -// document.querySelector('#view-log').addEventListener('click', () => { -// }) -// document.querySelector('#screen-buttons').classList.add('hide') +let startWorkoutFunction = () => { + document.querySelector('#screen-buttons').classList.add('hide') + document.querySelector('#screen-workout').classList.remove('hide') +} + +document.querySelector('#do-legs').addEventListener('click', + () => { + startWorkoutFunction() + } +) +document.querySelector('#do-arms').addEventListener('click', + () => { + startWorkoutFunction() + } +) +document.querySelector('#do-random').addEventListener('click', + () => { + startWorkoutFunction() + } +) +document.querySelector('#cancel').addEventListener('click', + () => { + document.querySelector('#screen-workout').classList.add('hide') + document.querySelector('#screen-buttons').classList.remove('hide') + } +) +document.querySelector('#view-log').addEventListener('click', + () => { + document.querySelector('#screen-buttons').classList.add('hide') + document.querySelector('#screen-log').classList.remove('hide') + } +) +document.querySelector('#back').addEventListener('click', + () => { + document.querySelector('#screen-log').classList.add('hide') + document.querySelector('#screen-buttons').classList.remove('hide') + } +) +// document.querySelector('#stick-figure').innerHTML = "" // Things my program needs to do: // if buttin is pushed start the workout chosen