123

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.

            
              sd<html>
  <head>
    <title>The Weather App</title>
<!--     <link rel="stylesheet" type="txt/css" href="https://github.com/WiseNN/myGridRep.git"> -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">	
    <xhtml:link href="http://vibecityent.com/blacksota/SVG/weatherSVG/colorful/svg/27.svg" rel="stylesheet" type="text/css"/>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    
      <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script>  


          <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.0/p5.min.js"></script>  -->
    </head>
  
 <body class="grid-container fullBody">
   
  <div class="col-6 header">
   <div class="appTitleBox">
    <p class="appTitle">The Weather App</p>
   </div>
      <div class="breakBox">
        <hr class="break headBreak">
      </div>
    <div class="query">  
      <input class="inVal" id="city" type="text" placeholder="enter name of City" ><input\>
      <input class="inVal" id="state" type="text" placeholder="enter state ex. FL"><input\>
      <input class="inVal" id="zipcode" type="text" placeholder="zipcode" ><input\>   
   </div>     
     <div class="headButtons"> 
        <button id="submit">Submit</button>
        <button id="reset">Reset</button>
     </div>
  </div>
           <footer class="col-6 myFooter">
        <div class="footName">
          <p>This Weather Application was created by: Norris Wise Jr.</p>
          </div>
      </footer>
   <div class="location-container">  
    <div class="location" id="specialLoc">
      <dl class="listWrapper">
				
      <dt id="li1"><span id="locLine_1">list item 1</span><br>
					<span class="allTemp" id="lowTemp_1">low#</span><i class="fa fa-arrow-down downArrow" ></i>
					<span class="allTemp" id="hiTemp_1">hi#</span><i class="fa fa-arrow-up upArrow" ></i>
					<div class="locIcons" id="LiCON_1"></div>
			</dt>
                <hr class="break listBreak">
      <dt id="li2"><span id="locLine_2">list item 2</span><br>
					<span class="allTemp" id="lowTemp_2">low#</span><i class="fa fa-arrow-down downArrow" ></i>
					<span class="allTemp" id="hiTemp_2">hi#</span><i class="fa fa-arrow-up upArrow" ></i>
					<div class="locIcons" id="LiCON_2"></div> 
			</dt>
                <hr class="break listBreak">
      <dt id="li3"><span id="locLine_3">list item 3</span>	<br>
				  <span class="allTemp" id="lowTemp_3">low#</span><i class="fa fa-arrow-down downArrow" ></i>
					<span class="allTemp" id="hiTemp_3">hi#</span><i class="fa fa-arrow-up upArrow" ></i>
					<div class="locIcons" id="LiCON_3"></div> 
			</dt>
                <hr class="break listBreak">
      <dt id="li4"><span id="locLine_4">list item 4</span><br>
					<span class="allTemp" id="lowTemp_4">low#</span><i class="fa fa-arrow-down downArrow" ></i>
					<span class="allTemp" id="hiTemp_4">hi#</span><i class="fa fa-arrow-up upArrow" ></i>
					<div class="locIcons" id="LiCON_4"></div> 
			</dt>        
                <hr class="break listBreak">
     <dt id="li5"><span id="locLine_5">list item 5</span><br>				
					<span class="allTemp" id="lowTemp_5">low#</span><i class="fa fa-arrow-down downArrow" ></i>
					<span class="allTemp" id="hiTemp_5">hi#</span><i class="fa fa-arrow-up upArrow" ></i>
					<div class="locIcons" id="LiCON_5"></div> 
		 </dt>        
      </dl>
    </div> 
   </div>
    
	  <div class="slideBar">
       
       <div class="slideBar-title">
         <h3 id="barTitle">slideBar Title</h3>
       </div>
       <div class="imageContainer">
      <div id="myImage" ></div>
		   <i id="iconText"></i>
          </div>
       

         <button class="temp-gauge" placeholder="temperature"> </button><i id="littleF">℉</i>
       
     <div class="settings">
       <table class="set-table">
          <tr class="set-row1">
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>            
          </tr>
          <tr class="set-row2">
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>
            <td>
         <button class="set-btn">
         <i>settings<i\>
       </button>
            </td>            
          </tr>              
         
          
       </table>


     </div>
  
       
    </div>
 
 </body>
      
        <script>
