Skip to content

Commit 0861c30

Browse files
fix
1 parent b0c6965 commit 0861c30

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

script.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
document.addEventListener("DOMContentLoaded", () => {
2+
23
// Animasi scroll (fade-in saat di-scroll)
4+
35
const sections = document.querySelectorAll(".slide-up");
4-
56
const scrollAnimation = () => {
67
sections.forEach(section => {
78
const sectionTop = section.getBoundingClientRect().top;
@@ -16,7 +17,9 @@ document.addEventListener("DOMContentLoaded", () => {
1617
window.addEventListener("scroll", scrollAnimation);
1718
scrollAnimation(); // Jalankan sekali di awal untuk memeriksa posisi awal
1819

20+
1921
// Animasi hover di navigasi
22+
2023
const navLinks = document.querySelectorAll("nav ul li a");
2124

2225
navLinks.forEach(link => {
@@ -30,15 +33,19 @@ document.addEventListener("DOMContentLoaded", () => {
3033
});
3134
});
3235

36+
3337
// Efek ketik otomatis di header
38+
3439
const typingText = document.querySelector("header p");
3540
const words = ["Mahasiswa Teknik Informatika", "Web Developer", "Tech Enthusiast", "Cyber ​​Security Analyst"];
3641

3742
let wordIndex = 0;
3843
let charIndex = 0;
3944
let isDeleting = false;
4045

46+
4147
// Ubah kecepatan di sini
48+
4249
const typingSpeed = 150; // Kecepatan mengetik (ms)
4350
const erasingSpeed = 50; // Kecepatan menghapus (ms)
4451
const delayBetweenWords = 1500; // Jeda sebelum hapus teks (ms)
@@ -71,7 +78,6 @@ document.addEventListener("DOMContentLoaded", () => {
7178
typeEffect();
7279

7380

74-
7581
const eraseEffect = () => {
7682
if (charIndex > 0) {
7783
typingText.textContent = words[wordIndex].substring(0, charIndex - 1);
@@ -90,7 +96,9 @@ document.addEventListener("DOMContentLoaded", function () {
9096
const track = document.querySelector(".carousel-track");
9197
const items = Array.from(track.children);
9298

99+
93100
// Gandakan isi slider agar tidak ada celah kosong
101+
94102
items.forEach(item => {
95103
const clone = item.cloneNode(true);
96104
track.appendChild(clone);

0 commit comments

Comments
 (0)