Skip to content

Commit ff2a5f0

Browse files
committed
Added music and persist
1 parent 74baa97 commit ff2a5f0

3 files changed

Lines changed: 186 additions & 197 deletions

File tree

src/components/aboutbox.astro

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@
8989
Tailwind CSS
9090
</div>
9191
<div class="bg-white/10 px-4 py-2 rounded-lg text-center text-gray-200 hover:bg-blue-400/50 transition-colors duration-300">
92-
Git
92+
Java
9393
</div>
9494
<div class="bg-white/10 px-4 py-2 rounded-lg text-center text-gray-200 hover:bg-blue-400/50 transition-colors duration-300">
95-
SQL
95+
Astro
9696
</div>
9797
<div class="bg-white/10 px-4 py-2 rounded-lg text-center text-gray-200 hover:bg-blue-400/50 transition-colors duration-300">
98-
Docker
98+
C++
9999
</div>
100100
</div>
101101
</div>
@@ -108,38 +108,15 @@
108108
<!-- Experience Item 1 -->
109109
<div class="bg-white/10 p-5 rounded-lg hover:bg-white/15 transition-colors duration-300">
110110
<div class="flex justify-between items-start mb-2">
111-
<h3 class="text-xl font-semibold text-white">Senior Developer</h3>
112-
<span class="text-gray-300 text-sm">2022 - Present</span>
111+
<h3 class="text-xl font-semibold text-white">Intern</h3>
112+
<span class="text-gray-300 text-sm">Sep 2024 - Jan 2025</span>
113113
</div>
114-
<p class="text-blue-400/50 font-medium mb-2">Tech Company Inc.</p>
114+
<p class="text-blue-400/50 font-medium mb-2">MIMOS Berhad</p>
115115
<p class="text-gray-200">
116-
Led development of scalable web applications, mentored junior developers, and implemented best practices for code quality and performance optimization.
116+
Worked on developing IOT solutions
117117
</p>
118118
</div>
119119

120-
<!-- Experience Item 2 -->
121-
<div class="bg-white/10 p-5 rounded-lg hover:bg-white/15 transition-colors duration-300">
122-
<div class="flex justify-between items-start mb-2">
123-
<h3 class="text-xl font-semibold text-white">Full Stack Developer</h3>
124-
<span class="text-gray-300 text-sm">2020 - 2022</span>
125-
</div>
126-
<p class="text-blue-400/50 font-medium mb-2">Startup Solutions</p>
127-
<p class="text-gray-200">
128-
Built full-stack applications using modern frameworks, collaborated with cross-functional teams, and delivered projects on time and within budget.
129-
</p>
130-
</div>
131-
132-
<!-- Experience Item 3 -->
133-
<div class="bg-white/10 p-5 rounded-lg hover:bg-white/15 transition-colors duration-300">
134-
<div class="flex justify-between items-start mb-2">
135-
<h3 class="text-xl font-semibold text-white">Junior Developer</h3>
136-
<span class="text-gray-300 text-sm">2019 - 2020</span>
137-
</div>
138-
<p class="text-blue-400/50 font-medium mb-2">Digital Agency</p>
139-
<p class="text-gray-200">
140-
Developed responsive websites, maintained existing codebases, and learned industry best practices in agile development environments.
141-
</p>
142-
</div>
143120
</div>
144121
</div>
145122

@@ -148,10 +125,10 @@
148125
<h2 class="text-2xl font-semibold text-white mb-4">Education</h2>
149126
<div class="bg-white/10 p-5 rounded-lg">
150127
<div class="flex justify-between items-start mb-2">
151-
<h3 class="text-xl font-semibold text-white">Bachelor of Computer Science</h3>
152-
<span class="text-gray-300 text-sm">2015 - 2019</span>
128+
<h3 class="text-xl font-semibold text-white">Bachelor of Computer Science (Cybersecurity)</h3>
129+
<span class="text-gray-300 text-sm">2025 and ongoing</span>
153130
</div>
154-
<p class="text-blue-400 font-medium">University Name</p>
131+
<p class="text-blue-400 font-medium">Multimedia University</p>
155132
</div>
156133
</div>
157134

