Horizontal Scrolling Website - UX Boost - Elementor

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 46

  • @phantomcraneflymusic
    @phantomcraneflymusic 7 днів тому +6

    Dude these last several weeks worth of videos have been some of your best ever.

  • @JustAnotherStan
    @JustAnotherStan 3 дні тому

    Wow. Another how-to video that makes something looking super complex really really easy. Next step: re-creating it on a playground site and then using it on a client site.

  • @AmitKeren-z2v
    @AmitKeren-z2v 6 днів тому +3

    Amazing! - thanks

  • @DavidBenamou
    @DavidBenamou 4 дні тому

    Very clever - thank you

  • @Karl-v6b
    @Karl-v6b 5 днів тому

    I love it too 😊

  • @rvdpk4361
    @rvdpk4361 5 днів тому

    And once again a great tutorial!!!! I made it quickly, but at the last slide I scroll down vertical and the caroussel scrolls back to the beginning.

    • @websquadron
      @websquadron  5 днів тому

      Double check as it shouldn't do that. test.websquadron.co.uk/beta

    • @rvdpk4361
      @rvdpk4361 4 дні тому

      @@websquadron is it my computer, because if I look at your test site, I have the same issue now, where it first wasn't

    • @websquadron
      @websquadron  4 дні тому

      @ Which browser are you using as I checked again and it's fine on Chrome and Edge and safari

    • @rvdpk4361
      @rvdpk4361 3 дні тому

      @@websquadron exactly all three... so strange... does is happen on my test for you as well? don't know if I can put a link here?

    • @rvdpk4361
      @rvdpk4361 3 дні тому

      and now --- today it doesn't glitch... so strange??

  • @hak618
    @hak618 7 днів тому +1

    The icon is a great touch, (click) 🙂

  • @AbdullahDeveloper-e7p
    @AbdullahDeveloper-e7p 7 днів тому +1

    thanks buddy ill try this in real project

  • @samturner-d9g
    @samturner-d9g 6 днів тому

    Another superb tip. Cheers

  • @arwbruijn6722
    @arwbruijn6722 6 днів тому

    Great scrolling example, I really like it 🤩.
    Started creating a page directly, but... maybe I'm doing something wrong:
    I have a heading with link and hover color on each slider, the link on the first slider works, the links on the other sliders don't work??

    • @websquadron
      @websquadron  6 днів тому

      Increase the Z-index on the other buttons and check with that.

    • @arwbruijn6722
      @arwbruijn6722 6 днів тому

      @@websquadron Wauw, you respond very quickly👍
      I tried 99, 999 and 1000 on the heading, on the slider and also on both (Slider 999 and heading 1000)
      This did not solve it

    • @websquadron
      @websquadron  6 днів тому +1

      @@arwbruijn6722 Dang. Yup that's a flaw caused by the GSAP scrolling and not initiating the interactive part later on. I'll dig deeper on that.

  • @GnuLegax
    @GnuLegax 7 днів тому

    👏 Great work! Can we see it live somewhere? Would be Nice! And thanks for the tuto!

    • @websquadron
      @websquadron  6 днів тому

      Sure for as long as I keep that page active as it's my test site :) test.websquadron.co.uk/beta/

  • @axiom7206
    @axiom7206 4 дні тому

    Very nice work.

    • @websquadron
      @websquadron  4 дні тому

      Make sure that you watch today's video on Loop Carousel Magic!

    • @axiom7206
      @axiom7206 4 дні тому

      @@websquadron Of course I'll check it out. 👍

  • @ICUAT
    @ICUAT 6 днів тому

    go on with this, great content

  •  2 дні тому

    I have discovered a problem. When we place buttons in the carousel slides, the button is only clickable when I swipe the slide but not when I scroll.

    • @websquadron
      @websquadron  2 дні тому +1

      Yup, I'm looking into that.
      It's fine on Slide 1, but not after that.

    •  2 дні тому

      @@websquadron Exactly. ChatGPT didn't have a quick solution either.

  • @Michael74-k6f
    @Michael74-k6f 5 днів тому

    Great Tutorial! However, I have 2 caveats:
    1. if you use e.g. a loop-carousel on the same page, keep in mind to add an additional css class or id before the slider class!
    2. does not work well with Safari :-)

    • @websquadron
      @websquadron  5 днів тому

      1. Very true.
      2. It works for me on Safari. I just checked. test.websquadron.co.uk/beta

    • @Michael74-k6f
      @Michael74-k6f 5 днів тому

      @@websquadron ok, it works in Safari but at least very choppy (M1 MacbookPro) ;-)

    • @Michael74-k6f
      @Michael74-k6f 5 днів тому

      In my case it works best (even in Safari) when deleting the css transform in the following class...
      .e-n-carousel .swiper-wrapper {
      display: flex;
      flex-direction: row;
      /*transition: transform 0.2s ease;*/
      }
      This seems to get in the way of GSAP's scrubbing somehow 🙂

  • @ashrafkhan7386
    @ashrafkhan7386 6 днів тому

    nice

  • @efinitmedia
    @efinitmedia 4 дні тому

    What if I want to disrespect mobile users and keep the horizontal scroll with the icon? What part of the code should I be paying attention to?

    • @websquadron
      @websquadron  4 дні тому +1

      Not at my machine but just stick into ChatGPT and ask it to remove parts that only let it work on screen sizes > 768

    • @efinitmedia
      @efinitmedia 4 дні тому

      @ sorry. I wasn’t at my machine either. I’ll run it through AI and let you know.

    • @efinitmedia
      @efinitmedia 4 дні тому

      @@websquadron btw, I got a "Access blocked: This app’s request is invalid" error when trying to sign up/in to the Code Snippets repo using the Google SSO option.

  • @jjes.studio
    @jjes.studio 6 днів тому

    Hi/ Hello. Registration is required via the link. Please post the code here in the comments or in any cloud. Thank you.

  • @SebastianPerezG
    @SebastianPerezG 6 днів тому

    Shame that you didnt share the javascript code in the video ...

    • @websquadron
      @websquadron  6 днів тому

      The link is there in the description. UA-cam doesn't allow syntax in video description.
      Also, if I share the code in the comments, and then I change the code, I'd have to revisit the comments again.
      But to keep all happy, I have pinned it.

  • @websquadron
    @websquadron  6 днів тому

    The Code: [Please improve it where you can and feedback to me].
    @media (min-width: 768px) {
    .e-n-carousel {
    overflow: hidden;
    height: 100vh;
    position: relative;
    }
    .elementor-swiper-button-next,
    .elementor-swiper-button-prev {
    display: none;
    }
    .e-n-carousel .swiper-wrapper {
    display: flex;
    flex-direction: row;
    transition: transform 0.2s ease;
    }
    .e-n-carousel .swiper-slide {
    flex: 0 0 100vw;
    height: 100vh;
    }
    .stickyicon {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    }
    }
    // Wrap all JavaScript functionality in a media query check
    function initCarousel() {
    if (window.matchMedia('(min-width: 768px)').matches) {
    gsap.registerPlugin(ScrollTrigger);
    const swiperWrapper = document.querySelector('.swiper-wrapper');
    const slides = document.querySelectorAll('.swiper-slide');
    const stickyIcon = document.querySelector('.stickyicon');
    const skipSection = document.getElementById('skip');
    const totalSlides = slides.length;
    // Ensure the first slide is visible
    gsap.set(swiperWrapper, { x: 0 });
    // Calculate total scrollable width
    const totalScrollWidth = (totalSlides - 1) * window.innerWidth;
    // Enable pinning only on larger screens (desktop/tablet)
    const enablePinning = true; // Always true since we're already in media query check
    // Scroll distance calculation
    const scrollEndValue = `+=${totalSlides * window.innerHeight}`;
    // Horizontal scroll animation triggered by vertical scroll
    const scrollAnimation = gsap.to(swiperWrapper, {
    x: () => -totalScrollWidth,
    ease: 'none',
    scrollTrigger: {
    trigger: '.e-n-carousel',
    pin: enablePinning,
    scrub: true,
    end: scrollEndValue,
    anticipatePin: 1,
    pinSpacing: true,
    },
    });
    // Show/hide sticky icon based on the carousel's visibility
    ScrollTrigger.create({
    trigger: '.e-n-carousel',
    start: 'top top',
    end: scrollEndValue,
    onEnter: () => {
    stickyIcon.style.opacity = '1';
    stickyIcon.style.pointerEvents = 'auto';
    },
    onLeave: () => {
    stickyIcon.style.opacity = '0';
    stickyIcon.style.pointerEvents = 'none';
    },
    onEnterBack: () => {
    stickyIcon.style.opacity = '1';
    stickyIcon.style.pointerEvents = 'auto';
    },
    onLeaveBack: () => {
    stickyIcon.style.opacity = '0';
    stickyIcon.style.pointerEvents = 'none';
    },
    });
    // Sticky icon click behavior
    stickyIcon.addEventListener('click', () => {
    if (skipSection) {
    gsap.to(window, {
    scrollTo: skipSection.offsetTop,
    duration: 0.1,
    ease: 'none',
    });
    }
    });
    }
    }
    // Initialize on load
    initCarousel();
    // Refresh on resize
    window.addEventListener('resize', () => {
    initCarousel();
    if (window.matchMedia('(min-width: 768px)').matches) {
    ScrollTrigger.refresh();
    }
    });

  • @mysheitzbrown
    @mysheitzbrown 7 днів тому +1

    noice