-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
86 lines (62 loc) · 2.21 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
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
83
84
85
86
// Aktifkan animasi infinity scroll saat halaman dimuat
document.addEventListener('DOMContentLoaded', function() {
var container = document.querySelector('.container-scroll');
container.classList.add('scroll-animation');
});
document.addEventListener("contextmenu", function (event) {
alert("Lu mau nge inspekk? wkwkwk");
event.preventDefault();
});
const carousel = document.querySelector(".carousel");
function pauseCarousel() {
carousel.style.animationPlayState = "paused";
}
function resumeCarousel() {
carousel.style.animationPlayState = "running";
}
// Tambahkan event listener untuk setiap item di carousel
const items = document.querySelectorAll(".item");
items.forEach((item) => {
item.addEventListener("mouseenter", pauseCarousel);
item.addEventListener("mouseleave", resumeCarousel);
});
// ================================= //
// ================================= //
document.addEventListener("DOMContentLoaded", function () {
const texts = ["PORTFOLIO.", "IMAGINATION.", "TYPOGRAPHY."];
let count = 0;
let index = 0;
let currentText = "";
let letter = "";
const span = document.querySelector(".typing-animation span");
const innerSpan = span.querySelector("span");
function type() {
if (count === texts.length) {
count = 0;
}
currentText = texts[count];
letter = currentText.slice(0, ++index);
span.textContent = letter;
if (letter === currentText) {
innerSpan.style.opacity = "1";
} else {
innerSpan.style.opacity = "0";
}
if (letter.length === currentText.length) {
count++;
index = 0;
}
setTimeout(type, 350); // Delay between transitions in milliseconds
}
type(); // Start typing animation
});
// WEBSITE PROJECT START
const signUpButton = document.getElementById('signUp');
const signInButton = document.getElementById('signIn');
const myproject= document.getElementById('myproject');
signUpButton.addEventListener('click', () => {
myproject.classList.add("right-panel-active");
});
signInButton.addEventListener('click', () => {
myproject.classList.remove("right-panel-active");
});