Skip to content

Commit fcd8242

Browse files
Merge pull request #3 from naturalfunction/css-animations
Merging - Animated css
2 parents 104b6d0 + e476d2f commit fcd8242

3 files changed

Lines changed: 116 additions & 2 deletions

File tree

assets/scss/custom.scss

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,117 @@
4949
min-width: 24px !important;
5050
text-align: center !important;
5151
}
52+
53+
/* ===== SMOOTH TRANSITIONS ===== */
54+
* {
55+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
56+
}
57+
58+
/* ===== FADE IN ANIMATIONS ===== */
59+
@keyframes fadeInUp {
60+
from {
61+
opacity: 0;
62+
transform: translateY(30px);
63+
}
64+
to {
65+
opacity: 1;
66+
transform: translateY(0);
67+
}
68+
}
69+
70+
@keyframes slideInRight {
71+
from {
72+
opacity: 0;
73+
transform: translateX(50px);
74+
}
75+
to {
76+
opacity: 1;
77+
transform: translateX(0);
78+
}
79+
}
80+
81+
/* ===== ARTICLE CARDS WITH MOVEMENT ===== */
82+
.article-list article {
83+
animation: fadeInUp 0.6s ease-out;
84+
animation-fill-mode: both;
85+
86+
&:hover {
87+
transform: translateY(-8px);
88+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
89+
}
90+
}
91+
92+
/* Stagger animation for multiple articles */
93+
.article-list article:nth-child(1) { animation-delay: 0.1s; }
94+
.article-list article:nth-child(2) { animation-delay: 0.2s; }
95+
.article-list article:nth-child(3) { animation-delay: 0.3s; }
96+
.article-list article:nth-child(4) { animation-delay: 0.4s; }
97+
.article-list article:nth-child(5) { animation-delay: 0.5s; }
98+
99+
/* ===== SIDEBAR SLIDE IN ===== */
100+
.sidebar {
101+
animation: slideInRight 0.8s ease-out;
102+
}
103+
104+
/* ===== FLOATING IMAGES ===== */
105+
@keyframes float {
106+
0%, 100% { transform: translateY(0px); }
107+
50% { transform: translateY(-10px); }
108+
}
109+
110+
.article-image img, .site-avatar img {
111+
animation: float 6s ease-in-out infinite;
112+
113+
&:hover {
114+
animation-play-state: paused;
115+
transform: scale(1.05);
116+
}
117+
}
118+
119+
/* ===== BUTTON HOVER EFFECTS ===== */
120+
.button, .btn, a.button {
121+
&:hover {
122+
transform: translateY(-2px);
123+
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
124+
}
125+
}
126+
127+
/* ===== LINK UNDERLINE ANIMATION ===== */
128+
.menu a {
129+
position: relative;
130+
131+
&::after {
132+
content: '';
133+
position: absolute;
134+
bottom: -5px;
135+
left: 0;
136+
width: 0;
137+
height: 2px;
138+
background: currentColor;
139+
transition: width 0.3s ease;
140+
}
141+
142+
&:hover::after {
143+
width: 100%;
144+
}
145+
}
146+
147+
/* ===== MOBILE OPTIMIZATIONS ===== */
148+
@media (max-width: 768px) {
149+
.article-list article {
150+
animation-delay: 0s;
151+
}
152+
153+
.article-image img, .site-avatar img {
154+
animation: none; /* Disable floating on mobile for performance */
155+
}
156+
}
157+
158+
/* ===== RESPECT USER PREFERENCES ===== */
159+
@media (prefers-reduced-motion: reduce) {
160+
*, *::before, *::after {
161+
animation-duration: 0.01ms !important;
162+
animation-iteration-count: 1 !important;
163+
transition-duration: 0.01ms !important;
164+
}
165+
}

0 commit comments

Comments
 (0)