Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
  <div class="row text-center title"><h1>Cally's Twitch TV Portal</h1>
    <div id="main" class="container">
      <div id="online"></div> 
      <div id="offline"></div>
      <div id="nonExist"></div>
		</div>
	</div>      

  </body>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Didact+Gothic|Arimo);

body {
	background-color: blue;
	
}

#main {
	width: 80%;
	font-size: 1.4em;
	background-color: blue;
	color: black;
	font-family: "Arimo", Arial, Sans-serif;
}

.title h1{
	margin-bottom: 2em;
	font-family: "Didact Gothic", Arial, Sans-serif;
	color: white;
}

.name, #image {
	min-height: 3em;
}

.detail {
	text-align: left;
	min-height: 3em;
}
.detail2 {
	min-height: 3em;

}

.detail, .detail2, .name, #image {
	padding-top: 15px;
}

.bar {
	border: 1px solid black;
	border-radius: 10px;
	box-shadow: 5px 5px 2px #2d2a2a;
	margin: 10px;
}

#online {
  background-color: #8EFFBA;
  padding-bottom: 2px;
  padding-top: 1px;
}

#offline {
  background-color: #FFFD7C;
  padding-bottom: 2px;
  padding-top: 1px;
}

#nonExist {
  background-color: #FFB8A2; 
  padding-bottom: 2px;
  padding-top: 1px;
  margin-bottom: 3em;
}

#online .row {
	background-color: #40FF70;
}

#offline .row {
	background-color: #ffe100;
}

#nonExist .row {
	background-color: #FFA28C;
}


              
            
!

JS

              
                
/*```js*/


$(document).ready(function() {
	var streamers = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas","brunofin","compster404"]
	
	for (var i = 0; i < streamers.length; i++) {
       
    	$.ajax({
    		url: "https://api.twitch.tv/kraken/streams/" + streamers[i] + "?client_id=be1j3qoluuj2m89a8w7ecxcqvotbrkc&callback=?",
    		dataType: "jsonp",
    		data: {
				format: "json"
			},

    		success: function (data) {
    			console.log(data);
			 
				if (data.stream === null){
				var name = data._links.self
			  	name = (name.split('/')).pop();
			  	var link = "https://www.twitch.tv/" + name;
			  	var offlineLink = "<a href='" + link + "' target='_blank'>" + name + "</a>";

				$(' #offline ').append('<div class="row bar"><div id="image" class="col-xs-2"></div><div class="col-xs-4 name">' + offlineLink + '</div><div class="col-xs-6 detail">is offline</div></div>');
				}
				
				else if (data.status === 404 || data.status === 422) {
				$(' #nonExist ').append('<div class="row bar"><div id="image" class="col-xs-2"></div><div class="col-xs-10 text-center detail2">' + data.message + '</div></div>');
	
				}

				else if (data.stream != null){
				name = data.stream.channel.display_name;
				link = data.stream.channel.url
				var linkedName = "<a href='" + link + "' target='_blank'>" + name + "</a>";
				var game = data.stream.channel.game
	    		
				$(' #online ').append('<div class="row bar"><div id="image" class="col-xs-2"></div><div class="col-xs-4 name">' + linkedName + '</div><div class="col-xs-6 detail">is online with ' + game + '</div></div>');
   

		}	
			
    	}
    });
}

					for (var j = 0; j < streamers.length; j++) {
		       
		    	$.ajax({
		    		url: "https://api.twitch.tv/kraken/channels/" + streamers[j] + "?callback=?",
		    		dataType: "jsonp",
		    		data: {
						format: "json"
					},

		    		success: function (data) {
					 imageUrl= data.logo
					 console.log(imageUrl);

					 logo = 'background-image: url(' + imageUrl + ')'
					$(' #image ').css('logo');
				}
					
		    	});
		    }
		});


    
	

              
            
!
999px

Console