cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              .wind
  .wind-head
    .wind--title WIND APP
    .wind-head--components.flex
      .wind--number 
        %span#wind--number__value 10
        %span km/h
      .wind--direction East
  .wind-body.center
    %ul.wind--meter.reset.flex
      %li 30
      %li 20
      %li 10
      %li 00
      %li 10
      %li 20
      %li 30
    .wind-paper
      %div
        %div
          %div
            %div
              %div
                %div
                  %div
                    %div
                      %div
                        %div
  .wind-bottom.center
    %ul.wind--time.reset.flex
      %li 10AM
      %li 12AM
      %li 2PM
      %li.is-active 4PM
      %li 6PM
      %li 8PM
  .wind-footer
    %ul.wind--date.reset.flex.center
      %li.date Saturday, Sep 19
      %li.date Sunday, Sep 20
      %li.date Monday, Sep 21
    %ul.wind-nav.reset.flex
      %li 
        %a{title: "previous day", href: "#", id:"previous", class: "date-nav is-disabled"} previous
      %li 
        %a{title: "next day", href: "#", id:"next", class: "date-nav"} next

            
          
!
            
              //font
@import url(https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700);
//colors
$bg: #CFE2F0;
$acqua: #8DE9C8;
$egg: #EBF9AA;
$blue: #48809E;
$green: #7AD5CB;
$grey: #72BDBC;
$shadow-color: rgba($blue, 0.8);

$width: 300px;
$height: 430px;
$padding: 15px;
$radius: 5px;

@mixin animation( $flip-left, $opacity, $bottom: 4.2*$padding ){
    $flip-width: $width/8 - $flip-left*2;
    width: $flip-width;
    left: $flip-left;
    box-shadow: 0px 0px 10px $flip-left $shadow-color;
    opacity: $opacity;
    height: $height/2 - $bottom;
}

body{
  background: $bg;
  color: $blue;
  font-family: 'Open Sans Condensed', sans-serif;
}

.reset{
  display: block;
  margin: 0;
  padding: 0;
  li{
    display: block;
    margin: 0;
    padding: 0;
  }
}

.flex{
  display: flex;
}

.center{
  text-align: center;
}

.wind{
  width: $width;
  height: $height;
  box-shadow: 0px 0px 10px 4px rgba(darken($bg, 20%), 0.3);
  margin: 2em auto;
  border-radius: $radius;
}

.wind-head{
  background: $egg;
  padding: $padding*2 $padding;
  box-shadow: 0px 0px 3px 0px rgba(darken($acqua, 50%), 0.3);
  position: relative;
  z-index: 10;
  border-radius: $radius $radius 0 0;
}

.wind--title{
  font-weight: 700;
  position: relative;
  /*&:before{
    content: "";
    width: 20px;
    height: 11px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    display: inline-block;
    margin-right: 5px;    
  }
  
  &:after{
    content: "";
    width: 20px;
    height: 5px;
    border-bottom: 1px solid;
    display: inline-block;
    margin-right: 5px; 
    position: absolute;
    left: 0;
    top: 5px;
  }*/
}

.wind-head--components{
  align-items: flex-end;
  padding-top: $padding*1.2;
  div{
    flex: 1;
  }
}

.wind--number{
  font-size: 2.1em;
  line-height: 1;
}
.wind--direction{
  line-height: 1.1;
  font-size: 1.4em;
  text-align: right;
  position: relative;
  &:before{
    content: "";
    width: 0.8em;
    height: 0.8em;
    display: inline-block;
    margin-right: 5px;
    border: 1px solid;
    border-radius: 50%;
  }
  
  &:after{
    content: "";
    width: 0.3em;
    height: 0.3em;
    display: inline-block;
    margin-right: 5px;
    background: $blue;
    border-radius: 50%;
    position: absolute;
    right: 1.2em;
    top: 0.3em;
  }
}

.wind-body{
  background: $acqua;
  position: relative;
  z-index: 9;
  box-shadow: 0px 4px 3px 0px rgba(darken($green, 50%), 0.3);
}
.wind--meter{
  li{
    flex:1;
    height: $height/2;
    &:before{
      content: '';
      display: block;
      border-right: 1px solid $grey;
      margin-bottom: 1em;
      height: calc(100% - 3em);
      width: 50%;
    }
  }
}

