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

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.

            
              <section class="forecast-board">
  <h1 class="title">
  CSS-only squarish weather icon set
  </h1>
  
  <ul class="list">
    <li class="weather">
      <p class="weather__icon weather__icon-sun"></p>
    </li>
    <li class="weather">
      <p class="weather__icon weather__icon-cloud"></p>
    </li>
    <li class="weather mix">
      <p class="weather__icon weather__icon-sun"></p>
      <p class="weather__icon weather__icon-cloud"></p>
    </li>
    <li class="weather">
      <p class="weather__icon weather__icon-cloud"></p>
      <p class="weather__icon weather__icon-rain">
        <span class="waterdrop drop-1"></span>
        <span class="waterdrop drop-2"></span>
        <span class="waterdrop drop-3"></span>
        <span class="waterdrop drop-4"></span>
      </p>      
    </li>
    <li class="weather">
      <p class="weather__icon weather__icon-cloud"></p>
      <p class="weather__icon weather__icon-snow">
        <span class="snowdrop drop-1"></span>
        <span class="snowdrop drop-2"></span>
        <span class="snowdrop drop-3"></span>
        <span class="snowdrop drop-4"></span>
      </p>      
    </li>
    <li class="weather">
      <p class="weather__icon weather__icon-cloud lightning"></p>
      <p class="weather__icon weather__icon-bolt">
        <span class="bolt bolt-1"></span>
        <span class="bolt bolt-2"></span>
      </p>      
    </li>
    
</section>
            
          
!
            
              //@import url(https://fonts.googleapis.com/css?family=Lato:100,400,300);
@import url(https://fonts.googleapis.com/css?family=Jura:400,300,600);

/* Vars */
$dim_w: 40px;
$dim_h: 40px;
$sun_color: #ffcc00;
$cloud_color: #f1f1f1;
$rain_color: #b8c5fc;
$snow_color: #fff;
$elem_num: 6;
$waterdrop_num: 4;
$snowdrop_num: 4;
$list_h: 200px;
$list_pad: 200px;
//$font: 'Muli';
$font: 'Jura';

body {
  background: #1d1c2f;
  font-family: $font;
}

.title {
  padding-top: 40px;
  font-size: 40px;
  line-height: 70px;
  color: $cloud_color;
  font-weight: 200;
  text-align: center;
}

.forecast-board {
  margin: 0 auto;
  max-width: 1100px;
  padding: 0 20px;
}

.list {
  position: relative;
  height: $list_h;
  padding-top: 100px;
  
  .weather {
    text-align:center;
    height: 200px;
    float:left;
    margin-right: 100px;
    &:last-child {margin-right:0;}
    &.mix {
      p:nth-child(2) {
        transform: translate3d(-60px, 0, 0);
      }
    }
  }
  
  /* position li */
  @for $item from 1 through ($elem_num){
    li:nth-child(#{$item}){ 
      //left: $list_pad * ($item - 1);
    }
  }
  
}

.weather__icon {
  display: inline-block;
  margin: 10px;
  position: relative;
  border-radius: 2px;
  &:before, &:after {border-radius: 2px;}
}
.weather__icon-sun {
  width: $dim_w;
  height: $dim_h;
  padding: 12px;
  border-radius: 50%;
  background: $sun_color;
  border: 1px dashed darken($sun_color, 30%);
  background-clip: content-box;
  animation: rotaty 10s infinite forwards linear;
}
.weather__icon-cloud {
  width: $dim_w;
  height: $dim_h;
  background: $cloud_color;
  opacity:0.98;
  position: relative;
  z-index: 0;
  &.lightning {
    background: darken($cloud_color, 60%);
    animation: lightning 1.6s infinite alternate;
    &:before {background: darken($cloud_color, 20%);}
    &:after {
      background: darken($cloud_color, 45%);
      animation: lightning .6s infinite alternate linear;
     }
  }
  &:before {
    content: '';
    z-index: -1;    
    position: absolute;
    top: -10px;
    left: 30px;
    width: $dim_w - 15px;
    height: $dim_h - 15px;   
    background: darken( $cloud_color, 10% );
    opacity:1;
    animation: floaty 1s infinite alternate linear;
;
  }
  &:after {
    content: '';
    position: absolute;
    z-index: 2;
    bottom: -10px;
    left: 10px;
    width: $dim_w + 15px;
    height: $dim_h - 10px;   
    opacity:1;    
    background: lighten( $cloud_color, 20% );
    animation: floaty 2s infinite alternate cubic-bezier(.17,.67,.83,.67);
  }
}
.weather__icon-rain {
  .waterdrop {
    width: 2px;
    height: 8px;
    position: absolute;
    top:15px;
    background: $rain_color;
    z-index:-1;
  }
  @for $item from 1 through ($waterdrop_num){
    .drop-#{$item}{
      right: 10px * $item;
      animation: rainy #{($item * 0.4)}s infinite alternate cubic-bezier(.17,.67,.83,.67);
    }
  }
}
.weather__icon-snow {
  .snowdrop {
    width: 2px;
    height: 2px;
    position: absolute;
    top:15px;
    background: $snow_color;
    z-index:-1;
    &:after {
      content:'';
      width: 2px;
      height: 2px;
      position: absolute;
      top:5px;
      right: 5px;
      background: $snow_color;
      animation: snowy 1.4s infinite alternate ease;
    }
  }
  @for $item from 1 through ($snowdrop_num){
    .drop-#{$item}{
      right: 10px * $item;
      animation: snowy #{($item * 1.2)}s infinite alternate cubic-bezier(.17,.67,.83,.67);
    }
  }
}

.weather__icon-bolt {
  .bolt {
    width: 0;
    height: 0;
    position: absolute;
    border-bottom: 17px solid lighten($sun_color, 20%);
    border-left: 6px solid transparent;
    animation: flash 0.4s infinite alternate linear;
  }
  
  .bolt-1 {
    transform: rotate(0deg) skew(-5deg, -10deg);
    top: 13px;
    left: -35px;
  }
  .bolt-2 {
    transform: rotate(180deg) skew(-5deg, -10deg);
    top: 20px;
    left: -30px;
  }
}

@keyframes floaty {
  100% {transform: translate3d(-4px, 0, 0);}
}

@keyframes rotaty {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes rainy {
  100% {
    transform: translate3d(0 , 4px, 0);
  }
}
@keyframes snowy {
  100% {
    transform: translate3d(0 , -2px, 0);
  }
}

@keyframes lightning {
  50% {background: darken($cloud_color, 5%);}
}

@keyframes flash {
  100% {
    border-bottom: 17px solid darken($sun_color, 20%);
  }
}
            
          
!
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