css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              	<div class="container">

			<div class="wind"></div>
			<span class="temperature"></span>
			<span class="name"></span>
			
			<div class="humidity_box"></div>

		</div> <!-- container -->
            
          
!
            
              			html,body,.container{
				position: relative;
				margin: 0;padding: 0;
				width: 100%; height: 100%;
				

			}

			.wind{
				position: absolute;
				left: 50%; top: 50%;
				width: 0px;
				height: 0px;
				border-style: solid;
				border-width: 0 50px 50px 50px;
				border-color: transparent transparent grey transparent;
			}

			.temperature{
				position: absolute;
				top: 0; left: 0;
				display: block;	
			}

			
			.name{
				position: absolute;
				top: 0; right: 0;
				display: block;
			}

			.humidity_box{
				position: absolute;
				bottom: 0; right: 0;
				width: 100%; 
				background: rgba(0,0,0,.5);	
			}

            
          
!
            
              //to many request problem some
$( document ).ready(function() {
 
var container = $('.container');
var wind = $('.wind');
var temperature = $('.temperature');
var name = $('.name');
var humidity_box = $('.humidity_box');
// options :
var my_city=myip;
var my_key="512358837ae8b362029ea7b95f9c7";
var no_of_days=2;
// build URI:
var uri="http://api.worldweatheronline.com/free/v2/weather.ashx?q="+my_city+"&key="+my_key+"&format=json&no_of_days="+no_of_days+"&includeLocation=yes";
// uri-encode it to prevent errors :
uri=encodeURI(uri); 


		jQuery.get(uri,function(r)
		{
		  	   // no error
		   // do normal stuff

		     // Name of nearest area :
		 	 nearest_area    =r.data.nearest_area[0].region[0].value;


		    
		    // Name of country :
		    country         =r.data.nearest_area[0].country[0].value;
		    

		    name.text( myip + " ( "+ nearest_area + " "+ country + " ) ");

		    // Current temperature in fahrenheit and celsius:
		    current_temp_F  =r.data.current_condition[0].temp_F;
		    current_temp_C  =r.data.current_condition[0].temp_C;

		    //

		    temperature.text(current_temp_C+" celcius");
		    
		    // A short description of current  weather conditions:
		    current_condition=r.data.current_condition[0].weatherDesc[0].value;
		    


		    // Max/Min temperature in fahrenheit
		    max_temp_F      =r.data.weather[0].tempMaxF;
		    min_temp_F      =r.data.weather[0].tempMinF;
		    
		    // Max/min temperature in celsius:
		    max_temp_C      =r.data.weather[0].tempMaxC;
		    min_temp_C      =r.data.weather[0].tempMinC;
		    
		    //Humidity in %
		    humidity        =r.data.current_condition[0].humidity;
		    // console.log(parseInt(humidity)+'%');
		    humidity_box.height(parseInt(humidity)+'%');
		    humidity_box.text(parseInt(humidity)+'% of humidity');


		    
		    // Precipitation in mm :
		    precipitation   =r.data.current_condition[0].precipMM;

		    
		    
		    // Pressure in millibars:
		    pressure        =r.data.current_condition[0].pressure;
		    
		    // Wind speed in kmph
		    wind_speed_kmph =r.data.current_condition[0].windspeedKmph;
		    
		    // Wind speed in mph
		    wind_speed_mph  =r.data.current_condition[0].windspeedMiles;
		    
		    // Wind direction degree (0 degree corresponds with North)
		    wind_dir        =r.data.current_condition[0].winddirDegree;


		  	// triangle vent directon
		  	// console.log(wind_dir);

		  	var deg = parseInt(wind_dir);
		  	// console.log(deg);
		  	  wind.css('-webkit-transform','rotate('+deg+'deg)'); 
		      wind.css('-moz-transform','rotate('+deg+'deg)');
		      wind.css('transform','rotate('+deg+'deg)');

		},"jsonp"); // end jQuery.get()

});

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

Console