-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
42 lines (31 loc) · 941 Bytes
/
app.js
File metadata and controls
42 lines (31 loc) · 941 Bytes
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
// Scrolling Animations
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
console.log(entry);
if(entry.isIntersecting) {
entry.target.classList.add('show');
} else {
entry.target.classList.remove('show');
}
})
});
const hiddenElements = document.querySelectorAll('.hidden');
hiddenElements.forEach((element) => observer.observe(element));
// Video Hover Effects
const videos = document.querySelectorAll('.video');
var windowWidth = window.innerWidth;
var min_width = 768;
videos.forEach(video => {
video.addEventListener('mouseover', () => {
video.style.filter = "blur(0px)"
});
video.addEventListener('mouseout', () => {
video.style.filter = "blur(3px)"
});
});
// Copy email to clipboard function
const email = "oscar.rosales1018@gmail.com"
function copyEmail() {
navigator.clipboard.writeText(email);
alert("E-mail copied to clipboard!")
}