Cnippet

Davincho Hero-1

Heroes 681

About

Animated hero section with parallax background image.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Davincho Hero-1 to your project and fits it to your theme.

Code

How Davincho Hero-1 is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";
import { motion, useScroll, useTransform } from "motion/react";
import Image from "next/image";
import { useRef } from "react";

export default function Hero() {
  const container = useRef();
  const { scrollYProgress } = useScroll({
    offset: ["start end", "end start"],
    target: container,
  });
  const y = useTransform(scrollYProgress, [0, 1], ["0%", "10%"]);

  return (
    <div className="mx-2 mt-10 mb-160 overflow-hidden rounded-4xl bg-white">
      <div
        className="relative flex h-[80vh] items-center justify-center overflow-hidden bg-white"
        ref={container}
        style={{ clipPath: "polygon(0% 0, 100% 0%, 100% 100%, 0 100%)" }}
      >
        <div className="relative z-10 flex h-full w-full flex-col justify-between p-20 text-white mix-blend-difference">
          <p className="w-[50vw] self-end text-[2vw] uppercase mix-blend-difference">
            Beauty and quality need the right time to be conceived and realised
            even in a world that is in too much of a hurry.
          </p>
          <p className="text-[5vw] uppercase mix-blend-difference">
            Background Parallax
          </p>
        </div>
        <div className="fixed top-[-10vh] left-0 h-[120vh] w-full">
          <motion.div className="relative h-full w-full" style={{ y }}>
            <Image
              alt="image"
              className="grayscale-0"
              fill
              src={"https://cdn.21st.dev/assets/mirror/a4/a4ce96769140faffc0a169521ca02d18e0a87fc509c4a8cfd1838e8733830552.png"}
              style={{ objectFit: "cover" }}
            />
          </motion.div>
        </div>
      </div>
    </div>
  );
}

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Aero Hero-3

    Aero Hero-3

    554
  • Features

    Features

    506
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    480
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    463
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    354
  • Button

    Button

    321

More in Heroes

View all
  • SaaS Template

    SaaS Template

    2.4K
  • Responsive Hero Banner

    Responsive Hero Banner

    2K
  • Hero

    Hero

    1.2K
  • Centered Hero with Image Fan

    Centered Hero with Image Fan

    919
  • HeroSectionWithGradient

    HeroSectionWithGradient

    334
  • Editorial Collage Hero

    Editorial Collage Hero

    425
  • Hero 03

    Hero 03

    313
  • Glass Fold

    Glass Fold

    194