1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
---
import Layout from "../layouts/Layout.astro";
import SocialNavbar from '../components/SocialNavbar.astro';
import ShapesBackground from "../components/ShapesBackground.astro";
---
<Layout title="Pinapelz">
<div class="center-wrapper">
<main>
<h1 class="welcome-message">
<span class="welcome-text-gradient">Welcome</span> 👋
</h1>
<p class="introduction">
I'm <span class="text-gradient">Yukai Shan</span>, a Software Engineering
student at UC Irvine
</p>
<p class="introduction">
Sometimes I make cool things. Feel free to go and check them out!
</p>
<SocialNavbar/>
</main>
</div>
<ShapesBackground/>
<script>
const welcomeMessages = [
'print("Hello World")',
"Hello there",
"Bonjour",
"こにちは",
"你好",
"Ahoy!",
];
let currentIndex = 0;
const h1 = document.querySelector(
"h1.welcome-message span.welcome-text-gradient"
);
function typeMessage(message) {
let i = 0;
h1.textContent = "";
const interval = setInterval(() => {
if (i < message.length) {
h1.textContent += message[i];
i++;
} else {
clearInterval(interval);
currentIndex = (currentIndex + 1) % welcomeMessages.length;
setTimeout(() => {
h1.classList.add("slide-out");
setTimeout(() => {
typeMessage(welcomeMessages[currentIndex]);
h1.classList.remove("slide-out");
}, 1000);
}, 3000);
}
}, 100);
}
typeMessage(welcomeMessages[currentIndex]);
</script>
</Layout>
<style>
@import url("https://fonts.googleapis.com/css?family=Noto:400,700");
* {
margin: 0px;
padding: 0px;
}
body {
font-family: "Noto", sans-serif;
height: 100%;
}
main {
margin: auto;
padding: 1rem;
width: 800px;
max-width: calc(100% - 2rem);
color: white;
font-size: 20px;
line-height: 1.6;
}
.astro-a {
position: absolute;
top: -32px;
left: 50%;
transform: translatex(-50%);
width: 220px;
height: auto;
z-index: -1;
}
h1 {
font-size: 3.5rem;
font-weight: 700;
line-height: 1;
text-align: center;
margin-bottom: 1em;
transition: transform 0.3s ease-in-out;
}
h1:hover {
transform: scale(1.1);
}
.welcome-text-gradient {
background-image: var(--accent-gradient-purp);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 400%;
background-position: 0%;
transition: background-position 0.3s ease-in-out;
}
.text-gradient {
background-image: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 400%;
background-position: 0%;
transition: background-position 0.3s ease-in-out;
}
.slide-out {
transform: translateX(-100%);
transition: transform 0.5s ease-in-out;
}
.introduction {
font-size: 1.5rem;
text-align: center;
color: #ffffffbd;
}
.center-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 90vh;
}
</style>
|