Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                    <style>
        body,
        div,
        p {
            margin: 0;
            padding: 0;
            font-family: 'Montserrat', sans-serif;
        }

        .go {
            width: 25px;
            stroke: #FFF;
            stroke-width: 6;
            stroke-linecap: round;
            stroke-linejoin: round;
            fill: none;
            z-index: 12;
        }

        .go-prev,
        .go-next {
            position: absolute;
            cursor: pointer;
            top: 50%;
            left: 5px;
        }

        .go-next {
            left: calc(100% - 32px)
        }

        h1 {
            position: absolute;
            top: 50%;
            width: 100%;
            font-weight: 800;
            font-size: 36px;
            margin: 0;
        }

        nav {
            position: absolute;
            bottom: 10px;
            left: 50%;
            width: inherit;
            z-index: 100;
            visibility: hidden;
        }

        .navDot {
            position: relative;
            width: 15px;
            height: 15px;
            background-color: rgba(255, 255, 255, 0.5);
            opacity: 0.5;
            border-radius: 50%;
            border: 1px solid transparent;
            margin-right: 20px;
            float: left;
            cursor: pointer;
        }

        .navDot:last-of-type {
            margin-right: 0px;
        }

        .navDot:hover {
            background-color: rgba(255, 255, 255, 0.65);
            box-shadow: inset 0 0 0 3px #fff;
        }

        .slides-container {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100vh;
            overflow: hidden;
            z-index: 10;
        }

        .slide {
            position: absolute;
            top: 0;
            left: 100%;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.35);
            /* Este fondo se puede sustituir por cualquier color según cada slider */
            overflow: hidden;
        }

        #slide02 .wrap {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 100%;
            text-align: center;
            height: 100px;
            overflow: hidden;
        }

    </style>
    <title>Document</title>
</head>