// <![CDATA[<img src="http://l.yimg.com/a/i/us/we/52/26.gif"/> <BR /> <b>Current Conditions:</b> <BR />Cloudy <BR /> <BR /> <b>Forecast:</b> <BR /> Mon - Scattered Showers. High: 41Low: 39 <BR /> Tue - Rain. High: 41Low: 39 <BR /> Wed - Rain. High: 42Low: 39 <BR /> Thu - Scattered Showers. High: 42Low: 38 <BR /> Fri - Mostly Cloudy. High: 46Low: 36 <BR /> <BR /> <a href="http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2460286/">Full Forecast at Yahoo! Weather</a> <BR /> <BR /> (provided by <a href="http://www.weather.com" >The Weather Channel</a>) <BR /> //]]>
        </script>          

  
  </html>
            
          
!
            
              *{margin:0px;
}
.fullBody{
height:100%;
  width:100%;
  overflow:auto;
	background-size:cover;
  background-color: black;
    background-image : url('http://s.hswstatic.com/gif/water-life-crop.jpg');
   transition: background 3s linear;
     -webkit-transition: background 5s linear;


}

.header{
  
  box-shadow:0px 60px 20px -10px black inset,0px -10px 20px -10px black inset;
  background-color:rgba(67, 49, 76, 1.0);
  position:fixed;
  top:0px;
  left:0px;
  width:100%;
  height:160px;
  color:rgba(255,255,255,1);
  font-family:sans-Serif;
  z-index: 50;
}

.break{
  box-shadow:0px -3px 1px 1px rgba(204, 204, 204, 0.24),0px 2px 3px 1px rgba(0, 0, 0, 0.45);
  border:rgba(0,0,0,0,.1);
    margin-top:1.5px;
  margin-left:2%;
  width:95%;

}
.appTitleBox{
box-shadow:0px 20px 20px -5px rgba(72, 6, 132, 0.72) inset;  
}


.appTitle{
  font-size:40px;
  margin-left:2%;
  margin-top:20px;

}
.query, .headButtons{
  //border:solid green 3px;
  position:fixed;
  top:104px;
  width:51%;
  height:40px;
  padding-left:2%;


}
.inVal{
  border:grooved green 2px;
 height:inherit;
  width:25%;
	margin-right:22px;
  border-radius:50px;
  color:black;
  text-align:center;
}

#state,#zipcode{
	width:20%;
}
#submit,#reset{
  border:grooved green 2px;
 height:inherit;
  width:25%;
  border-radius:50px;
  color:black;
  text-align:center;
}
#submit{
  margin-left:30%;
  margin-right:5%;
}
.headButtons{
  padding-right:0px;
  margin-left:54%;
  width:42.7%;
}

#city,#country{
      margin-right:3%;
}
.location-container{
   display:none;/* slide Down */
  position: fixed;
    top:145px;
    left:63% ;
    min-width: 245px;
  background-color:white;
    box-shadow:0px 4px 2px 1px black,0px 0px 3px 4px rgba(255,255,255,.4) inset;;
   background-color:rgba(0,0,0,.6);
  border-radius:9px;
  z-index:40;
	padding-left:9px;
	padding-right:9px;
		padding-top:25px;
  height: 62%;
  overflow-y: scroll;
  overfloe-x: none;
}
.location{


}

.location>dl>dt{

  border: groove rgba(255,255,255,.13) 1px;
	float:left;
  border-radius:10px;
  padding:5px 0px 0px 6px;
  background-color:rgba(0,0,0,.6);
  color:rgba(255,255,255,.6);	
}

.allTemp{
  color: green;
}

.downArrow,.upArrow{
  display:none;
	font-size:80%;
}
.upArrow{
	position:relative;
	top:-9px;
	left:3px;
	transform: rotate(40deg);	
  color:rgb(230, 16, 92);

}
.downArrow{
	position:relative;
	left:2px;
	transform:rotate(40deg);
  color:rgb(28, 189, 218);
}
.locIcons{
	display:inline-block;
		position:relative;
		top:-21px;
	left:66px;
	height:50px;
	width:70px;
	margin-bottom:-17px;
//	border: solid white 1px;
/*	background-image:url(http://vibecityent.com/blacksota/SVG/weatherSVG/colorful/svg/47.svg);*/
	background-size:contain;
	background-repeat:no-repeat;
	

	
}

