|
2 | 2 | import gsap from "gsap"; |
3 | 3 | import { useGSAP } from "@gsap/react"; |
4 | 4 | import { ScrollSmoother, ScrollTrigger, SplitText } from "gsap/all"; |
5 | | - |
6 | | -import SimpleBtn from "../Button/SimpleBtn"; |
7 | 5 | import Image from "next/image"; |
| 6 | +import { Inter } from "next/font/google"; |
| 7 | + |
| 8 | +const InterFont = Inter({ |
| 9 | + weight: "600", |
| 10 | +}); |
8 | 11 |
|
9 | 12 | gsap.registerPlugin(ScrollTrigger, SplitText, ScrollSmoother); |
10 | 13 |
|
11 | 14 | export default function Production() { |
12 | 15 | // const container = useRef(null); |
13 | 16 |
|
14 | 17 | useGSAP(() => { |
15 | | - const SplitedText = new SplitText(".textTarget", { |
16 | | - type: "chars, words", |
| 18 | + const SplitedText = new SplitText(".prodText", { |
| 19 | + type: "lines", |
| 20 | + mask:"lines", |
17 | 21 | }); |
18 | 22 |
|
19 | 23 | const productionTl = gsap.timeline({ |
20 | 24 | scrollTrigger: { |
21 | 25 | trigger: ".prod-container", |
22 | | - start: "top 70%", |
23 | | - end: "+=2000", |
24 | | - scrub: 5, |
25 | | - // markers: true, |
26 | | - }, |
27 | | - }); |
28 | | - productionTl.from(".prod-img", { |
29 | | - yPercent: 500, |
30 | | - stagger: { |
31 | | - each: 1, |
32 | | - from: "random", |
| 26 | + start: "top 80%", |
| 27 | + end: "bottom bottom", |
| 28 | + scrub : 3, |
| 29 | + markers: true, |
33 | 30 | }, |
34 | 31 | }); |
35 | | - productionTl.from(SplitedText.chars, { |
36 | | - duration: 3, |
| 32 | + |
| 33 | + productionTl.from(SplitedText.lines, { |
| 34 | + duration:5, |
| 35 | + yPercent: 100, |
37 | 36 | opacity: 0, |
38 | | - scale: 0, |
39 | | - y: 80, |
40 | | - rotationX: 180, |
41 | | - transformOrigin: "0% 50% -50", |
42 | | - ease: "back", |
43 | | - stagger: 0.05, |
| 37 | + stagger: 2, |
| 38 | + ease: "expo.inOut", |
44 | 39 | }); |
45 | 40 | }); |
46 | 41 | return ( |
47 | | - <section className="prod-container relative w-full h-screen flex flex-col justify-around items-center overflow-hidden"> |
48 | | - <h2>How Bakery Should be Today</h2> |
49 | | - <SimpleBtn title="About" /> |
50 | | - |
51 | | - {/* <div |
52 | | - id="img-content" |
53 | | - className="w-full flex flex-row justify-around items-center" |
54 | | - > */} |
55 | | - <Image |
56 | | - className="prod-img absolute top-[10%] left-[10%]" |
| 42 | + <section className="prod-container relative w-full justify-around items-center overflow-hidden"> |
| 43 | + <article className="pt-24 px-5 bg-pinky "> |
| 44 | + {/* <Image |
| 45 | + className="prod-img md:float-left rounded-2xl w-full" |
57 | 46 | id="prod-img" |
58 | 47 | src={"/img/mae-mu.jpg"} |
59 | 48 | width={200} |
60 | 49 | height={200} |
61 | 50 | alt="bakery image" |
62 | | - /> |
63 | | - <Image |
64 | | - className="prod-img absolute top-[-20%] left-[40%]" |
65 | | - id="prod-img" |
66 | | - src={"/img/DecorativeArtisanBreads.jpeg"} |
67 | | - width={200} |
68 | | - height={200} |
69 | | - alt="bakery image" |
70 | | - /> |
71 | | - <Image |
72 | | - className="prod-img absolute top-[-30%] left-[70%]" |
73 | | - id="prod-img" |
74 | | - src={"/img/heather-barnes.jpg"} |
75 | | - width={200} |
76 | | - height={200} |
77 | | - alt="bakery image" |
78 | | - /> |
79 | | - {/* </div> */} |
80 | | - </section> |
| 51 | + /> */} |
| 52 | + <p className={`${InterFont.className} text-cake prodText text-4xl/tight lg:text-9xl/tight pt-5 text-center`}>Pure Crust is a charming bakery shop that delights customers with its artisanal approach to baking. Nestled in a cozy corner of the neighborhood, it offers a wide array of freshly baked goods, from crusty sourdough loaves to delicate pastries and mouthwatering cakes. </p> |
| 53 | + </article> |
| 54 | + </section> |
81 | 55 | ); |
82 | 56 | } |
83 | | - |
84 | | -{ |
85 | | - /* <div> |
86 | | - <h2 className="textTarget text-3xl text-cake"> |
87 | | - We believe good food brings people together. |
88 | | - </h2> |
89 | | - <h2> |
90 | | - We use organic flour, local honey, and other natural ingredients |
91 | | - </h2> |
92 | | - <h2>That’s why we bake with heart and keep things eco-friendly</h2> |
93 | | - </div> */ |
94 | | -} |
0 commit comments