-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
82 lines (61 loc) · 2.15 KB
/
script.js
File metadata and controls
82 lines (61 loc) · 2.15 KB
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
const navLinks = document.querySelectorAll(".nav-link");
let currntUrl = window.location.href
let menueButton = document.getElementById('menu-btn');
let navBar = document.querySelector('.small-dev-menu');
navLinks.forEach(link => {
if(link.href === currntUrl ){
link.classList.add('current-link');
}
});
const aboutParg = document.querySelectorAll('.animated-p');
const aboutPargObserver= new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate');
} else {
entry.target.classList.remove('animate');
}
});
}, {
threshold:0.2
});
aboutParg.forEach((el) => aboutPargObserver.observe(el));
const observer = new IntersectionObserver((enteries) =>{
enteries.forEach((entry) =>{
console.log(entry);
if(entry.isIntersecting){
entry.target.classList.add('show');
}
else{
entry.target.classList.remove('show');
}
});
});
const anitmatedPosts = document.querySelectorAll('.a-post-box');
anitmatedPosts.forEach((el) => observer.observe(el));
//auto type for header
var autoType = document.querySelector(".auto-type");
new Typed(autoType, {
strings : ["Growth", "love", "Groundness"],
typeSpeed : 60,
backSpeed: 60,
loop: true
});
document.addEventListener('scroll', function() {
const logoShow = document.querySelector('.logo-show');
const scrollY = window.scrollY; // Get the vertical scroll position
// Adjust the transform based on scroll position
const scaleValue = 1 + scrollY / 1000; // Scale factor
const opacityValue = Math.max(1 - scrollY / 1000, 0); // Fade out effect
// Apply the transform and opacity to the logo container
logoShow.style.transform = `translate(-50%, -50%) scale(${scaleValue})`;
logoShow.style.opacity = opacityValue;
});
// function showPhoneMenu (){
// navBar.style.display = 'block';
// }
// function hidePhoneMenu (){
// navBar.style.display = 'none';
// }
// menueButton.addEventListener('mouseover', showPhoneMenu);
// menueButton.addEventListener('click', hidePhoneMenu);