From 47fe262d83c2d1fbd89922892a4685902af5ea59 Mon Sep 17 00:00:00 2001
From: Nathan McRae
Date: Sat, 11 Mar 2023 12:42:10 -0800
Subject: [PATCH] Added lamp for visual feedback on tones
---
index.html | 1 +
morse-code_files/morse-code.js | 2 ++
morse-code_files/styles.css | 14 +++++++++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/index.html b/index.html
index d0a31e4..c9d42c0 100644
--- a/index.html
+++ b/index.html
@@ -54,6 +54,7 @@ available towards the bottom.
+
diff --git a/morse-code_files/morse-code.js b/morse-code_files/morse-code.js
index f499bc8..102f200 100644
--- a/morse-code_files/morse-code.js
+++ b/morse-code_files/morse-code.js
@@ -30,11 +30,13 @@ async function initializeAudioContext() {
function startNotePlaying() {
// Pass a start time of 0 so it starts ramping up immediately.
gain_node.gain.setTargetAtTime(0.1, 0, 0.001)
+ $("#beepLamp").addClass("lamp-on")
}
function stopNotePlaying() {
// Pass a start time of 0 so it starts ramping down immediately.
gain_node.gain.setTargetAtTime(0, 0, 0.001)
+ $("#beepLamp").removeClass("lamp-on")
}
diff --git a/morse-code_files/styles.css b/morse-code_files/styles.css
index 6117630..a507d04 100644
--- a/morse-code_files/styles.css
+++ b/morse-code_files/styles.css
@@ -24,6 +24,18 @@
font-size: 20px;
}
+ .lamp {
+ width: 100px;
+ height: 100px;
+ border-radius: 100%;
+ margin: 10px;
+ font-size: 20px;
+ }
+
+ .lamp-on {
+ background: darkgray;
+ }
+
.game-container {
display: flex;
justify-content: center;
@@ -57,4 +69,4 @@
#speed-table {
max-width: 100%;
overflow: scroll;
- }
\ No newline at end of file
+ }