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/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 diff --git a/assets/scripts/expose.js b/assets/scripts/expose.js index 962d7a33c..1c8a6cbb6 100644 --- a/assets/scripts/expose.js +++ b/assets/scripts/expose.js @@ -4,4 +4,30 @@ window.addEventListener('DOMContentLoaded', init); function init() { // TODO + //let = document.getElementById("expose"); + var horn = document.getElementById('horn-select'); + var horn_choice = horn.value; + + //image + function setImg(images){ + 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(audio){ + var 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 @@