src/components/beegbox.astro

Lines changed: 16 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@
6464
animation-delay: 0.4s;
6565
}
6666

67+
@keyframes gentleBounce {
68+
0%, 100% {
69+
transform: translateY(0px);
70+
}
71+
50% {
72+
transform: translateY(-8px);
73+
}
74+
}
75+
76+
.gentle-bounce {
77+
animation: gentleBounce 2s ease-in-out infinite;
78+
}
79+
6780
.glass-effect {
6881
background: rgba(255, 255, 255, 0.08);
6982
backdrop-filter: blur(20px);
@@ -73,65 +86,6 @@
7386
.profile-glow {
7487
box-shadow: 0 0 60px rgba(85, 118, 216, 0.4);
7588
}
76-
77-
.music-button-wrapper {
78-
position: fixed;
79-
bottom: 2rem;
80-
right: 2rem;
81-
z-index: 50;
82-
display: flex;
83-
align-items: center;
84-
}
85-
86-
.music-button {
87-
position: relative;
88-
}
89-
90-
.volume-slider-container {
91-
position: absolute;
92-
right: 100%;
93-
top: 50%;
94-
transform: translateY(-50%);
95-
margin-right: 1rem;
96-
opacity: 0;
97-
transition: opacity 0.3s ease;
98-
pointer-events: none;
99-
}
100-
101-
.music-button-wrapper:hover .volume-slider-container,
102-
.music-button-wrapper.playing .volume-slider-container {
103-
opacity: 1;
104-
pointer-events: auto;
105-
}
106-
107-
.volume-slider {
108-
width: 100px;
109-
height: 4px;
110-
border-radius: 2px;
111-
background: rgba(255, 255, 255, 0.2);
112-
outline: none;
113-
-webkit-appearance: none;
114-
}
115-
116-
.volume-slider::-webkit-slider-thumb {
117-
-webkit-appearance: none;
118-
appearance: none;
119-
width: 14px;
120-
height: 14px;
121-
border-radius: 50%;
122-
background: #60a5fa;
123-
cursor: pointer;
124-
border: 2px solid white;
125-
}
126-
127-
.volume-slider::-moz-range-thumb {
128-
width: 14px;
129-
height: 14px;
130-
border-radius: 50%;
131-
background: #60a5fa;
132-
cursor: pointer;
133-
border: 2px solid white;
134-
}
13589
</style>
13690
</head>
13791
<body class="overflow-hidden">
@@ -162,12 +116,12 @@
162116
<!-- Buttons -->
163117
<div class="flex gap-4 mb-8 fade-in-up delay-300">
164118
<a href="/about" class="flex-1">
165-
<button class="w-full px-6 py-3 bg-blue-400/50 text-white rounded-xl font-medium hover:bg-blue-400/70 hover:scale-105 transition-all duration-300 shadow-lg hover:shadow-blue-400/50">
119+
<button class="w-full px-6 py-3 bg-blue-400/50 text-white rounded-xl font-medium hover:bg-blue-400/70 hover:scale-105 transition-all duration-300 shadow-lg hover:shadow-blue-400/50 cursor-pointer">
166120
About
167121
</button>
168122
</a>
169123
<a href="/projects" class="flex-1">
170-
<button class="w-full px-6 py-3 bg-white/20 text-white rounded-xl font-medium hover:bg-white/30 hover:scale-105 transition-all duration-300">
124+
<button class="w-full px-6 py-3 bg-white/20 text-white rounded-xl font-medium hover:bg-white/30 hover:scale-105 transition-all duration-300 cursor-pointer">
171125
Projects
172126
</button>
173127
</a>
@@ -207,110 +161,8 @@
207161
</div>
208162
</div>
209163

210-
<!-- Music Player Button -->
211-
<div class="music-button-wrapper">
212-
<button id="musicButton" class="music-button w-14 h-14 rounded-full bg-blue-400/50 flex items-center justify-center hover:bg-blue-400/70 transition-all duration-300 shadow-lg border border-white/20 group">
213-
<div class="volume-slider-container">
214-
<input type="range" id="volumeSlider" class="volume-slider" min="0" max="100" value="70">
215-
</div>
216-
<!-- Muted icon (when not playing) -->
217-
<svg id="mutedIcon" class="w-6 h-6 text-white" fill="currentColor" viewBox="0 0 24 24">
218-
<!-- Music note -->
219-
<path d="M12 3v9.28c-.47-.46-1.1-.72-1.8-.72-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" opacity="0.6"/>
220-
<!-- Cross line -->
221-
<line x1="3" y1="21" x2="21" y2="3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
222-
</svg>
223-
<!-- Playing icon (when playing) -->
224-
<svg id="playingIcon" class="w-6 h-6 text-white hidden" fill="currentColor" viewBox="0 0 24 24">
225-
<path d="M12 3v9.28c-.47-.46-1.1-.72-1.8-.72-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"/>
226-
</svg>
227-
</button>
228-
</div>
229-
230164
<script>
231-
// Wait for Howler to load
232-
function initializeMusic() {
233-
if (typeof Howl === 'undefined') {
234-
setTimeout(initializeMusic, 100);
235-
return;
236-
}
237-
238-
const hoverSound = new Howl({
239-
src: ['/hover-sound.mp3'],
240-
volume: 0.5,
241-
onload: () => console.log('Hover sound loaded')
242-
});
243-
244-
const musicPlayer = new Howl({
245-
src: ['/music.mp3'],
246-
volume: 0.7,
247-
loop: true,
248-
onload: () => console.log('Music loaded')
249-
});
250-
251-
let isPlaying = false;
252-
const musicButton = document.getElementById('musicButton');
253-
const musicButtonWrapper = musicButton?.parentElement;
254-
const mutedIcon = document.getElementById('mutedIcon');
255-
const playingIcon = document.getElementById('playingIcon');
256-
const volumeSlider = document.getElementById('volumeSlider');
257-
258-
if (musicButton && musicButtonWrapper) {
259-
console.log('Music button found');
260-
261-
// Hover sound effect
262-
musicButton.addEventListener('mouseenter', () => {
263-
console.log('Hover detected');
264-
hoverSound.play();
265-
});
266-
267-
// Click to toggle music
268-
musicButton.addEventListener('click', (e) => {
269-
// Don't toggle if clicking on slider
270-
if (e.target === volumeSlider || volumeSlider?.contains(e.target as Node)) {
271-
return;
272-
}
273-
console.log('Click detected, isPlaying:', isPlaying);
274-
if (isPlaying) {
275-
musicPlayer.stop();
276-
isPlaying = false;
277-
mutedIcon.classList.remove('hidden');
278-
playingIcon.classList.add('hidden');
279-
musicButtonWrapper.classList.remove('playing');
280-
} else {
281-
musicPlayer.play();
282-
isPlaying = true;
283-
mutedIcon.classList.add('hidden');
284-
playingIcon.classList.remove('hidden');
285-
musicButtonWrapper.classList.add('playing');
286-
}
287-
});
288-
289-
// Volume slider control
290-
if (volumeSlider) {
291-
// Prevent slider clicks from toggling music
292-
volumeSlider.addEventListener('mousedown', (e) => {
293-
e.stopPropagation();
294-
});
295-
296-
volumeSlider.addEventListener('input', (e) => {
297-
e.stopPropagation();
298-
const volume = (e.target as HTMLInputElement).value;
299-
musicPlayer.volume(parseInt(volume) / 100);
300-
console.log('Volume set to:', volume);
301-
});
302-
}
303-
} else {
304-
console.log('Music button not found');
305-
}
306-
}
307-
308-
// Initialize when DOM is ready
309-
if (document.readyState === 'loading') {
310-
document.addEventListener('DOMContentLoaded', initializeMusic);
311-
} else {
312-
initializeMusic();
313-
}
165+
// No music player here anymore - moved to Layout.astro
314166
</script>
315167
</body>
316168
</html>

0 commit comments

Comments
 (0)