.wind-bottom{
  background: $green;
  position: relative;
  z-index: 8;
  box-shadow: 0px 4px 3px 0px rgba(darken($blue, 50%), 0.3);
}

.wind--time{
  li{
    flex: 1;
    padding: $padding*2 0;
    color: #fff;
  }
}

.wind-footer{
  background: $blue;
  color: $green;
  position: relative;
  overflow: hidden;
  border-radius: 0px 0px $radius $radius;
}

 ul.wind--date{
   width: $width*3;
   transition: all 1s ease-in-out;
   li{
     flex: 100%;
     padding: $padding*1.4 0;
    }
 }

.wind-nav{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  li{
    flex: 1;
  }
}

a.date-nav{
  color: $green;
  text-decoration: none;
  font-size: 0;
  &:hover{
    color: #fff;
  }
  &.is-disabled{
    color: #999;
    cursor: default;
  } 
}

%icon{
  content: "";
  height: $padding;
  width: $padding;
  border-top: 2px solid;
  border-right: 2px solid;
  display: block;
  position: absolute;
  top: $padding*1.5;
}
#previous{
  &:before{
   @extend %icon; 
   transform: rotate(-135deg);
    left: $padding;
  }
}

#next{
  &:after{
    @extend %icon;
    transform: rotate(45deg);
    right: $padding;
  }
}

//single div length 
$length : ($height/2 - 1.5*$padding)/10;
//flipping page clip
.wind-paper{
  position: absolute;
  top: 0;
  left:($width/2 - $width/16);
  z-index: 2;
  div{
    height: $length;
    width: $width/8;
    transform-origin: 100% 0;
    transform-style: preserve-3d;
    position: absolute;
    top: calc(100% - 1px);
    background: #fff;
    transform: rotateX(-5deg);
    animation: flip 3s ease-in-out infinite;
  }
  &:after{
    content: "";
    transform: translateZ(-1000px);
    display: block;
    background: rgba($blue, 0.8);
    position: absolute;
    top: 0;
    z-index: -1;
    animation: flip-shadow 3s ease-in-out infinite;
  }
}

@keyframes flip {
  0% { transform: rotateX(-5deg)
                    }
  50% { transform: rotateX(-8deg)
                   rotateY(-2deg);}
  100% { transform: rotateX(-5deg)
                    }
}

@keyframes flip-shadow {
  $color: rgba($blue, 0.8);
  0% { 
    @include animation(5px, 1);
  }
  50% { 
    @include animation(15px, 0.3, 100px);
    }
  100% {
    @include animation(5px, 1);
  }
}


            
          
!
            
              (function(){
  'use strict';
var previous = document.getElementById('previous'),
    next = document.getElementById('next'),
    listElement = document.querySelector('.wind--date'),
    list = [].slice.call(document.querySelectorAll('.wind--date li')),
    current,
    currentIndex = 0,
    width = 300;
    
function activate (){  
    current = list[currentIndex];
    listElement.style.marginLeft = -(currentIndex * width ) + 'px';
}

var navigate = function(el){
    el.addEventListener("click" , eventHandler);
};

function eventHandler(e){
  e.preventDefault();
  var change;  
  if(e.target == next){
    if(currentIndex < list.length-1){
      currentIndex ++;
      updateNavState()
    }else{
      return false;
    }
  } else if(e.target == previous) {
     if(currentIndex > 0){
      currentIndex --;
      updateNavState()
    }else{
      return false;
    }
  }
  activate();
}

function updateNavState(){
  if(currentIndex !== 0){
    previous.classList.remove("is-disabled");
  } else{
    previous.classList.add("is-disabled");
  }
  if(currentIndex !== list.length-1){
    next.classList.remove("is-disabled");
  } else{
    next.classList.add("is-disabled");
  }
}
navigate(previous);
navigate(next);
})();

//randomly update value
(function(){
  var direction = document.getElementById('wind--number__value');
  function update(value){
    direction.textContent = value;
  }
  
  //update(Math.floor(Math.random()*10 + 3));
  setInterval(function handler (){
    update(Math.floor(Math.random()*10 + 3));
  }, 3000);
  
})();

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console