Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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 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.

HTML

              
                <div class="content">
    <div class="grid">
        <span class="intro">Get your new alarm clock</span>
        <div class="background-text-1">
            <p>Alarm</p>
        </div>       
        
        <div class="background-text-2">
            <p>Clock</p>
        </div>

        <div class="title">
            <span>
                <p>When</p>
                <p>do</p>
                <p>you</p>
                <p>want</p>
            </span>
            
            <span>
                <p>to</p>
                <p>wake</p>
                <p>up ?</p>
            </span>
        </div>      

        <div class="fill"></div>
        <p class="text">Waking up is one of the hardest things to do no matter what time of the year it is. However, in the longer, darker, winter months, waking up can literally seem like an impossible task.</p>
        
        <div class="img-bg">
           <img src="http://adriengervaix.com/projects/alarm/img/jocko.png">
        </div>
        
        <div class="slider">
            <div class="slider-content">
                <div class="dot" id="dotslider">
                    <div class="value-slider" id="range-data-slider">4:35</div>
                </div>
                <input type="range" min="270" max="630" step="1" value="270" class="range-style" id="slider-input">
            </div>
            
                <div class="count">
                    <div class="val" id="range-data">4:35</div>
                    
                    <span>AM</span>
                </div>
            
            <div class="back-slider">
                <svg width="82" height="291" xmlns="http://www.w3.org/2000/svg"><g fill="#4A4444" fill-rule="evenodd"><path d="M42 44h40v2H42zM42 178h40v2H42zM42 89h40v2H42zM42 222h40v2H42zM42 133h40v2H42zM42 267h40v2H42zM62 22h20v2H62zM0 156h82v2H0zM62 289h20v2H62zM62 0h20v2H62zM74 278h8v1h-8zM74 123h8v1h-8zM74 145h8v1h-8zM74 234h8v1h-8zM74 78h8v1h-8zM74 189h8v1h-8zM74 34h8v1h-8zM74 256h8v1h-8zM74 101h8v1h-8zM74 212h8v1h-8zM74 56h8v1h-8zM74 167h8v1h-8zM74 12h8v1h-8zM62 111h20v2H62zM62 245h20v2H62zM62 67h20v2H62zM62 200h20v2H62z"/></g></svg>
            </div>
        </div>  
        
    </div>
</div> 
              
            
!

CSS

              
                $primary: #0F0402;
$secondary: #DB442B;
$grey: #4A4444;
$white: #FFFFFF;

@font-face {
  font-family: 'Arges-BlackCondensed';
  src: url('https://adriengervaix.com/projects/alarm//font/Arges-BlackCondensed.eot');
  src: url('https://adriengervaix.com/projects/alarm//font/Arges-BlackCondensed.eot?#iefix') format('embedded-opentype'),
       url('https://adriengervaix.com/projects/alarm//font/Arges-BlackCondensed.woff2') format('woff2'),
       url('https://adriengervaix.com/projects/alarm//font/Arges-BlackCondensed.woff') format('woff'),
}

body{
    background-color: $primary;
}

