Skip to content

Commit e593938

Browse files
authored
(Feat) hidden animation on title (#2)
* Adding small animation on NX title on hover * Creating the author component
1 parent 1db099d commit e593938

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

src/components/Author.astro

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
interface Props {
3+
name: string
4+
}
5+
6+
const { name } = Astro.props
7+
---
8+
9+
<p>
10+
{name}
11+
</p>
12+
13+
<style>
14+
p {
15+
font-family: "Pixelify Sans", sans-serif;
16+
font-size: 1.5rem;
17+
}
18+
</style>

src/pages/index.astro

+25-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import BaseLayout from "../layouts/BaseLayout.astro";
44

55
<BaseLayout>
66
<main>
7-
<h1>NX Academy</h1>
7+
<h1>
8+
<span class="first-letter">N</span><span class="second-letter">X</span> Academy
9+
</h1>
810
<p>Passez au niveau supérieur</p>
911
<div class="buttons-wrapper">
1012
<a class="btn-secondary" href="https://github.com/nx-academy/nx-academy.github.io" target="_blank">Suivre le projet sur GitHub</a>
@@ -31,6 +33,28 @@ import BaseLayout from "../layouts/BaseLayout.astro";
3133
color: #FEFEFE;
3234
}
3335

36+
h1:hover .first-letter {
37+
animation: change-color .8s ease-out infinite;
38+
}
39+
40+
h1:hover .second-letter {
41+
animation: change-color .8s ease-out .4s infinite;
42+
}
43+
44+
@keyframes change-color {
45+
0% {
46+
color: #FEFEFE;
47+
}
48+
49+
50% {
50+
color: #4effa0;
51+
}
52+
53+
100% {
54+
color: #FEFEFE;
55+
}
56+
}
57+
3458
p {
3559
font-size: 1.25rem;
3660
margin-top: 0;

0 commit comments

Comments
 (0)