123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <link href="https://fonts.googleapis.com/css?family=Quicksand:300,400,500,700" rel="stylesheet">

<div id="dot2">
    <ul>
        <li class="on"><a href="#section1"><span>Intro</span></a></li>
        <li><a href="#section2"><span>Skill</span></a></li>
        <li><a href="#section3"><span>Website</span></a></li>
        <li><a href="#section4"><span>Work</span></a></li>
        <li><a href="#section5"><span>About</span></a></li>
        <li><a href="#section6"><span>Contact</span></a></li>
    </ul>
</div>

<div id="contents">
    <div id="section1">
        <div class="container">
            <div class="sec1">
                <h2>Think different</h2>
            </div>
        </div>
    </div>
    <div id="section2">
        <div class="container">
            <div class="sec2">
                <h2>Raise Your Head</h2>
            </div>
        </div>
    </div>
    <div id="section3">
        <div class="container">
            <div class="sec3">
                <h2>The Life is only once</h2>
            </div>
        </div>
    </div>
    <div id="section4">
        <div class="container">
            <div class="sec4">
                <h2>I must do what I want to do</h2>
            </div>
        </div>
    </div>
    <div id="section5">
        <div class="container">
            <div class="sec5">
                <h2>Time is Life itself</h2>
            </div>
        </div>
    </div>
    <div id="section6">
        <div class="container">
            <div class="sec6">
                <h2>There is no destiny</h2>
            </div>
        </div>
    </div>
</div>
            
          
!
            
              /* contents */
#contents {text-align: center; font-size: 80px; color: #fff; font-family: 'Quicksand', sans-serif; font-weight: 700; }
#contents > div {height: 100vh; line-height: 100vh;}

#section4 {background: linear-gradient(45deg, #B066FE 50%, #63E2FF 50%);}
#section2 {background: linear-gradient(25deg, #D4145A 50%, #FBB03B 50%);}
#section3 {background: linear-gradient(125deg, #F24645 50%, #EBC08D 50%);}
#section1 {background: linear-gradient(145deg, #662D8C 50%, #ED1E79 50%);}
#section5 {background: linear-gradient(90deg, #00537E 50%, #3AA17E 50%);}
#section6 {background: linear-gradient(180deg, #a18cd1 50%, #fbc2eb 50%);}


/* dot2 */
#dot2 {position: fixed; right: 40px; top: 50%; transform:translatey(-50%);}
#dot2 li {width:17px; height: 17px; background-color: rgba(0,0,0,0.51);; border-radius:50%; margin: 16px 7px;}
#dot2 li a {color: #fff; text-decoration: none; padding: 8px 15px 5px 15px; position:relative;  }
#dot2 li a span {opacity:0; position: absolute; right:35px; top:2px; background-color: rgba(0,0,0,0.51); padding: 9px 10px 8px 10px; transition: all 0.3s ease; border-radius:5px;}
#dot2 li a span:after {content:''; position:absolute; right:-7px; top:9px; 
    border-left: 7px solid rgba(0,0,0,0.51);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}
#dot2 li.on {background-color: rgba(0,0,0,0.71);}
#dot2 li.on a span {opacity: 1; right:25px; }

.sec1 h2 {opacity: 0;}
.sec1 h2.show {opacity: 1; animation:shake 1s ease-in-out;}
.sec2 h2 {opacity: 0;}
.sec2 h2.show {opacity: 1; animation:wobble 1s ease-in-out;}
.sec3 h2 {opacity: 0;}
.sec3 h2.show {opacity: 1; animation:zoomIn 1s ease-in-out;}
.sec4 h2 {opacity: 0;}
.sec4 h2.show {opacity: 1; animation:lightSpeedIn 1s ease-in-out;}
.sec5 h2 {opacity: 0;}
.sec5 h2.show {opacity: 1; animation:slideInLeft 1s ease-in-out;}
.sec6 h2 {opacity: 0;}
.sec6 h2.show {opacity: 1; animation:rollIn 1s ease-in-out;}
            
          
!
            
              var dot2 = $("#dot2 > ul > li");
var contents = $("#contents > div");

dot2.on("click",function(e){
    e.preventDefault();
    
    var target = $(this);
    var index = target.index();
    var section = contents.eq(index);
    var offset = section.offset().top;
    
    $("body, html").animate({scrollTop:offset},400);
});

$(window).on("scroll",function(){
    var wScroll = $(this).scrollTop();

    if(wScroll >= contents.eq(0).offset().top){
        dot2.removeClass("on");
        dot2.eq(0).addClass("on");
    }
    if(wScroll >= contents.eq(1).offset().top){
        dot2.removeClass("on");
        dot2.eq(1).addClass("on");
    }
    if(wScroll >= contents.eq(2).offset().top){
        dot2.removeClass("on");
        dot2.eq(2).addClass("on");
    }
    if(wScroll >= contents.eq(3).offset().top){
        dot2.removeClass("on");
        dot2.eq(3).addClass("on");
    }
    if(wScroll >= contents.eq(4).offset().top){
        dot2.removeClass("on");
        dot2.eq(4).addClass("on");
    }
    if(wScroll >= contents.eq(5).offset().top){
        dot2.removeClass("on");
        dot2.eq(5).addClass("on");
    }
    
        if(wScroll >= contents.eq(0).offset().top - $(window).height()/3){
            $(".sec1 h2").addClass("show");
        }
        if(wScroll >= contents.eq(1).offset().top - $(window).height()/3){
            $(".sec2 h2").addClass("show");
        }
        if(wScroll >= contents.eq(2).offset().top - $(window).height()/3){
            $(".sec3 h2").addClass("show");
        }
        if(wScroll >= contents.eq(3).offset().top - $(window).height()/3){
            $(".sec4 h2").addClass("show");
        }
        if(wScroll >= contents.eq(4).offset().top - $(window).height()/3){
            $(".sec5 h2").addClass("show");
        }
        if(wScroll >= contents.eq(5).offset().top - $(window).height()/3){
            $(".sec6 h2").addClass("show");
        }
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console