.content{
    display: grid;
    justify-items: center;
    margin-bottom: 80px;
   
    .grid{
        width: 1280px;
        display: grid;
        grid-template-columns: repeat(12, [col] 87px);
        grid-auto-rows: 60px;
        grid-column-gap: 20px; 
        grid-row-gap: 12px;
        color: $white;
        
        .intro{
            grid-column: col / span 7;
            grid-row: row 2 / span 1;
            color: $secondary;
            font-size: 18px;
            font-family: 'Asap', sans-serif;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 2px;
            animation: intro-anim-opacity 1600ms;
        }
        
        .background-text-1{
            grid-column: col / span 6;
            grid-row: row 2 / span 6;
            overflow: hidden;
            
            p{
                font-size: 350px;
                font-family: 'Arges-BlackCondensed', sans-serif;
                line-height: 500px;
                text-transform: uppercase;
                -webkit-text-stroke: 1px $grey;
                color: rgba(0, 0, 0, 0); 
                animation: intro-anim-translate 800ms ease;    
            }    
        }        
        
        .background-text-2{
            grid-column: col / span 6;
            grid-row: row 9 / span 6;
            overflow: hidden;
            
            p{
                font-size: 350px;
                font-family: 'Arges-BlackCondensed', sans-serif;
                line-height: 500px;
                text-transform: uppercase;
                -webkit-text-stroke: 1px $grey;
                color: rgba(0, 0, 0, 0); 
                animation: intro-anim-translate 1000ms ease; 
            }    
        }
        
        .title{
            grid-column: col 3 / span 11; 
            grid-row: row 6 / span 6;
            z-index: 10;
            overflow: hidden;

            span{
                display: flex;
                overlfow: hidden;
                
                p{
                    font-family: 'Arges-BlackCondensed', sans-serif;
                    font-size: 210px;
                    line-height: 180px;
                    margin-right: 20px;
                    color: white;
                    overlfow: hidden;
                    
                    &:nth-child(1){animation: intro-anim-text 800ms}
                    &:nth-child(2){animation: intro-anim-text 1000ms}
                    &:nth-child(3){animation: intro-anim-text 1200ms}
                    &:nth-child(4){animation: intro-anim-text 1400ms}
                    &:nth-child(5){animation: intro-anim-text 1600ms}
                }
                               
                    
            }
        }
        
        .img-bg{
            grid-column: col 7 / span 6; 
            grid-row: row 2 / span 6;   
            z-index: -10;
            animation: anim-img 1000ms ease;
        }
        
        .fill{
            grid-column: col / span 2; 
            grid-row: row 8 / span 2;
            background-color: $secondary;
            animation: intro-anim-scale 800ms ease;
            transform-origin: 0% 50%;
        }
        
        .text{
            grid-column: col 5 / span 2;
            grid-row: row 12 / span 4;
            font-family: 'Asap', sans-serif;
            font-size: 14px;
            line-height: 22px;
            color: $secondary;
            animation: intro-anim-text 1400ms;
        }
        
        .slider{
            grid-column: col 8 / span 5;
            grid-row: row 9 / span 5;
            z-index: 80;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            border-bottom: 1px solid $grey;
            
            animation: intro-anim-text 1800ms;
            
            &:before{
                content:'';
                width: 320px;
                height: 1px;
                background-color: grey;
                position: absolute;
                align-self: flex-start;
            }

            .slider-content{
                transform: rotate(90deg);
                z-index: 120;
                width: 348px;
                height: 514px;
                
                &:hover {
                    .dot{
                        transform: scale(1.2);
                        background-color: darkred;
                        
                        .value-slider{
                            transform: rotate(-90deg) scale(1);
                            opacity: 1;
                        }
                        
                    }
                    
                     input[type="range"]::-webkit-slider-thumb{
                        background-color: darkred;
                    }
                    
                    
                }

                .dot{
                    width: 40px;
                    height: 40px;
                    background-color: $secondary;
                    border-radius: 30px;
                    position: absolute;
                    transform: translate(calc(-50% + 5px), -15px);
                    transform-origin: 90px 150px;
                    transition: transform 200ms;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    
                    .value-slider{
                        transform: rotate(-90deg)  scale(0);
                        font-size: 22px;
                        opacity: 0;
                        transition: transform 200ms, opacity 200ms;
                        text-align: center;
                        font-family: 'Arges-BlackCondensed', sans-serif;
                        align-self: center;
                    }
                    
                }

                input[type="range"]{
                    width: 100%;
                    height: 100%;
                    -webkit-appearance: none;
                    outline: none;
                    margin-left: 0;
                    cursor: pointer;
                }

                input[type="range"]::-webkit-slider-thumb{
                    -webkit-appearance: none; 
                    width: 10px;
                    height: 520px;
                    background-color: $secondary; 
                    border-radius: 10px;
                }
                
                .range-style{
                    background: none;
                }

                input[type="range"]::-webkit-slider-thumb:hover{
                    background-color: darkred;
                }
            }
            
            .count{
                position: absolute;
                z-index: 80;
                display: flex;
                font-family: 'Arges-BlackCondensed', sans-serif;
                font-size: 48px;
                margin-left: -80px;
            
                .val {
                    font-size: 180px;
                    transform: rotate(0deg);
                }
            
                span{
                    transform: translate(5px, 30px);
                }
            }
        }
    }
}

            
@keyframes intro-anim-scale{
    0%{transform: scaleX(0);}
    100%{transform: scaleX(1);}
}

@keyframes intro-anim-translate{
    0%{transform: translateY(600px);}
    100%{transform: translateY(0px);}
}

@keyframes intro-anim-text{
    0%{transform: translateY(200px); opacity: 0;}
    100%{transform: translateY(0px); opacity: 1;}
}

@keyframes intro-anim-opacity{
    0%{opacity: 0;}
    100%{opacity: 1;}
}

            
@keyframes anim-img{
    0%{transform: scale(1.2); opacity: 0}
    100%{transform: scale(1); opacity: 1}
}

h1, h2, p {
  margin: 0;
}
              
            
!

JS

              
                    function time_convert(num){ 
        var hours = Math.floor(num / 60);  
        var minutes = num % 60;
        return hours + ":" + (minutes > 9 ? minutes : "0" + minutes) ; 
    }

    window.onload = function(){
        var slider = document.getElementById("slider-input"); 
        var result = document.getElementById("range-data");
        var resultSlider = document.getElementById("range-data-slider");
        
        var d = document.getElementById("dotslider").style;
            slider.oninput = function(){            
                resultSlider.innerHTML = time_convert(slider.value);
                result.innerHTML = time_convert(slider.value);
                const ratio = (100 / (630-270)) * (slider.value - 270);
                d.left = `calc(${ratio}% - ${(ratio / 100) * 10}px)`;
            } 
    }
              
            
!
999px

Console