-
Notifications
You must be signed in to change notification settings - Fork 0
/
req.js
30 lines (25 loc) · 882 Bytes
/
req.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
/*
uniform circular motion demo! ()cleoold
*/
// click to show samples, click again to hide
const samplesClickDisplay = document.querySelector('.samples-display > h5');
let samplesShown = false;
samplesClickDisplay.addEventListener('click', (e) => {
if (!samplesShown) {
const urls = [
'./assets/uniformcircular1.gif',
'./assets/uniformcircular2.gif',
'./assets/uniformcircular3.gif',
'./assets/uniformcircular4.gif'
];
for (let url of urls) {
const imgContainer = document.createElement('img');
imgContainer.src = url;
document.querySelector('.samples-display').appendChild(imgContainer);
}
} else {
for (let each of document.querySelectorAll('.samples-display img'))
each.remove();
}
samplesShown = !samplesShown;
});