blumango

Preisgekrönte Agentur-Website erstellen

Klicke auf das Bild um zum Video zu gelangen

Auf dieser Seite findest du alle Bestandteile, die du benötigst, um die Website aus dem oben gezeigten Tutorial nachzubauen.

Du hast keine Lust die Website nachzubauen? Kauf einfach das fertige Template!

style.css

Kopiere einfach den kompletten CSS-Code und ersetzte den Code in deiner style.css damit. Diese findest du im Ordner deines Child-Themes. Denke auch daran, dass es nötig sein kann, die verwendeten Variablen anzupassen.

/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */

.hero-heading, .service-heading, .cta-heading{
    white-space: nowrap;
    max-width: fit-content !important;
}

.hero .e-con-inner, .service .e-con-inner, .cta .e-con-inner{
    align-items: center !important;
}

.hero, .service, .cta{
    overflow: hidden;
}

.hero-h1::before{
    content: '// ';
    line-height: 1;
}

.hero-h1{
    display: flex;
    align-items: flex-start;
    gap: 5px;
}


.projekt-image{
    display: none;
}

.projekt-titel:hover ~ .projekt-image{
    display: block;
    position: absolute;
    top: -50%;
    right: 0;
    z-index: -1;
}

.projekt-titel .elementor-heading-title:hover {
    color: var( --e-global-color-primary ) !important;
}


.bewertungen-heading{
    position: sticky;
    top: 100px;
}

/* Cursor */
.cursor {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    top: 0px;
    left: 0px;
    z-index: 999;
    transform: translate(-50% ,-50%);
    mix-blend-mode: difference;
    background-color: var(--e-global-color-accent);
}

.cursor-small {
    height: 20px;
    width: 20px;
    border-radius: 50%;
}

.cursor-big {
	height: 120px;
	width: 120px;
    border-radius: 50%;
}

.site-header{
    position: sticky;
    top: 10px;
    z-index: 999;
}
    

custom.js

Kopiere einfach den kompletten JavaScript-Code und füge ihn in deine custom.js ein. Diese Datei musst du im Ordner deines Child-Themes neu anlegen.

//Hero Animation
function runHero() {
    const elements = ['#hh1', '#hh2', '#hh3', '#hh4'];
    const xValues = ['-10vw', '20vw', '10vw', '-20vw'];
  
    elements.forEach((element, index) => {
      gsap.to(element, {
        x: xValues[index],
        scrollTrigger: {
          trigger: '.hero',
          start: index === 3 ? 'center center' : 'top top',
          end: 'bottom top',
          scrub: true,
        },
      });
    });
  }
  
  runHero();

//Service Animation
function runService() {
    const elements = ['#sh1', '#sh2'];
    const xValues = ['-30vw', '20vw'];
  
    elements.forEach((element, index) => {
      gsap.to(element, {
        x: xValues[index],
        scrollTrigger: {
          trigger: '.service',
          start: 'top bottom',
          end: 'bottom top',
          scrub: true,
        },
      });
    });
  }
  
  runService();


  function runCTA() {
    const elements = ['#ch1', '#ch2'];
    const initialXValues = ['30vw', '-20vw'];
  
    elements.forEach((element, index) => {
      gsap.set(element, { x: initialXValues[index] });
      gsap.to(element, {
        x: 0,
        scrollTrigger: {
          trigger: '.cta',
          start: 'top bottom',
          end: 'bottom bottom',
          scrub: true,
        },
      });
    });
  }
  
  runCTA();


//Cursor
const cursorSmall = document.querySelector(".cursor-small");
const cursorBig = document.querySelector(".cursor-big");

function mousemoveHandler(e) {
  const target = e.target;
  const tl = gsap.timeline({
    defaults: {
      x: e.clientX,
      y: e.clientY,
      ease: "power2.out"
    }
  });

  if (target.closest(".cta") || target.closest(".projekt")) {
    tl.to(".cursor-small", { opacity: 0 })
      .to(".cursor-big", { opacity: 1 }, "-=0.5");
  } else {
    let scale = target.classList.contains("cta") ? 4 : 1;

    tl.to(".cursor-small", { opacity: 1, scale: scale })
      .to(".cursor-big", { opacity: 0 }, "-=0.5");
  }
}

function mouseleaveHandler() {
  gsap.to(".cursor-small", { opacity: 0 });
}

document.addEventListener("mousemove", mousemoveHandler);
document.addEventListener("mouseleave", mouseleaveHandler);


//Lenis
document.addEventListener("DOMContentLoaded", function() {
  const lenis = new Lenis({
    duration: 1.2,
    easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
    direction: 'vertical',
    gestureDirection: 'vertical',
    smooth: true,
    mouseMultiplier: 1,
    smoothTouch: false,
    touchMultiplier: 2,
    infinite: false,
  });

  lenis.on('scroll', ({ scroll, limit, velocity, direction, progress }) => {
    console.log({ scroll, limit, velocity, direction, progress });
  });

  function raf(time) {
    lenis.raf(time);
    requestAnimationFrame(raf);
  }

  requestAnimationFrame(raf);
});
    

functions.php

Kopiere einfach den kompletten PHP-Code und füge ihn an der passenden Stelle in deine functions.php ein.

// GSAP
wp_enqueue_script('gsap', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.0/gsap.min.js', array(), '3.9.0', true);
		
// ScrollTrigger
wp_enqueue_script('scrolltrigger', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.0/ScrollTrigger.min.js', array('gsap'), '3.9.0', true);
	
//Lenis
wp_enqueue_script('lenis-script', 'https://cdn.jsdelivr.net/gh/studio-freight/lenis@0.2.28/bundled/lenis.js', array(), '0.2.28', true);
	
//Custom
wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/custom.js', array('jquery'), '1.0', true);
    

html

Kopiere den kompletten HTML-Markup und füge ihn in ein HTML-Modul innerhalb deiner Cursor-Section hinzu.

<div class="cursor cursor-small"></div>

<div class="cursor cursor-big"></div>