From 00ccc1ba2a5605fcda4ddc8756476e677ab727ee Mon Sep 17 00:00:00 2001 From: Maryamkusman <93306676+Maryamkusman@users.noreply.github.com> Date: Fri, 5 May 2023 17:16:41 -0700 Subject: [PATCH 1/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f211f6f26..e081940c9 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ # Lab 5 - Starter +Maryam Usman and Jenny Quach \ No newline at end of file From 50ad0c655bbbedd021bb1ba39a774a7b07dc8bc6 Mon Sep 17 00:00:00 2001 From: Maryamkusman <93306676+Maryamkusman@users.noreply.github.com> Date: Fri, 5 May 2023 17:47:43 -0700 Subject: [PATCH 2/5] Update expose.js --- assets/scripts/expose.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/scripts/expose.js b/assets/scripts/expose.js index 962d7a33c..157d3fd5b 100644 --- a/assets/scripts/expose.js +++ b/assets/scripts/expose.js @@ -4,4 +4,5 @@ window.addEventListener('DOMContentLoaded', init); function init() { // TODO + document.getElementsByClassName("expose"); } \ No newline at end of file From e79b16ecd58ed0daafce9ad5ef7139301956da58 Mon Sep 17 00:00:00 2001 From: Jenny Quach <65835856+hoatuyet423@users.noreply.github.com> Date: Sat, 6 May 2023 11:50:51 -0700 Subject: [PATCH 3/5] added set Img and set Audio - still buggy --- assets/scripts/expose.js | 29 ++++++++++++++++++++++++++++- expose.html | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/assets/scripts/expose.js b/assets/scripts/expose.js index 157d3fd5b..bc8acd5f5 100644 --- a/assets/scripts/expose.js +++ b/assets/scripts/expose.js @@ -4,5 +4,32 @@ window.addEventListener('DOMContentLoaded', init); function init() { // TODO - document.getElementsByClassName("expose"); + //let = document.getElementById("expose"); + + var horn = document.getElementById('horn-select'); + var horn_choice = horn.value; + + console.log("hello"); + function setImg(){ + console.log("hello"); + var img = document.querySelector('img'); + + img.src = `assets/images/${horn_choice}.svg`; + console.log(horn_choice); + + } + + //change the image whenever the user chaneg the input of horn + horn.addEventListener('change', setImg()); + + function setAudio(){ + let audio = document.querySelector('audio'); + audio.src = `assets/audio/${horn_choice}.mp3`; + } + horn.addEventListener('change', setAudio()); + + + + + } \ No newline at end of file diff --git a/expose.html b/expose.html index 50e011c9b..270070260 100644 --- a/expose.html +++ b/expose.html @@ -9,7 +9,7 @@ Lab 5 - Party Horn - + From 492af2cc41230f60fcd37e8a56bea862e55079c7 Mon Sep 17 00:00:00 2001 From: Maryamkusman <93306676+Maryamkusman@users.noreply.github.com> Date: Sat, 6 May 2023 19:33:21 -0700 Subject: [PATCH 4/5] changes --- .vscode/launch.json | 15 +++++++++++++++ assets/scripts/expose.js | 13 +++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..2ba986f6f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/assets/scripts/expose.js b/assets/scripts/expose.js index bc8acd5f5..ebca660a5 100644 --- a/assets/scripts/expose.js +++ b/assets/scripts/expose.js @@ -6,14 +6,14 @@ function init() { // TODO //let = document.getElementById("expose"); + + var horn = document.getElementById('horn-select'); var horn_choice = horn.value; - console.log("hello"); - function setImg(){ - console.log("hello"); + //image + function setImg(images){ var img = document.querySelector('img'); - img.src = `assets/images/${horn_choice}.svg`; console.log(horn_choice); @@ -22,9 +22,10 @@ function init() { //change the image whenever the user chaneg the input of horn horn.addEventListener('change', setImg()); - function setAudio(){ - let audio = document.querySelector('audio'); + function setAudio(audio){ + var audio = document.querySelector('audio'); audio.src = `assets/audio/${horn_choice}.mp3`; + } horn.addEventListener('change', setAudio()); From dfee3911b33bca7089040c1113bb3478a27d18e5 Mon Sep 17 00:00:00 2001 From: Maryamkusman <93306676+Maryamkusman@users.noreply.github.com> Date: Sat, 6 May 2023 19:50:24 -0700 Subject: [PATCH 5/5] Update expose.js --- assets/scripts/expose.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/assets/scripts/expose.js b/assets/scripts/expose.js index ebca660a5..1c8a6cbb6 100644 --- a/assets/scripts/expose.js +++ b/assets/scripts/expose.js @@ -4,10 +4,7 @@ window.addEventListener('DOMContentLoaded', init); function init() { // TODO - //let = document.getElementById("expose"); - - - + //let = document.getElementById("expose"); var horn = document.getElementById('horn-select'); var horn_choice = horn.value;