.listWrapper{

	//font-size:20px;
}
#li1,#li2,#li3,#li4,#li5{
  margin-bottom:10px;
  font-size:100%;
	width:97%;
}
.slideBar{
  position:fixed;
  top:140px;
  left:-310px;
  width:300px;
  height: 64%;
  background-color:rgba(0,0,0,.8);
  box-shadow:-15px 0px 10px -10px white inset,7px -10px 7px 4px grey inset; */
    z-index:39;
  border-radius:9px;
  border-right:solid black 3px;
}
.slideBar-title
{
  border:solid grey 1px;
position:absolute;
  height:12%;
  width:80%;
  top:10%;
  left:10%;
  border-radius:3px;
  color:white;
  text-align:center;
}

#barTitle{
	display:none;
	margin-top:7%;
}


.imageContainer{

	//border:solid grey 1px;
position:absolute;
 height:30%;
  width:80%;
  top:30%;
  left:10%;
  border-radius:3px;
	padding:0px;
	margin:0px;

}
#myImage{
  display:none;
	position: absolute;
	top:20px;
  left: 60px;
 background-repeat: no-repeat;
  height:85%;
   //border: solid black 2px;

    width:60%;
	background-size:contain;
}
#iconText{
	  display:none;
	color: white;
	font-size: 120%;
	padding-left:2%;
}
.temp-gauge{
     display:none; 
	//border:solid grey 1px;
    position:absolute;
    height:30%;
    width:77%;
    top:63%;
    left:11.5%;
    background-color:rgba(0,0,0,.1);
    border-radius:3px;
    color:white;
    font-size:800%;
    font-family: monospace;
}
#littleF{
  display:none;
	position: absolute;
	top:69%;
	left:70%;
  color:white;
	font-size:18px;

}
.settings, {
position:fixed;
  /*
     When height is at 50%, the buttons are in full viewport
  */
  height:6%;
  bottom:107.4px;
  left:-310px;
  width:300px;
  border-bottom-right-radius:9px;
  border-top-right-radius:9px;
    border-top-left-radius:9px;
  background-color:rgba(0,0,0,.5);
 box-shadow:2px 4px 3px 1px rgba(255,255,255,.4) inset;/*,-7px -10px 10px 0px white;*/
}
.settings:hover{
  height:10%;
}
.set-table{
  display:none;
  width:100%;
  height:100%;
}
table,tr,td{
 //border:solid blue 4px; 


}
.set-row1,.set-row2{
  height:50%;
}
.set-btn{
  width:100%;
  height:100%;
}

.footName>p{
  font-size:20px;
  margin-top:30px;
}
.myFooter{
  position:absolute;
  bottom:0px;
  width:100%;
  height:128px;
  box-shadow:0px 60px 20px -55px black inset;
  background-color:rgba(67, 49, 76, 1.0);
  color:rgba(255,255,255,1);
  z-index:10;
}
#zipcode{
	display:none;
}

/*code test box*/

/*.allJSON{
  position: fixed;
  top: 22%;
  left: 300px;
  height:60%;
  width:57%;
  overflow: auto;
  border: solid aqua 3px;

  
}*/



  

            
          
