-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
77 lines (63 loc) · 2.84 KB
/
index.js
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
function handleSubmit(){
const smoothing = document.getElementById('smooth').value;
const bins = document.getElementById('bins').value;
const amplitude = document.getElementById('amp').value;
const bars = document.getElementById('bars').value;
const factor = document.getElementById('fact').value;
const radius = document.getElementById('radius').value;
const exponent = document.getElementById('exp').value;
const strokeWeight = document.getElementById('stroke').value;
const affinity = document.getElementById('affinity').value;
const colour = document.getElementById('colour').value;
localStorage.setItem("SMOOTHING", smoothing);
localStorage.setItem("BINS", bins);
localStorage.setItem("AMPLITUDE", amplitude);
localStorage.setItem("BARS", bars);
localStorage.setItem("FACTOR", factor);
localStorage.setItem("RADIUS", radius);
localStorage.setItem("EXPONENT", exponent);
localStorage.setItem("STROKEWEIGHT", strokeWeight);
localStorage.setItem("AFFINITY", affinity);
localStorage.setItem("COLOUR", colour);
if(smoothing && bins && amplitude && bars && factor && radius && exponent && strokeWeight && affinity && colour){location.href = "visualiser.html";}
else{
console.log("one or more fields empty");
}
return;
}
function EDM(){
document.getElementById('smooth').value = 0.5;
document.getElementById('bins').value = 11;
document.getElementById('amp').value = 0.4;
document.getElementById('bars').value = 75;
document.getElementById('fact').value = 500;
document.getElementById('radius').value = 150;
document.getElementById('exp').value = 5;
document.getElementById('stroke').value = 5;
document.getElementById('affinity').value = 1;
document.getElementById('colour').value = "#ee44ee";
}
function classical(){
document.getElementById('smooth').value = 0.65;
document.getElementById('bins').value = 11;
document.getElementById('amp').value = 0.5;
document.getElementById('bars').value = 125;
document.getElementById('fact').value = 200;
document.getElementById('radius').value = 150;
document.getElementById('exp').value = 2.5;
document.getElementById('stroke').value = 3;
document.getElementById('affinity').value = 0.1;
document.getElementById('colour').value = "#3344ff";
}
function rhythmic(){
document.getElementById('smooth').value = 0.7;
document.getElementById('bins').value = 10;
document.getElementById('amp').value = 0.35;
document.getElementById('bars').value = 250;
document.getElementById('fact').value = 300;
document.getElementById('radius').value = 200;
document.getElementById('exp').value = 1.5;
document.getElementById('stroke').value = 1.5;
document.getElementById('affinity').value = 0.1;
document.getElementById('colour').value = "#ff3300";
}