2024-02-29 17:47:16 +03:00
|
|
|
<template>
|
2024-03-01 12:31:16 +03:00
|
|
|
<header>
|
2024-04-18 21:13:23 +03:00
|
|
|
<img ref="logoEl" class="logo" src="/logo-no-bg.png" alt="KPTL">
|
2024-03-01 12:31:16 +03:00
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="grid">
|
2024-04-18 21:46:59 +03:00
|
|
|
<AppCard v-for="card in cards" ref="cardEls" :key="card.title" v-bind="card" />
|
2024-04-18 21:13:23 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
2024-03-02 15:35:48 +03:00
|
|
|
|
2024-04-18 21:13:23 +03:00
|
|
|
<script setup>
|
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
|
import { gsap } from 'gsap'
|
2024-04-18 21:46:59 +03:00
|
|
|
import AppCard from '~/components/app-card.vue'
|
2024-04-18 21:13:23 +03:00
|
|
|
|
|
|
|
const cards = ref([
|
|
|
|
{
|
|
|
|
title: 'TeamSpeak',
|
|
|
|
action: 'Попиздеть',
|
|
|
|
img: '/ts.png',
|
|
|
|
href: 'https://invite.teamspeak.com/koptilnya.xyz/',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Dota 2',
|
|
|
|
action: 'Поиграть',
|
|
|
|
img: '/dota.png',
|
|
|
|
href: 'steam://run/570',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Gitea',
|
|
|
|
action: 'Поработать',
|
|
|
|
img: '/gitea.svg',
|
|
|
|
href: 'https://git.koptilnya.xyz',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'YouTube',
|
|
|
|
action: 'Посмотреть',
|
|
|
|
img: '/youtube.png',
|
|
|
|
href: 'https://www.youtube.com/@kptl-team',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'База знаний',
|
|
|
|
action: 'Почитать',
|
|
|
|
img: '/bookStack.png',
|
|
|
|
href: 'https://baza.koptilnya.xyz',
|
|
|
|
},
|
|
|
|
])
|
|
|
|
|
2024-04-18 21:46:59 +03:00
|
|
|
const cardEls = ref([])
|
2024-04-18 21:13:23 +03:00
|
|
|
const logoEl = ref()
|
|
|
|
|
2024-04-18 21:28:18 +03:00
|
|
|
const DURATION = 0.3
|
2024-04-18 21:13:23 +03:00
|
|
|
const OVERLAP = 0.15
|
|
|
|
const CARD_OPTIONS = {
|
|
|
|
duration: DURATION,
|
|
|
|
ease: 'power1.out',
|
|
|
|
scale: 1.025,
|
|
|
|
yoyo: true,
|
|
|
|
repeat: 1,
|
2024-04-18 21:28:18 +03:00
|
|
|
opacity: 1,
|
2024-04-18 21:13:23 +03:00
|
|
|
}
|
2024-03-02 15:35:48 +03:00
|
|
|
|
2024-04-18 21:13:23 +03:00
|
|
|
onMounted(() => {
|
2024-04-18 21:46:59 +03:00
|
|
|
const groupsCount = Math.ceil((cardEls.value.length - 1) / 2)
|
2024-03-02 15:35:48 +03:00
|
|
|
|
2024-04-18 21:13:23 +03:00
|
|
|
const t = gsap.timeline()
|
2024-04-18 17:01:17 +03:00
|
|
|
|
2024-04-18 21:46:59 +03:00
|
|
|
if (cardEls.value[0])
|
|
|
|
t.to(cardEls.value[0].$el, CARD_OPTIONS)
|
2024-04-18 17:01:17 +03:00
|
|
|
|
2024-04-18 21:13:23 +03:00
|
|
|
for (let i = 0; i < groupsCount; i++) {
|
2024-04-18 21:46:59 +03:00
|
|
|
if (cardEls.value[i * 2 + 1])
|
|
|
|
t.to(cardEls.value[i * 2 + 1].$el, CARD_OPTIONS, `<${OVERLAP}`)
|
2024-04-18 17:01:17 +03:00
|
|
|
|
2024-04-18 21:46:59 +03:00
|
|
|
if (cardEls.value[i * 2 + 2])
|
|
|
|
t.to(cardEls.value[i * 2 + 2].$el, CARD_OPTIONS, `<<${OVERLAP}`)
|
2024-04-18 21:13:23 +03:00
|
|
|
}
|
2024-02-29 17:47:16 +03:00
|
|
|
|
2024-04-18 21:13:23 +03:00
|
|
|
t.fromTo(
|
|
|
|
logoEl.value,
|
2024-04-18 21:28:18 +03:00
|
|
|
{ opacity: 0, y: 50 },
|
2024-04-18 21:13:23 +03:00
|
|
|
{ opacity: 1, y: 0, ease: 'power1.out', duration: DURATION },
|
|
|
|
`<`,
|
|
|
|
)
|
|
|
|
})
|
2024-02-29 17:47:16 +03:00
|
|
|
</script>
|
2024-03-01 12:31:16 +03:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@mixin mobile {
|
|
|
|
@media (max-width: 600px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
header {
|
|
|
|
text-align: center;
|
|
|
|
padding-block: 16px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
width: 64px;
|
2024-04-18 21:13:23 +03:00
|
|
|
opacity: 0;
|
2024-03-01 12:31:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.grid {
|
2024-04-18 21:28:18 +03:00
|
|
|
width: 800px;
|
2024-03-01 12:31:16 +03:00
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
gap: 16px;
|
|
|
|
|
|
|
|
@include mobile {
|
2024-04-18 21:28:18 +03:00
|
|
|
width: 100%;
|
2024-03-01 12:31:16 +03:00
|
|
|
grid-template-columns: 1fr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|