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.

            
              <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>  
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.21/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-resource/0.7.0/vue-resource.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css"></link>
</head>
<body id="app">
  <header id="top" class="header" style="background: url('{{img.webcams.webcam[0].daylight_preview_url}}'); background-size: cover;">
        <div class="text-vertical-center container">
          <h1>AirCheck Demo</h1>
          <hr class="small">
          <h4>Recommendation for children</h4>
          <h5>No reason to panic, but pay attention to changes in air quality and any signals of breathing problems in your children</hr>
          <hr class="small">
          <img src="http://openweathermap.org/img/w/{{data.list[0].weather[0].icon}}.png" style="height: 75px" id="img">
            <h2 id="city">You're in {{data.list[0].name}}</h2>
            <h3>{{data.list[0].weather[0].description | capitalize}}</h3>
          <h4 id="wind">Wind Speed: {{data.list[0].wind.speed}} m/s
            <h4 id="wind">Humidity: {{data.list[0].main.humidity}}%
              <h4 id="wind">Presure: {{data.list[0].main.pressure}} hPa
          <h4 v-if="format"><a style="cursor: pointer; color: white" v-on:click="change">{{data.list[0].main.temp | celcius}}</a></h4>
          <h4 v-if="!format"><a v-on:click="change" style="cursor: pointer; color: white">{{data.list[0].main.temp | fahrenheit}}</a></h4>
            <br>
          <div class='uil-sunny-css text-center' style='transform:scale(0.6);'>
            <div class="uil-sunny-circle text-center"></div>
            <div class="uil-sunny-light text-center"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>
        </div>
    </header>
</body>
<script src="app.js"></script>
            
          
!
            
              html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;
}

.text-vertical-center {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    color: #FFFFFF;
}

.text-vertical-center h1 {
    margin: 0;
    padding: 0;
    font-size: 4.5em;
    font-weight: 700;
    color: #FFFFFF;
}

/* Custom Button Styles */

