Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s #69

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

s #69

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Lab 5 - Starter
Maryam Usman and Jenny Quach
26 changes: 26 additions & 0 deletions assets/scripts/expose.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());





}
2 changes: 1 addition & 1 deletion expose.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Lab 5 - Party Horn</title>

<!-- JS Confetti -->
<script src="./assets/scripts/js-confetti.browser.js"></script>
<script src="./assets/scripts/expose.js"></script>

<!-- Main Stylesheet & Scripts -->
<link rel="stylesheet" href="assets/styles/global.css" />
Expand Down