Skip to content

Commit b732a7e

Browse files
committed
:#
1 parent 37af914 commit b732a7e

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/App.vue

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@
241241
</div>
242242
</div>
243243
</section>
244-
<section
244+
<section id="int"
245245
class="my-box-shadow min-h-svh w-full flex flex-col bg-neutral-950 justify-center items-center px-4 py-4 relative">
246246
<div class="min-h-svh w-full flex flex-col justify-center items-center">
247247
<h3 class="text-2xl sm:text-3xl uppercase text-center border-gradientb pb-2">Interests</h3>
248248
<ul class="grid grid-cols-1 sm:grid-cols-2 justify-items-center items-center gap-4 mt-2">
249249
<li
250250
class="bg-gradient-to-r rounded-md from-[#00ffd52c] to-[#3aff4a2c] px-4 py-1 relative overflow-hidden">
251251
<div class="flex justify-between items-center gap-6 cursor-pointer select-none"
252-
@click="itemsToggle('anime')">
252+
@click="itemsToggle('anime')" id="goint">
253253
My Favorite Anime
254254
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
255255
class="bi bi-caret-down-fill" viewBox="0 0 16 16">
@@ -273,7 +273,7 @@
273273
<li
274274
class="bg-gradient-to-r rounded-md from-[#00ffd52c] to-[#3aff4a2c] px-4 py-1 relative overflow-hidden">
275275
<div class="flex justify-between items-center gap-6 cursor-pointer select-none"
276-
@click="itemsToggle('music')">
276+
@click="itemsToggle('music')" id="goint">
277277
My Favorite Musics
278278
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
279279
class="bi bi-caret-down-fill" viewBox="0 0 16 16">
@@ -299,7 +299,7 @@
299299
<li
300300
class="bg-gradient-to-r rounded-md from-[#00ffd52c] to-[#3aff4a2c] px-4 py-1 relative overflow-hidden">
301301
<div class="flex justify-between items-center gap-6 cursor-pointer select-none"
302-
@click="itemsToggle('game')">
302+
@click="itemsToggle('game')" id="goint">
303303
My Favorite Games
304304
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
305305
class="bi bi-caret-down-fill" viewBox="0 0 16 16">
@@ -319,10 +319,10 @@
319319
</ul>
320320
</Transition>
321321
</li>
322-
<li
322+
<li
323323
class="bg-gradient-to-r rounded-md from-[#00ffd52c] to-[#3aff4a2c] px-4 py-1 relative overflow-hidden">
324324
<div class="flex justify-between items-center gap-6 cursor-pointer select-none"
325-
@click="itemsToggle('books')">
325+
@click="itemsToggle('books')" id="goint">
326326
My Favorite Books
327327
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
328328
class="bi bi-caret-down-fill" viewBox="0 0 16 16">
@@ -361,6 +361,11 @@ let itemsShow = ref({
361361
});
362362
const itemsToggle = (key) => {
363363
itemsShow.value[key] = !itemsShow.value[key];
364+
for (let skey in itemsShow.value) {
365+
if (skey !== key) {
366+
itemsShow.value[skey] = false;
367+
}
368+
}
364369
}
365370
onMounted(() => {
366371
let smoother = ScrollSmoother.create({
@@ -397,8 +402,17 @@ onMounted(() => {
397402
});
398403
});
399404
});
405+
document.querySelectorAll("#goint").forEach((item) => {
406+
item.addEventListener("click", (event) => {
407+
event.preventDefault();
408+
gsap.to(window, {
409+
duration: 1,
410+
scrollTo: document.querySelector("#int"),
411+
ease: "power2.inOut"
412+
});
413+
});
414+
});
400415
});
401-
402416
</script>
403417
<style scoped>
404418
.v-enter-active,

0 commit comments

Comments
 (0)