Skip to content

Commit 1a781a6

Browse files
committed
feat: add animation in header
1 parent 2851d5c commit 1a781a6

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed

src/vue-pages/index.vue

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,35 @@ fetch(`${config.public.baseApiUrl}/private/website_stats`).then((res) => {
3535

3636
<template>
3737
<div>
38+
<div>
39+
<!-- Animated teleport lines -->
40+
<div class="absolute inset-0 teleport-lines-container">
41+
<div v-for="i in 20" :key="i" class="teleport-line"
42+
:style="{
43+
top: `${(i * 5) - 2}%`,
44+
animationDelay: `${Math.random() * 3}s`,
45+
height: `${Math.random() * 1 + 1}px`,
46+
opacity: Math.random() * 0.5 + 0.3
47+
}">
48+
</div>
49+
</div>
50+
51+
<!-- Glowing portal effect -->
52+
<div class="absolute portal-glow"></div>
53+
54+
<!-- Vertical data streams -->
55+
<div class="absolute inset-0 data-streams-container">
56+
<div v-for="i in 10" :key="`stream-${i}`" class="data-stream"
57+
:style="{
58+
left: `${i * 10}%`,
59+
animationDuration: `${Math.random() * 4 + 6}s`,
60+
animationDelay: `${Math.random() * 2}s`,
61+
opacity: Math.random() * 0.3 + 0.1
62+
}">
63+
</div>
64+
</div>
3865
<section class="relative py-12 sm:py-16 lg:pt-20 xl:pb-0">
66+
3967
<div class="relative px-4 mx-auto max-w-7xl sm:px-6 lg:px-8">
4068
<div class="max-w-3xl mx-auto text-center">
4169
<p class="inline-flex px-4 py-2 text-base border border-gray-200 rounded-full font-pj">{{ m.open_source() }}</p>
@@ -109,6 +137,7 @@ fetch(`${config.public.baseApiUrl}/private/website_stats`).then((res) => {
109137
</h3>
110138
</div>
111139
</section>
140+
</div>
112141
<section class="relative py-12 overflow-hidden bg-white sm:py-16 lg:py-20 xl:py-32">
113142
<div class="px-4 mx-auto max-w-7xl sm:px-6 lg:px-8">
114143
<div class="grid items-center grid-cols-1 xl:grid-cols-2">
@@ -649,3 +678,122 @@ fetch(`${config.public.baseApiUrl}/private/website_stats`).then((res) => {
649678
</div>
650679
</div>
651680
</template>
681+
682+
<style scoped>
683+
/* Teleport lines animation */
684+
.teleport-line {
685+
position: absolute;
686+
left: -100%;
687+
width: 100%;
688+
background: linear-gradient(90deg,
689+
transparent 0%,
690+
rgba(56, 189, 248, 0.1) 10%,
691+
rgba(56, 189, 248, 0.3) 50%,
692+
rgba(56, 189, 248, 0.1) 90%,
693+
transparent 100%);
694+
animation: teleport-line 5s cubic-bezier(0.1, 0.9, 0.2, 1) infinite;
695+
}
696+
697+
@keyframes teleport-line {
698+
0% {
699+
transform: translateX(0) scaleX(0.1);
700+
opacity: 0;
701+
}
702+
10% {
703+
opacity: 0.5;
704+
}
705+
100% {
706+
transform: translateX(200%) scaleX(1);
707+
opacity: 0;
708+
}
709+
}
710+
711+
/* Portal glow effect */
712+
.portal-glow {
713+
right: -10%;
714+
top: 50%;
715+
transform: translateY(-50%);
716+
width: 20%;
717+
height: 60%;
718+
background: radial-gradient(
719+
ellipse at center,
720+
rgba(56, 189, 248, 0.15) 0%,
721+
rgba(56, 189, 248, 0.05) 40%,
722+
transparent 70%
723+
);
724+
filter: blur(20px);
725+
animation: portal-pulse 8s ease-in-out infinite;
726+
}
727+
728+
@keyframes portal-pulse {
729+
0%, 100% {
730+
opacity: 0.5;
731+
transform: translateY(-50%) scale(1);
732+
}
733+
50% {
734+
opacity: 0.7;
735+
transform: translateY(-50%) scale(1.1);
736+
}
737+
}
738+
739+
/* Vertical data streams */
740+
.data-stream {
741+
position: absolute;
742+
top: -100%;
743+
width: 1px;
744+
height: 100%;
745+
background: linear-gradient(
746+
to bottom,
747+
transparent 0%,
748+
rgba(56, 189, 248, 0.1) 10%,
749+
rgba(56, 189, 248, 0.3) 50%,
750+
rgba(56, 189, 248, 0.1) 90%,
751+
transparent 100%
752+
);
753+
animation: data-stream 8s linear infinite;
754+
}
755+
756+
@keyframes data-stream {
757+
0% {
758+
transform: translateY(0);
759+
opacity: 0;
760+
}
761+
10% {
762+
opacity: 0.5;
763+
}
764+
100% {
765+
transform: translateY(200%);
766+
opacity: 0;
767+
}
768+
}
769+
770+
/* Button animation */
771+
.teleport-button-line {
772+
position: absolute;
773+
top: 0;
774+
left: -100%;
775+
width: 100%;
776+
height: 100%;
777+
background: linear-gradient(
778+
90deg,
779+
transparent 0%,
780+
rgba(255, 255, 255, 0.2) 50%,
781+
transparent 100%
782+
);
783+
animation: teleport-button 3s cubic-bezier(0.1, 0.9, 0.2, 1) infinite;
784+
}
785+
786+
@keyframes teleport-button {
787+
0% {
788+
transform: translateX(0) skewX(-20deg);
789+
opacity: 0;
790+
}
791+
10% {
792+
opacity: 0.5;
793+
}
794+
100% {
795+
transform: translateX(200%) skewX(-20deg);
796+
opacity: 0;
797+
}
798+
}
799+
</style>

0 commit comments

Comments
 (0)