Skip to content

Commit fe5a750

Browse files
authored
Merge pull request #28 from shaswatcodes28/typing-effect
feat: typing animation for hero page
2 parents 8242609 + eb1b26e commit fe5a750

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

bihar-culture-landing/style.css

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,16 @@ header::before {
7878
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
7979
opacity: 0.3;
8080
}
81+
@keyframes typing {
82+
from { width: 0 }
83+
to { width: 100% }
84+
}
8185

86+
/* The typewriter cursor effect */
87+
@keyframes blink-caret {
88+
from, to { border-color: transparent }
89+
50% { border-color: orange; }
90+
}
8291
.header-content {
8392
position: relative;
8493
z-index: 2;
@@ -87,19 +96,26 @@ header::before {
8796
}
8897

8998
.header-content h1 {
90-
font-size: clamp(2.5rem, 6vw, 4.5rem);
91-
font-weight: 700;
92-
margin: 0 auto;
93-
94-
/*margin-bottom: 0.5rem;*/
95-
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
99+
overflow: hidden;
100+
border-right: .15em solid orange;
101+
white-space: nowrap;
102+
margin: 0 auto;
103+
letter-spacing: .15em;
104+
animation:
105+
typing 3.5s steps(40, end),
106+
blink-caret .75s step-end infinite;
107+
96108
}
97109

98110
.header-content h2 {
99-
font-size: clamp(1.5rem, 3vw, 2.5rem);
100-
font-weight: 400;
101-
margin-bottom: 1rem;
102-
opacity: 0.9;
111+
overflow: hidden;
112+
border-right: .15em solid orange;
113+
white-space: nowrap;
114+
margin: 0 auto;
115+
letter-spacing: .15em;
116+
animation:
117+
typing 3.5s steps(40, end),
118+
blink-caret .75s step-end infinite;
103119
}
104120

105121
.tagline {

0 commit comments

Comments
 (0)