<body>
    <nav class="centered"></nav>
    <svg class="go go-next" width="32" height="55" viewBox="0 0 40 55">
        <polyline points="3 3 30 28 3 53"></polyline>
    </svg>
    <svg class="go go-prev" viewBox="0 0 40 55">
        <polyline points="28 3 3 28 28 53"></polyline>
    </svg>
    <div class="slides-container">
        <div class="slide active" id="slide01"><!-- Smart Training -->
            <div class="degradest">
                <div class="textContenedorst">
                    <p class="anima1">Master clases y talleres virtuales, comunicacion efectiva, vocería, redes
                        sociales, liderazgo y experiencia del cliente.</p>
                    <a class="anima1" href="#">Cotiza aquí</a>
                </div>
            </div>
            <div class="contenedorSt">
                <div class="columnast">
                    <div class="estrellasSt">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-estrellas-st.png"
                            alt="">
                    </div>
                    <div class="olivoSt">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-olivo-st.png" alt="">
                    </div>
                    <div class="selloSt">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-sello-st.png" alt="">
                    </div>
                    <div class="jumping">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-jumping.png" alt="">
                    </div>
                    <div class="tituloSt">
                        <h2>smart training</h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="slide" id="slide02"><!-- Smart App -->
            <div class="degradeSa">
                <div class="textContenedorsa">
                    <p class="anima2">Aumenta Tus Ventas Y Fideliza Clientes Con Tu Propia App Móvil.</p>
                    <p class="anima2">¡En Tiempo Récord Y Un Costo Increíble!</p>
                    <a class="anima2" href="#">Cotiza aquí</a>
                </div>
            </div>
            <div class="contenedorSa">
                <div class="columnaSa">
                    <div class="pantallasSa">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-pantallas-smartapp.png"
                            alt="">
                    </div>
                    <div class="checkSa">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-check-smartapp.png"
                            alt="">
                    </div>
                    <div class="engranajesSa">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-engranajes-smartapp.png"
                            alt="">
                    </div>
                    <div class="chicaSa">
                        <img src="https://malpicaquintero.com/ref-smartcom/smartcomcorp-chica-smartapp.png"
                            alt="">
                    </div>
                    <div class="tituloSa">
                        <h2>fábrica de smart app</h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="slide" id="slide03">
            <h1 class="lines">And you'll get <span>GREEN</span> socks</br>
                for faster CODING!</h1>
        </div>
        <div class="slide" id="slide04">
            <h1 class="lines">Join the GREENSOCK Club.</h1>
        </div>
        <div class="slide" id="slide05">
            <h1 class="lines">Join the GREENSOCK Club 2.</h1>
        </div>
        <div class="slide" id="slide06">
            <h1 class="lines">Join the GREENSOCK Club 3.</h1>
        </div>
    </div>
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                        console.clear();

        //  =========================  xxxxx  ==========================

        gsap.set(".centered", { autoAlpha: 1, xPercent: -50, yPercent: -50 });
        gsap.set("h1", { autoAlpha: 1, yPercent: -50 });
        gsap.set(" .slide", { autoAlpha: 1, xPercent: 0 });
        gsap.set(".go", { autoAlpha: 1, yPercent: -50 });

        var slides = $(".slide"),
            activeSlide = $(".slide.active"),
            next = $(".go-next"),
            prev = $(".go-prev"),
            moveSlideTL = gsap.timeline(),
            lines = $('h1');

        // Animaciones individuales para cada slider ======

        const allSlides = [].slice.call(slides);
        let animations = [];

        for (let [i] of allSlides.entries()) {
            animations[i] = gsap.timeline({});
        }

        animations[0] // Smart Training ======
            gsap.from('#slide01 .olivoSt',{autoAlpha: 0, duration: 3, y: -200, ease: 'expo.inOut'})
            gsap.from('#slide01 .selloSt',{autoAlpha: 0, duration: 5, y: 200, ease: 'expo.inOut'})
            gsap.from('#slide01 .jumping',{autoAlpha: 0, delay: 1.2, duration: 4, y: 300, ease: 'elastic.out(1, 0.3)'})
            gsap.from('#slide01 .anima1',{autoAlpha: 0, delay: 2, duration: 2, y: -30, stagger: 0.7})
            gsap.from('#slide01 .tituloSt',{autoAlpha: 0, delay: 2, duration: 3, x: 100, ease: 'expo.inOut'})

        animations[1] // Smart App ======
            gsap.from('#slide02 .checkSa',{autoAlpha: 0, delay: 3, duration: 4, y: 300, ease: 'elastic.out(1, 0.3)'})
            gsap.from('#slide02 .pantallasSa',{autoAlpha: 0, duration: 4, x: -100, ease: 'expo.inOut'})
            gsap.from('#slide02 .engranajesSa',{autoAlpha: 0, duration: 3, y: -200, ease: 'back.inOut(1.7)'})
            gsap.from('#slide02 .anima2',{autoAlpha: 0, delay: 2, duration: 2, y: -30, stagger: 0.7})
            gsap.from('#slide02 .tituloSa',{autoAlpha: 0, delay: 2, duration: 3, x: 100, ease: 'expo.inOut'})
            gsap.from('#slide02 .chicaSa',{autoAlpha: 0, duration: 1, x: 100, ease: 'slow(0.7, 0.7, false)'})

        animations[2]
            .from('#slide03 .lines', { y: 30, autoAlpha: 0, duration: 1 })
            .set('#slide03 span', { color: 'green' })
            .reverse();

        animations[3]
            .from('#slide04 .lines', { scale: 0.2, transformOrigin: 'center', duration: 2 })
            .reverse();

        animations[4]
            .from('#slide05 .lines', { scale: 0.2, transformOrigin: 'center', duration: 2 })
            .reverse();

        animations[5]
            .from('#slide06 .lines', { scale: 0.2, transformOrigin: 'center', duration: 2 })
            .reverse();

        // Fin animaciones ===========================

        // Rueda del ratón ==========================

        function onMouseWheel(event) {
            //Normalize event wheel delta
            var delta = event.originalEvent.wheelDelta / 30 || -event.originalEvent.detail;

            if (delta < -1) {  //scrolling down -> next slide
                if (!moveSlideTL.isActive()) {
                    var slideFrom = $(".slide.active"),
                        sectionToIndex = slides.index(slideFrom);

                    if (sectionToIndex !== slides.length - 1) {
                        slideTo = slides.eq(sectionToIndex + 1);
                        moveToSlide(slideFrom, slideTo);
                    }
                }

            } else if (delta > 1) {  // -> prev
                if (!moveSlideTL.isActive()) {
                    if (!moveSlideTL.isActive()) {
                        var slideFrom = $(".slide.active"),
                            sectionToIndex = slides.index(slideFrom);

                        if (sectionToIndex != 0) {
                            slideTo = slides.eq(sectionToIndex - 1);
                            moveToSlide(slideFrom, slideTo);
                        }
                    }
                }
            }
            //event.preventDefault();
        }

        // ============================
        function dotClick() {

            var slideFrom = $(".slide.active"),
                sectionToIndex = $(this).index(),
                sectionToIndex = $(this).index(),
                slideTo = slides.eq(sectionToIndex);

            var indexFrom = slideFrom.index();

            console.log(slideFrom, 'from: ' + indexFrom, 'to: ' + sectionToIndex, 'slideTo: ' + slideTo);

            //if(slideFrom !== slideTo && !moveSlideTL.isActive()) {  // not working

            if (indexFrom !== sectionToIndex && !moveSlideTL.isActive()) {
                moveToSlide(slideFrom, slideTo);
            }

        }

        // =============================
        function nextClick() {
            if (!moveSlideTL.isActive()) {
                var slideFrom = $(".slide.active"),
                    sectionToIndex = slides.index(slideFrom);

                if (sectionToIndex !== slides.length - 1) {
                    slideTo = slides.eq(sectionToIndex + 1);
                    moveToSlide(slideFrom, slideTo);
                }
            }
        }

        function prevClick() {
            if (!moveSlideTL.isActive()) {
                var slideFrom = $(".slide.active"),
                    sectionToIndex = slides.index(slideFrom);

                if (sectionToIndex != 0) {
                    slideTo = slides.eq(sectionToIndex - 1);
                    moveToSlide(slideFrom, slideTo);
                }
            }
        }

        // ==============================
        function moveToSlide(slideFrom, slideTo) {

            gsap.set('.go', { autoAlpha: 0 }) // ????

            if (slides.index(slideFrom) < slides.index(slideTo)) { // vorwärts

                moveSlideTL = gsap.timeline({ onComplete: setActiveSlide, onCompleteParams: [slideTo, slideFrom] })
                    .to(slideTo, { xPercent: -100, duration: 0.5, className: "slide active" })
                    .to(slideFrom, { xPercent: -200, duration: 0.5, className: "slide" }, 0)
                    .set(slideFrom, { xPercent: 0 })

            } else {

                moveSlideTL = gsap.timeline({ onComplete: setActiveSlide, onCompleteParams: [slideTo, slideFrom] })
                    .set(slideTo, { xPercent: -200, className: "slide active" })
                    .to(slideTo, { xPercent: -100, duration: 0.5 })
                    .to(slideFrom, { xPercent: 0, duration: 0.5, className: "slide" }, 0)
            }

        }

        function setActiveSlide(active, last) {

            var currentSlideIndex = slides.index(active);
            var lastSlideIndex = slides.index(last);

            animations[currentSlideIndex].reversed(false);
            animations[lastSlideIndex].progress(0).reversed(true);

            gsap.to(".navDot.active", { opacity: 0.5, scale: 1 });
            $(".navDot.active").removeClass("active");
            $(".navDot").eq(currentSlideIndex).addClass("active");
            gsap.to(".navDot.active", { opacity: 1, scale: 1.3 });

            if (currentSlideIndex == 0) {
                gsap.set('.go-prev', { autoAlpha: 0 })
            } else {
                gsap.set('.go-prev', { autoAlpha: 1 })
            }
            if (currentSlideIndex == slides.length - 1) {
                gsap.set('.go-next', { autoAlpha: 0 })
            } else {
                gsap.set('.go-next', { autoAlpha: 1 })
            }

        }

        // ================================
        function init() {

            for (var i = 0; i < slides.length; i++) {
                var navDots = $('<div></div>').addClass("navDot").appendTo('nav');
                gsap.set(".navDot:first-child", { className: "navDot active", opacity: 1, scale: 1.3, transformOrigin: 'center' });
                navDots.on('click', dotClick);
            };

            if (slides[0]) {
                gsap.set('.go-prev', { autoAlpha: 0 })
            }

            next.on('click', nextClick);
            prev.on('click', prevClick);

            $(window).on("mousewheel DOMMouseScroll", onMouseWheel);
            //$(window).on("touchmove", onMouseWheel);

            gsap.set($(".slide:odd"), { backgroundColor: "#0f8c0d", color: "#333333" });
            gsap.set(".slide.active", { xPercent: -100 });
            animations[0].reversed(false);
        }

        init();
              
            
!
999px

Console