!
            
              $(document).ready(function () {
    var image = '', bool = false, count = 0, dropICONS = '', long = false, latt = false, tempUrl = '', woeid = '', getWoeid = false, pressMe = false, finishExec = false;
    
  
        function RunCALL(url) 
        {
            debugger;
          
            function successCallback()
            {
                debugger;
                console.log("SUCCESS COMPLETION HANDLER HAS BEEN CALLED!");
            }

            function completionHandler(data)
            {
                  debugger;
              
                  var returnedObj = data.responseJSON;
                  console.log(JSON.stringify(returnedObj));
              
                  if(returnedObj["photos"])
                    {
                        flickrReport(data.responseJSON);
                    }
                  else if(returnedObj["query"])
                    {
                      weatherReport(data.responseJSON);
                    }
            }
          
            function errorHandler(e)
            {
              debugger;
                console.log(e);
            }
   
                    console.log('RunCALL alert');
  
            $.ajax({
                url: url,
                async: false,
                dataType: 'jsonp',
                crossDomain: true,
                method: 'POST',
                statusCode: {
                    404: function () {
                        console.log('-4-4-4-4 WE GOT 404!');
                    },
                    200: function () {
                        console.log('-2-2-2-2 WE GOT 200!');
                    }
                },
                success: successCallback
                ,
                complete: completionHandler
                ,
                error: errorHandler
            });
        }
        


    function flickrReport(Obj) 
    {
        var farmID = '', serverID = '', photoID = '', origSecr = '', format = '', date = 0;
        var photoUrl = '';
        count++;
        console.log('flickReport count: ' + count);
        console.log(' in the flickReport ');
        var myObj = JSON.stringify(Obj);
        debugger;
        var rand = Math.floor(Math.random()*10)
        console.log("rand: "+rand);
        farmID = Obj.photos.photo[rand].farm;
        serverID = Obj.photos.photo[rand].server;
        photoID = Obj.photos.photo[rand].id;
        farmID = Obj.photos.photo[rand].farm;
        origSecr = Obj.photos.photo[rand].originalsecret;
        format = Obj.photos.photo[rand].originalformat;
        photoUrl = 'https://farm' + farmID + '.staticflickr.com/' + serverID + '/' + photoID + '_' + origSecr + '_o.' + format;
        document.body.style.backgroundImage = 'url(' + photoUrl + ')';
      //"url('URL')|none|initial|inherit"
        console.log(photoUrl);
        bool = true;
        console.log('The bool in flickr report is: ' + bool);
    }
  
    function weatherReport(jsonObj) 
    {

        console.log('Look for JSON: ' + jsonObj);
        var forecastArray = [], forecast = [];
        var myDate = new Date();
        var myDay = myDate.getDay();
        console.log('This is the day of the week: ' + myDay);        
        var iconCode = jsonObj.query.results.channel.item.condition.code;
        var iconUrl = 'http://vibecityent.com/blacksota/SVG/weatherSVG/colorful/svg/' + iconCode + '.svg';
        image.style.backgroundImage = 'url(' + iconUrl + ')';
        var mainTempNum = jsonObj.query.results.channel.item.condition.temp;
        var unit = jsonObj.query.results.channel.units.tempurature;
        var cityJSON = jsonObj.query.results.channel.location.city;
        var regionJSON = jsonObj.query.results.channel.location.region;
        var countryJSON = jsonObj.query.results.channel.location.country;
        var letterU = countryJSON.charAt(0);
        var letterS = countryJSON.charAt(7);
        forecastArray = jsonObj.query.results.channel.item.forecast;
        debugger;
        $('#barTitle').text(cityJSON + ', ' + regionJSON + ' ' + letterU + letterS);
        $('#iconText').text(jsonObj.query.results.channel.item.condition.text);
        $('.temp-gauge').text(mainTempNum);
        for (var i = 1; i < 6; i++) 
        {

            var imgCode = forecastArray[i].code;
            iconUrl = 'http://vibecityent.com/blacksota/SVG/weatherSVG/colorful/svg/' + imgCode + '.svg';
            var FcastDate = forecastArray[i].date.substring(0, 6);
            var day = forecastArray[i].day;
            var hiTemp = forecastArray[i].high;
            var lowTemp = forecastArray[i].low;
            var txtStatus = forecastArray[i].text;
            var wDate = day + ', ' + FcastDate;
            $('#locLine_' + i).text(wDate);
            $('#lowTemp_' + i).text(lowTemp + '\xB0');
            $('#hiTemp_' + i).text(hiTemp + '\xB0');
            var temp = 'LiCON_' + i;
            dropICONS = document.getElementById(temp);
            dropICONS.style.backgroundImage = 'url(' + iconUrl + ')';
        }
        
        $('.location,#barTitle,#myImage,#iconText ,.temp-gauge, #littleF').fadeIn(600);
    }
  
    function callWeather(listener) 
    {
        var yahoo_Url1 = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20%28select%20woeid%20from%20geo.places%20where%20text=%22';
        var city = '', state = '';
        var yahoo_Url2 = 'Norcross%20GA';
        var yahoo_Url3 = '%22%29%20and%20u%3D%22f%22&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys';
        var yahoo_UrlSEND = yahoo_Url1 + yahoo_Url2 + yahoo_Url3;;
        var flickr_Domain = 'https://api.flickr.com/services/rest/?method=';
        var flickr_MethodCall = 'flickr.galleries.getPhotos';
        var flickr_ApiKey = 'api_key=9c97a9b3a44149de735e3a738c7b82ed';
        var galleryID = 'gallery_id=72157665782409143';
        var format = 'format=json';
        var extras = 'extras=original_format';
        var flickr_UrlSEND = flickr_Domain + flickr_MethodCall + '&' + flickr_ApiKey + '&' + galleryID + '&' + extras + '&' + format + '&jsoncallback=?';
      

        RunCALL(flickr_UrlSEND);
      
      
        if (listener == ('submit' || 'keydown')) 
        {
            pressMe = true;
            city = document.getElementById('city').value;
            state = document.getElementById('state').value;
            if (city === " " || state === " ") 
            {
                alert('Please enter a City and State\n Thank you!');
                return;
            }
            yahoo_Url2 = city + '%20' + state;
            yahoo_UrlSEND = yahoo_Url1 + yahoo_Url2 + yahoo_Url3;
            

            console.log('before all callss!!-----22222');
            console.log('in between callss!!-----22222');
            RunCALL(yahoo_UrlSEND);
            console.log('after all callss!!-----22222');
            document.getElementById('city').value = ' ';
            document.getElementById('state').value = ' ';
        } 
      
            else if (listener == 'reset') 
            {

             RunCALL(yahoo_UrlSEND);
            } 
      
            else 
            {
              if (!getWoeid) 
              {

                  RunCALL(yahoo_UrlSEND);
              } 
              else 
              {

                yahoo_UrlSEND = 'https://api.flickr.com/services/rest/?method=flickr.places.findByLatLon&api_key=d98266e1f96fc2207a20a5dc34ce9aa4&lat='+latt+'&lon='+long+ '&accuracy=11&format=json&nojsoncallback=?';
                RunCALL(yahoo_UrlSEND);
              }
           }
    }
  
    function slideShow()
    {
      
    }
  
    var geo_Options = {
      enableHighAccuracy : true,
      maximumAge : 0,
      timeout : 2
    };
  
    function myLocationSuccess(position) 
    {
        long = position.coords.longitude;
        latt = position.coords.latitude;
        latt = Math.floor(latt);
        long = Math.floor(long);
        getWoeid = true;
        return;
    }
  function errOnLocation(err)
  {
       console.log("Error: "+err.message+"["+err.code+"]"); 
  }
    function getLocation() {
        navigator.geolocation.getCurrentPosition(myLocationSuccess, errOnLocation, geo_Options);
    }
    function effects() {
        document.getElementById('specialLoc').style.display = 'none';
        $('.location-container ').slideDown(3000);
        setTimeout(function () {
            $('.location,#barTitle,#myImage,#iconText ,.temp-gauge, #littleF').fadeIn(5000);
        }, 3000);
        $('.slideBar, .settings').animate({ left: '-10px' }, 400).animate({ left: '-100px' }, 200).animate({ left: '-65px' }).animate({ left: '-10px' }, 1000);
    }
    function setup() 
    {
        var button = document.getElementById('submit');
        var reset = document.getElementById('reset');
        var input = document.getElementById('city');
        image = document.getElementById('myImage');
        button.addEventListener('mousedown', function () {
            callWeather('submit');
        });
        reset.addEventListener('mousedown', function () {
            callWeather('reset');
        });
    }
    debugger;
    getLocation();
    callWeather();
    setup();
    effects();
    slideShow();
});

            
          
!
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