Skip to content

Commit ad8b610

Browse files
committed
Enhance UI components with new gradients and animations; update button styles for smoother transitions, improve hero section layout, and add marquee text animation for better visual appeal.
1 parent 155f16e commit ad8b610

File tree

5 files changed

+93
-13
lines changed

5 files changed

+93
-13
lines changed

src/app/(public)/_components/button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export function Button({
1111
...props
1212
}: PropsWithChildren<ButtonProps>) {
1313
return (
14-
<div className="relative inline-block group w-fit">
14+
<div className="relative inline-block group w-fit transition-all duration-500">
1515
<button
1616
className={cn(
17-
'text-sm font-bold inline-flex justify-center items-center uppercase py-3 px-4 text-center text-white bg-primary-btn-gradient shadow-primary-btn-shadow hover:bg-primary-btn-hover-gradient min-w-20 transition-all duration-300 ease-in-out',
17+
'text-sm font-bold inline-flex justify-center items-center uppercase py-3 px-4 text-center text-white bg-primary-btn-gradient shadow-primary-btn-shadow hover:bg-primary-btn-hover-gradient min-w-20',
1818
className
1919
)}
2020
{...props}
2121
>
22-
<p className="btn-clip group-hover:opacity-0 transition-opacity duration-300"></p>
22+
<p className="btn-clip group-hover:opacity-0 duration-300 group-hover:scale-95"></p>
2323
<span className="relative z-20 flex justify-center items-center text-hacktoberfest-light gap-2 font-bold">
2424
{children}
2525
</span>

src/app/(public)/_components/hero.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Link from 'next/link';
1010
import { sortByName } from '@/lib/utils';
1111
import languages from '@/assets/languages.json';
1212
import { HeroSectionSvg } from '@/components/Icons';
13+
import { MarqueTextAnimation } from './marque-text-animation';
1314

1415
const { main: mainLanguages, others: otherLanguages } = languages;
1516

@@ -24,28 +25,29 @@ export function Hero() {
2425
}
2526

2627
return (
27-
<div className="relative min-h-screen bg-[radial-gradient(85.48%_85.48%_at_50%_0%,rgb(64,63,125)_0%,rgb(from_rgb(28,28,63)_r_g_b/_0)_100%)] ">
28-
<div className="z-50 flex justify-center items-center text-center h-screen">
28+
<div className="relative bg-hero-gradient ">
29+
<div className="z-50 flex flex-col space-y-8 justify-center items-center text-center min-h-screen pt-28 sm:pt-24">
2930
<div className="max-w-md space-y-5">
30-
<h1 className="text-5xl font-medium uppercase text-hacktoberfest-light-pink">
31+
<h1 className="text-5xl font-medium uppercase heading-text">
3132
Search your language
3233
</h1>
3334
<form
34-
className="items-center w-full max-w-xs mx-auto form-control"
35+
className="items-center w-full max-w-xs mx-auto form-control outline-none "
3536
onSubmit={handleSearch}
3637
>
3738
<div className="flex w-full">
3839
<div className="relative flex w-full">
3940
<input
4041
type="text"
4142
placeholder="Search for your language"
42-
className="w-full max-w-xs bg-transparent rounded-tr-none rounded-br-none input input-bordered text-hacktoberfest-light border-hacktoberfest-light focus:outline-hacktoberfest-light-pink placeholder:text-hacktoberfest-light-blue"
43+
className="w-full max-w-xs bg-transparent rounded-tr-none rounded-br-none input input-bordered text-hacktoberfest-light border-hacktoberfest-light
44+
focus:border-hacktoberfest-light focus:!outline-none focus-visible:!outline-none placeholder:text-hacktoberfest-light"
4345
name="search"
4446
/>
4547
</div>
4648
<button
4749
type="submit"
48-
className="bg-transparent rounded-tl-none rounded-bl-none group btn btn-square text-hacktoberfest-light-blue border-hacktoberfest-light hover:bg-hacktoberfest-light-pink hover:text-hacktoberfest-deep-pink hover:border-hacktoberfest-light-pink"
50+
className="bg-transparent rounded-tl-none rounded-bl-none group btn btn-square text-hacktoberfest-light border-hacktoberfest-light hover:!border-hacktoberfest-light hover:bg-primary-btn-hover-gradient"
4951
>
5052
<Search />
5153
</button>
@@ -79,6 +81,7 @@ export function Hero() {
7981
</ul>
8082
</div>
8183
</div>
84+
<MarqueTextAnimation />
8285
</div>
8386
<div className="absolute top-0 left-0 w-full h-full -z-10">
8487
<HeroSectionSvg className="w-full h-full" />
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react';
2+
3+
const MarqueeItem = () => (
4+
<>
5+
{Array.from({ length: 4 }).map((_, i) => (
6+
<React.Fragment key={i}>
7+
<span className="text-center italic font-bold text-4xl md:text-6xl uppercase text-transparent text-webkit">
8+
Hacktoberfest 2025
9+
</span>
10+
<span className="w-[68px] h-[12px] bg-square-box-gradient"></span>
11+
</React.Fragment>
12+
))}
13+
</>
14+
);
15+
16+
export function MarqueTextAnimation() {
17+
return (
18+
<div className="w-full overflow-hidden pb-8">
19+
<div className="flex animate-marquee mb-4 sm:mb-8">
20+
<div className="flex gap-10 items-center whitespace-nowrap">
21+
<MarqueeItem />
22+
</div>
23+
<div className="flex gap-10 items-center whitespace-nowrap">
24+
<MarqueeItem />
25+
</div>
26+
</div>
27+
<div className="flex animate-marquee-reverse">
28+
<div className="flex gap-10 items-center whitespace-nowrap">
29+
<MarqueeItem />
30+
</div>
31+
<div className="flex gap-10 items-center whitespace-nowrap">
32+
<MarqueeItem />
33+
</div>
34+
</div>
35+
</div>
36+
);
37+
}

src/styles/globals.css

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ a {
5353
transition:
5454
inset 300ms ease-in-out,
5555
clip-path 300ms ease-in-out,
56-
color 300ms ease-in-out;
56+
color 300ms ease-in-out !important;
57+
}
58+
59+
.btn-clip:hover {
60+
inset: 0px;
61+
color: transparent;
62+
}
63+
64+
.heading-text {
65+
color: #ffffff;
66+
text-shadow: rgb(from #d0cce3 r g b / 0.5) 0px 0px 10px;
5767
}
5868

5969
.container-query {
@@ -90,3 +100,31 @@ a {
90100
@apply w-full left-0;
91101
}
92102
}
103+
.text-webkit {
104+
-webkit-text-stroke: 1px #5a5ab5;
105+
}
106+
107+
@keyframes marquee {
108+
0% {
109+
transform: translateX(0);
110+
}
111+
100% {
112+
transform: translateX(-50%);
113+
}
114+
}
115+
116+
.animate-marquee {
117+
animation: marquee 20s linear infinite;
118+
}
119+
@keyframes marquee-reverse {
120+
0% {
121+
transform: translateX(-50%);
122+
}
123+
100% {
124+
transform: translateX(0);
125+
}
126+
}
127+
128+
.animate-marquee-reverse {
129+
animation: marquee-reverse 20s linear infinite;
130+
}

tailwind.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ const config = {
1212
sans: ['var(--font-space-grotesk)', 'ui-sans-serif', 'system-ui']
1313
},
1414
backgroundImage: {
15-
'gradient-radial':
16-
'radial-gradient(30% 50% at center 50%, var(--tw-gradient-stops))',
1715
'primary-btn-hover-gradient':
1816
'linear-gradient(270deg, rgb(194, 194, 255) 0%, rgb(90, 90, 181) 100%)',
17+
'hero-gradient':
18+
'radial-gradient(85.48% 85.48% at 50% 0%,rgb(64,63,125) 0%,rgb(from rgb(28,28,63) r g b/ 0) 100%)',
1919
'primary-btn-gradient':
20-
'linear-gradient(90deg,rgb(from rgb(90, 90, 181) r g b / 0.15) 0%,rgb(from rgb(194, 194, 255) r g b / 0.15) 100%)'
20+
'linear-gradient(90deg,rgb(from rgb(90, 90, 181) r g b / 0.15) 0%,rgb(from rgb(194, 194, 255) r g b / 0.15) 100%)',
21+
'square-box-gradient':
22+
'linear-gradient(to right,rgb(194, 194, 255) 0px,rgb(194, 194, 255) 12px,transparent 12px,transparent 28px,rgb(90, 90, 181) 28px,rgb(90, 90, 181) 40px,transparent 40px,transparent 56px,rgb(64, 63, 125) 56px,rgb(64, 63, 125) 68px)'
2123
},
2224
backgroundSize: {
2325
'50': '50%',

0 commit comments

Comments
 (0)