-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
43 lines (40 loc) · 1.05 KB
/
script.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
let canvas1 = document.createElement("canvas");
let canvas2 = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 1024;
canvas.id = "hydra-canvas";
document.body.appendChild(canvas);
const h = new Hydra({
canvas: canvas1,
detectAudio: false,
enableStreamCapture: false,
}).synth
h.osc(4, 0.1, 1.2).out()
const h2 = new Hydra({
canvas: canvas1,
detectAudio: false,
enableStreamCapture: false,
}).synth
h2.noise().out()
//sezione per i tag
const posts = document.querySelectorAll('.post');
const tags = document.querySelectorAll('.tag');
tags.forEach(tag => {
tag.addEventListener('click', () => {
const tagName = tag.getAttribute('data-tag');
posts.forEach(post => {
const postTags = post.querySelectorAll('.tag');
let hasTag = false;
postTags.forEach(postTag => {
if (postTag.getAttribute('data-tag') === tagName) {
hasTag = true;
}
});
if (hasTag) {
post.style.display = 'block';
} else {
post.style.display = 'none';
}
});
});
});