From 57c2045312bddbcebd05b8301666cdfc37988cf0 Mon Sep 17 00:00:00 2001 From: Paolo Bautista Date: Mon, 28 Mar 2022 00:29:41 -0400 Subject: [PATCH] Working Stopwatch & Working Web Form API --- week-9/stopwatch/index.html | 20 +++++++++++ week-9/stopwatch/main.js | 21 +++++++++++ week-9/stopwatch/style.css | 12 +++++++ week-9/web form 2.0/emailForm.html | 57 ++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 week-9/stopwatch/index.html create mode 100644 week-9/stopwatch/main.js create mode 100644 week-9/stopwatch/style.css create mode 100644 week-9/web form 2.0/emailForm.html diff --git a/week-9/stopwatch/index.html b/week-9/stopwatch/index.html new file mode 100644 index 0000000..a6fd78b --- /dev/null +++ b/week-9/stopwatch/index.html @@ -0,0 +1,20 @@ + + + + + + + Stopwatch App + + + +
+

Week 9 Stopwatch

+ + +

Seconds Passed:

+
+ + + + \ No newline at end of file diff --git a/week-9/stopwatch/main.js b/week-9/stopwatch/main.js new file mode 100644 index 0000000..b2545a1 --- /dev/null +++ b/week-9/stopwatch/main.js @@ -0,0 +1,21 @@ +let startBtn = document.querySelector('#start') + let stopBtn = document.querySelector('#stop') + let intervalId; + let timer = document.querySelector('#timer') + let counter = 0; + + function change(){ + timer.innerHTML = "Seconds Passed: " + counter; + } + + startBtn.addEventListener('click', function(){ + intervalId = setInterval(function(){ + console.log('1 second has passed') + counter += 1; + change(); + }, 1000) + }) + + stopBtn.addEventListener('click', function(){ + clearInterval(intervalId) + }) \ No newline at end of file diff --git a/week-9/stopwatch/style.css b/week-9/stopwatch/style.css new file mode 100644 index 0000000..19f934c --- /dev/null +++ b/week-9/stopwatch/style.css @@ -0,0 +1,12 @@ +#container { + border: solid; + border-radius: 3em; + padding: 1em; + display: inline-block; + text-align: center; +} + +body { + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/week-9/web form 2.0/emailForm.html b/week-9/web form 2.0/emailForm.html new file mode 100644 index 0000000..a188fed --- /dev/null +++ b/week-9/web form 2.0/emailForm.html @@ -0,0 +1,57 @@ + + + + + + Week 8 Part 2 + + +
+
+
+
+
+ + + + +

+
+ + + + + + + \ No newline at end of file