-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguitarpractice.html
89 lines (79 loc) · 3.44 KB
/
guitarpractice.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Hey Lucy :)</title>
<link rel="icon" href="assets/one.jpg">
<link rel="stylesheet" href="css/main.css">
<script type="text/javascript" src="js/main.js"></script>
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="wrapper">
<div class="top">
<h1><B>Play this:</B></h1>
<h1 style="font-size: 100; height: 300px; background: lightsteelblue; display: flex; align-items: center; justify-content: center;"><B>
<label id="whatToPlay"></label>
</B></h1>
</div>
Seconds before change:
<span
contenteditable="true"
style="border: solid 1px black; font: 400 13.3333px Arial; color: black;"
id="secondsInput"
>10</span>
List of items (separate by semicolon):
<textarea
style="border: solid 1px black; font: 400 13.3333px Arial; color: black;"
id="optionsInput"
>Maj7, A inversion; Min7, A inversion; Dom7, A inversion; Min7b5, A inversion; Maj7, E inversion; Min7, E inversion; Dom7, E inversion; Min7b5, E inversion</textarea>
<br />
<button
onclick="updateAttributes()"
style="height: 30px; width: 20%; align-self: center"
>
Update
</button>
<br><br><br>
<button
onclick="pianoMajorScales()"
style="height: 30px; width: 20%; align-self: center; background-color: lightcoral"
>
Piano Major Scales
</button>
</div>
</body>
<script>
var secondsInput = document.getElementById("secondsInput");
var timeout = secondsInput.innerText * 1000;
var optionsInput = document.getElementById("optionsInput");
var optionsInputText = optionsInput.value;
var options = optionsInputText.split(';');
var whatToPlay = options[Math.floor(Math.random() * options.length)];
document.getElementById('whatToPlay').innerText = whatToPlay;
function changeText(){
var whatToPlay = options[Math.floor(Math.random() * options.length)];
document.getElementById('whatToPlay').innerText = whatToPlay;
}
myTimer = setInterval(changeText, timeout);
changeText();
function updateAttributes() {
clearInterval(myTimer);
var secondsInput = document.getElementById("secondsInput");
var timeout = secondsInput.innerText * 1000;
var optionsInput = document.getElementById("optionsInput");
var optionsInputText = optionsInput.value;
options = optionsInputText.split(';');
var whatToPlay = options[Math.floor(Math.random() * options.length)];
myTimer = setInterval(changeText, timeout);
changeText();
}
function pianoMajorScales() {
var secondsInput = document.getElementById("secondsInput");
secondsInput.innerText = 60;
var optionsInput = document.getElementById("optionsInput");
optionsInput.value = "C Major; G Major; D Major; A Major; E Major; B Major; F Major; F Sharp/G Flat Major; C Sharp/D Flat Major; A Sharp/B Flat Major; D Sharp/E Flat Major; G Sharp/A Flat Major";
updateAttributes();
}
</script>
</html>