Skip to content

Commit 1bac84a

Browse files
committed
Add about section
1 parent ba6e8f1 commit 1bac84a

File tree

5 files changed

+105
-1
lines changed

5 files changed

+105
-1
lines changed

public/images/tea.webp

66.1 KB
Binary file not shown.

src/app.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ScrollTrigger, SplitText } from "gsap/all"
33
import Navbar from "./components/Navbar";
44
import Hero from "./components/Hero";
55
import Teas from "./components/Teas";
6+
import About from "./components/About";
67

78
gsap.registerPlugin(ScrollTrigger, SplitText);
89
const App = () => {
@@ -11,6 +12,7 @@ const App = () => {
1112
<Navbar />
1213
<Hero />
1314
<Teas />
15+
<About />
1416
</main>
1517
)
1618
}

src/components/About.jsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React from "react";
2+
3+
const About = () => {
4+
return (
5+
<>
6+
<div id="about">
7+
<div className="mb-16 md:px-0 px-5">
8+
<div className="content">
9+
<div className="md:col-span-8">
10+
<p className="badge">Best Teas</p>
11+
<h2>
12+
Where every leaf tells a story{" "}
13+
<span className="text-white">-</span> from steep to sip
14+
</h2>
15+
</div>
16+
17+
<div className="sub-content">
18+
<p>
19+
Every infusion we craft carries the weight of our passion — from
20+
the whisper of steam to the dance of leaves. It’s this care that
21+
turns warmth into wonder, and sips into stories.
22+
</p>
23+
24+
<div>
25+
<p className="md:text-3xl text-xl font-bold">
26+
<span>4.5</span>/5
27+
</p>
28+
<p className="text-sm text-white-100">
29+
More than 20000+ customers
30+
</p>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</div>
36+
37+
<div className="banner">
38+
<div className="slider" style={{ "--quantity": 10 }}>
39+
<div className="item" style={{"--position": 1}}> <img src="/images/tea.webp" alt="image 1" /> </div>
40+
<div className="item" style={{"--position": 2}}> <img src="/images/tea.webp" alt="image 1" /> </div>
41+
<div className="item" style={{"--position": 3}}> <img src="/images/tea.webp" alt="image 1" /> </div>
42+
<div className="item" style={{"--position": 4}}> <img src="/images/tea.webp" alt="image 1" /> </div>
43+
<div className="item" style={{"--position": 5}}> <img src="/images/tea.webp" alt="image 1" /> </div>
44+
<div className="item" style={{"--position": 6}}> <img src="/images/tea.webp" alt="image 1" /> </div>
45+
<div className="item" style={{"--position": 7}}> <img src="/images/tea.webp" alt="image 1" /> </div>
46+
<div className="item" style={{"--position": 8}}> <img src="/images/tea.webp" alt="image 1" /> </div>
47+
<div className="item" style={{"--position": 9}}> <img src="/images/tea.webp" alt="image 1" /> </div>
48+
<div className="item" style={{"--position": 10}}> <img src="/images/tea.webp" alt="image 1" /> </div>
49+
</div>
50+
</div>
51+
</>
52+
);
53+
};
54+
55+
export default About;

src/index.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,51 @@ body {
373373
@apply absolute bottom-0 right-0 lg:w-96 w-1/3 pointer-events-none;
374374
}
375375
}
376+
}
377+
378+
379+
.banner{
380+
/* @apply w-full h-screen text-center overflow-hidden relative; */
381+
width: 100%;
382+
height: 100vh;
383+
text-align: center;
384+
overflow: hidden;
385+
position: relative;
386+
}
387+
388+
.banner .slider{
389+
/* @apply absolute top-0 left-0 w-full h-full; */
390+
position: absolute;
391+
top: 10%;
392+
left: calc(50% - 100px);
393+
width: 200px;
394+
height: 250px;
395+
transform-style: preserve-3d;
396+
transform: perspective(1000px);
397+
animation: autoRun 20s linear infinite;
398+
}
399+
400+
@keyframes autoRun{
401+
0%{
402+
transform: perspective(1000px) rotateX(-10deg) rotateY(0deg);
403+
}
404+
100%{
405+
transform: perspective(1000px) rotateX(-10deg) rotateY(360deg);
406+
}
407+
}
408+
409+
.banner .slider .item{
410+
/* @apply absolute top-0 left-0 w-full h-full; */
411+
position: absolute;
412+
inset: 0 0 0 0;
413+
transform:
414+
rotateY(calc( (var(--position) - 1) * (360 / var(--quantity)) * 1deg))
415+
translateZ(550px);
416+
}
417+
418+
.banner .slider .item img{
419+
/* @apply w-full h-full object-cover; */
420+
width: 100%;
421+
height: 100%;
422+
object-fit: cover;
376423
}

src/main.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33
import './index.css'
4-
import App from './App.jsx'
4+
import App from './app.jsx'
55

66
createRoot(document.getElementById('root')).render(
77
<StrictMode>

0 commit comments

Comments
 (0)