-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
74 lines (70 loc) · 3.15 KB
/
Copy pathindex.html
File metadata and controls
74 lines (70 loc) · 3.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>H4rdi Dev</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="icon" type="image/png" href="https://telegra.ph/file/63918dccba2f979c6b5b8.jpg">
</head>
<body class="light-theme">
<div class="profile-card">
<div class="profile-image">
<img src="https://telegra.ph/file/63918dccba2f979c6b5b8.jpg" alt="Profile Image">
</div>
<div class="profile-info">
<h2>H4rdiDev</h2>
<p>Newbie Developer</p>
<p>Hai! Saya HARDIYANSYAH, seorang pemuda berusia 17 tahun yang bersemangat dari Kepulauan Riau. Saya adalah seseorang yang senang menjelajahi teknologi dan seni, serta selalu mencari tantangan baru untuk dikembangkan.</p>
</div>
<div class="links-container">
<div class="link-card">
<a href="https://wa.me/6281378300839" class="link-item">
<i class="fab fa-whatsapp"></i>
WhatsApp
</a>
</div>
<div class="link-card">
<a href="https://www.instagram.com/hardi.lah" class="link-item">
<i class="fab fa-instagram"></i>
Instagram
</a>
</div>
<div class="link-card">
<a href="https://github.com/H4rdiDev" class="link-item">
<i class="fab fa-github"></i>
GitHub
</a>
</div>
<input type="checkbox" id="theme-toggle" class="switch">
<label for="theme-toggle" class="slider"></label>
</div>
</div>
<script>
// Function to set theme based on localStorage or prefers-color-scheme
function setTheme() {
const themeToggle = document.getElementById('theme-toggle');
const savedTheme = localStorage.getItem('theme');
// Check if theme preference is saved in localStorage
if (savedTheme === 'dark') {
document.body.classList.add('dark-theme');
themeToggle.checked = true;
} else {
// Check prefers-color-scheme to detect system theme preference
const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
document.body.classList.toggle('dark-theme', prefersDarkMode);
localStorage.setItem('theme', prefersDarkMode ? 'dark' : 'light');
themeToggle.checked = prefersDarkMode;
}
// Toggle theme on change
themeToggle.addEventListener('change', () => {
document.body.classList.toggle('dark-theme');
localStorage.setItem('theme', document.body.classList.contains('dark-theme') ? 'dark' : 'light');
});
}
// Call setTheme function when document is ready
document.addEventListener('DOMContentLoaded', setTheme);
</script>
</body>
</html>