.btn-dark {
    border-radius: 0;
    color: #fff;
    background-color: rgba(0,0,0,0.4);
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active {
    color: #fff;
    background-color: rgba(0,0,0,0.7);
}

.btn-light {
    border-radius: 0;
    color: #333;
    background-color: rgb(255,255,255);
}

.btn-light:hover,
.btn-light:focus,
.btn-light:active {
    color: #333;
    background-color: rgba(255,255,255,0.8);
}

/* Custom Horizontal Rule */

hr.small {
    max-width: 100px;
}

 .css-input { 
   font-size:16px; 
   border-color:#337ab7; 
   border-style:solid; 
   border-width:7px; 
   padding:14px; 
   background-color:#337ab7; 
   text-align:center; 
   font-family:sans-serif; 
   text-shadow:50px 0px 0px rgba(42,42,42,.0);    border-radius:19px;  
   margin-bottom: 10px;
} 
		 .css-input:focus { outline:none; } 

/* Header */
.uil-sunny-css {
  background: none;
  position: relative;
  width: 200px;
  height: 200px;
}
.uil-sunny-circle {
  position: absolute;
  margin: 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 50px;
  top: 50px;
  left: 50px;
  background: #edb900;
}
.uil-sunny-light > div {
  position: absolute;
/*   margin: 0 auto; */
  width: 0;
  height: 0;
  border-left: 25px solid #ff0000;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}
.uil-sunny-light > div:nth-of-type(1) {
  -ms-transform: rotate(30deg) translate(70px, 0);
  -moz-transform: rotate(30deg) translate(70px, 0);
  -webkit-transform: rotate(30deg) translate(70px, 0);
  -o-transform: rotate(30deg) translate(70px, 0);
  transform: rotate(30deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(2) {
  -ms-transform: rotate(60deg) translate(70px, 0);
  -moz-transform: rotate(60deg) translate(70px, 0);
  -webkit-transform: rotate(60deg) translate(70px, 0);
  -o-transform: rotate(60deg) translate(70px, 0);
  transform: rotate(60deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(3) {
  -ms-transform: rotate(90deg) translate(70px, 0);
  -moz-transform: rotate(90deg) translate(70px, 0);
  -webkit-transform: rotate(90deg) translate(70px, 0);
  -o-transform: rotate(90deg) translate(70px, 0);
  transform: rotate(90deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(4) {
  -ms-transform: rotate(120deg) translate(70px, 0);
  -moz-transform: rotate(120deg) translate(70px, 0);
  -webkit-transform: rotate(120deg) translate(70px, 0);
  -o-transform: rotate(120deg) translate(70px, 0);
  transform: rotate(120deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(5) {
  -ms-transform: rotate(150deg) translate(70px, 0);
  -moz-transform: rotate(150deg) translate(70px, 0);
  -webkit-transform: rotate(150deg) translate(70px, 0);
  -o-transform: rotate(150deg) translate(70px, 0);
  transform: rotate(150deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(6) {
  -ms-transform: rotate(180deg) translate(70px, 0);
  -moz-transform: rotate(180deg) translate(70px, 0);
  -webkit-transform: rotate(180deg) translate(70px, 0);
  -o-transform: rotate(180deg) translate(70px, 0);
  transform: rotate(180deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(7) {
  -ms-transform: rotate(210deg) translate(70px, 0);
  -moz-transform: rotate(210deg) translate(70px, 0);
  -webkit-transform: rotate(210deg) translate(70px, 0);
  -o-transform: rotate(210deg) translate(70px, 0);
  transform: rotate(210deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(8) {
  -ms-transform: rotate(240deg) translate(70px, 0);
  -moz-transform: rotate(240deg) translate(70px, 0);
  -webkit-transform: rotate(240deg) translate(70px, 0);
  -o-transform: rotate(240deg) translate(70px, 0);
  transform: rotate(240deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(9) {
  -ms-transform: rotate(270deg) translate(70px, 0);
  -moz-transform: rotate(270deg) translate(70px, 0);
  -webkit-transform: rotate(270deg) translate(70px, 0);
  -o-transform: rotate(270deg) translate(70px, 0);
  transform: rotate(270deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(10) {
  -ms-transform: rotate(300deg) translate(70px, 0);
  -moz-transform: rotate(300deg) translate(70px, 0);
  -webkit-transform: rotate(300deg) translate(70px, 0);
  -o-transform: rotate(300deg) translate(70px, 0);
  transform: rotate(300deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(11) {
  -ms-transform: rotate(330deg) translate(70px, 0);
  -moz-transform: rotate(330deg) translate(70px, 0);
  -webkit-transform: rotate(330deg) translate(70px, 0);
  -o-transform: rotate(330deg) translate(70px, 0);
  transform: rotate(330deg) translate(70px, 0);
}
.uil-sunny-light > div:nth-of-type(12) {
  -ms-transform: rotate(360deg) translate(70px, 0);
  -moz-transform: rotate(360deg) translate(70px, 0);
  -webkit-transform: rotate(360deg) translate(70px, 0);
  -o-transform: rotate(360deg) translate(70px, 0);
  transform: rotate(360deg) translate(70px, 0);
}
width: 100%;
@-webkit-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-webkit-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-moz-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-ms-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-moz-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-webkit-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@-o-keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
@keyframes uil-sunny-rotate {
  0% {
    -ms-transform: translate(88px, 90px) rotate(0deg);
    -moz-transform: translate(88px, 90px) rotate(0deg);
    -webkit-transform: translate(88px, 90px) rotate(0deg);
    -o-transform: translate(88px, 90px) rotate(0deg);
    transform: translate(88px, 90px) rotate(0deg);
  }
  100% {
    -ms-transform: translate(88px, 90px) rotate(60deg);
    -moz-transform: translate(88px, 90px) rotate(60deg);
    -webkit-transform: translate(88px, 90px) rotate(60deg);
    -o-transform: translate(88px, 90px) rotate(60deg);
    transform: translate(88px, 90px) rotate(60deg);
  }
}
.uil-sunny-light {
  width: 25px;
  height: 20px;
  -ms-animation: uil-sunny-rotate 1s linear infinite;
  -moz-animation: uil-sunny-rotate 1s linear infinite;
  -webkit-animation: uil-sunny-rotate 1s linear infinite;
  -o-animation: uil-sunny-rotate 1s linear infinite;
  animation: uil-sunny-rotate 1s linear infinite;
}
.header {
    display: table;
    position: relative;
    width: 100%;
    height: 100%;
    background: url('http://media.gettyimages.com/photos/high-angle-view-of-york-minster-and-residential-district-against-sky-picture-id597691443');
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;
    -o-background-size: cover;
  
}
            
          
!
            
              $('.uil-sunny-circle').hide();
$('.uil-sunny-light').hide();
new Vue({
  el: '#app',
  
  data: function(){
    return {
      city: '',
      format: true,
      lat: '',
      lon: ''
    }
  },
  ready: function(){
    this.getData();
    $('.uil-sunny-circle').show();
              $('.uil-sunny-light').show();
  },
  methods: 
  {
    getData: function()
    {
      $('.uil-sunny-circle').show();
      $('#city').hide();
              $('#wind').hide();
      $('#img').hide();
      var self = this;
      function success(pos){
        var latitude  = pos.coords.latitude;
        var longitude = pos.coords.longitude;
      $.getJSON('http://api.openweathermap.org/data/2.5/find?lat='+latitude+'&lon='+longitude+'&cnt=10&appid=55e71b08f9edeb8c17b7eb7f381bf15d&units=metric', function(data){
        self.$set('data', data);
              $('.uil-sunny-circle').remove();
              $('.uil-sunny-light').remove();
              $('#city').show();
              $('#wind').show();
              $('#img').show();
      })
      }
      navigator.geolocation.getCurrentPosition(success);
    },
    change: function()
    {
      var self = this;
      if(self.format){
        return self.format = false;
      }else {
        return self.format = true;
      }
    }
  }
})

Vue.filter('celcius', function(value){
  return value + '°C';
})
Vue.filter('fahrenheit', function(value){
  return Math.round( (value * 9)/5 + 32 ) + '°F'
})
$('.css-input').focus(
  function(){
    $(this).val('');
  });
            
          
!
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