forked from MyArtverse-Project/MyArtverse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kerby Keith Aquino
committed
Feb 9, 2023
1 parent
b56ab13
commit 6819058
Showing
3 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<script setup lang="ts"> | ||
const gridItems = [ | ||
{ | ||
heading: "Manage your ref sheets", | ||
description: | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in sapien dictum, maximus mi et, convallis dui. In vitae cursus elit.", | ||
}, | ||
{ | ||
heading: "Organize your commissions and photos", | ||
description: | ||
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", | ||
}, | ||
{ | ||
heading: "Maybe open commissions and stuff", | ||
description: | ||
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", | ||
}, | ||
] | ||
const cardContainer = ref<HTMLDivElement>() | ||
const cards = ref<HTMLDivElement[]>() | ||
onMounted(() => { | ||
const container = cardContainer.value! | ||
container.onmouseenter = () => { | ||
container.classList.add("active") | ||
} | ||
container.onmouseleave = () => { | ||
container.classList.remove("active") | ||
} | ||
container.onmousemove = ({ clientX, clientY }: MouseEvent) => { | ||
for (const item of cards.value!) { | ||
const rekt = item.getBoundingClientRect() | ||
const posX = clientX - rekt.left | ||
const posY = clientY - rekt.top | ||
item.style.setProperty("--pos-x", `${posX}px`) | ||
item.style.setProperty("--pos-y", `${posY}px`) | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<section class="px-12 h-[80vh]"> | ||
<h1 class="my-6 mt-[6.5rem] text-5xl font-bold text-center font-inter"> | ||
You're in control | ||
</h1> | ||
<div ref="cardContainer" class="card-container"> | ||
<div | ||
ref="cards" | ||
class="card-item" | ||
v-for="(item, index) in gridItems" | ||
:key="index" | ||
> | ||
<div id="card-contents"> | ||
<div class="border h-[14rem] rounded-md border-dashed"></div> | ||
<article> | ||
<h2 class="my-3 text-2xl font-bold font-inter"> | ||
{{ item.heading }} | ||
</h2> | ||
<p>{{ item.description }}</p> | ||
</article> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.card { | ||
&-container { | ||
@apply py-16 grid grid-cols-3 gap-6 mx-auto max-w-[1440px]; | ||
&.active > .card-item::before { | ||
opacity: 1; | ||
} | ||
> .card-item::before { | ||
opacity: 0; | ||
} | ||
} | ||
&-item { | ||
@apply rounded-md relative; | ||
background: rgb(50, 2, 86); | ||
height: 30rem; | ||
&::before { | ||
content: ""; | ||
@apply w-full h-full absolute inset-0 z-[0]; | ||
border-radius: inherit; | ||
transition: opacity 300ms ease; | ||
background: radial-gradient( | ||
450px circle at var(--pos-x) var(--pos-y), | ||
rgb(211, 100, 254), | ||
#0000 100% | ||
); | ||
} | ||
} | ||
} | ||
#card-contents { | ||
@apply bg-zinc-900 p-5 absolute inset-0.5 bottom-10 z-[1] m-[0.01rem]; | ||
height: 99.125%; | ||
border-radius: inherit; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters