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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

HTML

              
                <head>
	<link href="https://fonts.googleapis.com/css?family=Bowlby+One+SC" rel="stylesheet">
</head>

<body>
	<div class="container twitch-logo">
		<h1 class="text-center">Twitch Channel Status</h1></div><br>
	<div class="container">
		<ul class="nav nav-pills nav-justified header">
			<li id="showAll"><a href="#">All</a></li>
			<li id="showOnline"><a href="#">Online</a></li>
			<li id="showOffline"><a href="#">Offline</a></li>
		</ul>
	</div><br>
	<div class="container">
		<div class="preview">
		</div>
	</div>
	<footer>
		<script src="https://use.fontawesome.com/350b307c17.js"></script>
		<p class="text-center">Coded by Srđan Međo</p>
	</footer>
</body>
              
            
!

CSS

              
                body {
	background-color: #9d6cff;
	font-family: Verdana, Tahoma, sans-serif;
}

.preview {
	margin: 0 auto;
}

.box {
	border-style: solid;
	border-width: 2px;
	border-color: black;
	box-shadow: 2px 2px 4px #2a0f62;
	border-radius: 15px;
	text-align: center;
	display: flex;
	/*flex-direction: row;*/
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.user-logo {
	width: 110px;
	border-radius: 20%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 10px 10px 10px 10px;
}

a,
a:hover,
a:visited,
a:focus {
	text-decoration: none;
	color: black;
}

.user-label {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.imageMain {
	background-image: url("https://s28.postimg.org/v3rlsiblp/Twitch_White_RGB.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 300px auto;
	padding: 200px 0px 0px 0px;
}

.header {
	font-family: 'Bowlby One SC', Verdana, Tahoma, sans-serif;
	font-size: 2em;
}

footer {
	font-family: Verdana, Tahoma, sans-serif;
}

.game,
.game-offline {
	width: 110px;
	height: 110px;
	border-radius: 20%;
	margin: 10px 10px 10px 10px;
	background-color: #bf95f3;
	display: flex;
	justify-content: center;
	align-items: center;
}

@media (max-width: 580px) {
	h2 {
		font-size: 1.5em;
	}
	.user-logo {
		width: 90px;
	}
	.game,
	.game-offline {
		width: 90px;
		height: 90px;
	}
}

@media (max-width: 460px) {
	.online,
	.offline {
		flex-direction: column;
		min-width: 250px;
	}
	h2 {
		font-size: 2em;
	}
	.user-logo {
		width: 110px;
	}
	.game,
	.game-offline {
		width: 110px;
		height: 110px;
	}
}
              
            
!

JS

              
                $(document).ready(function() {
	var streams = ["ESL_SC2", "OgamingSC2", "deliberatemurder", "freecodecamp", "streamerhouse", "102ash", "RobotCaleb", "noobs2ninjas", "brunofin", "comster404"];

	$(".twitch-logo").addClass("imageMain").text("");

	//for (let value in streams) // ES6, not working for older browsers unless transpiled
	var loop2 = function loop(value) {
		$.getJSON("https://wind-bow.gomix.me/twitch-api/streams/" + streams[value] + "?callback=?", function(data) {
			var apiLink = data._links.channel;
			var chanName = apiLink.substr(38);
			$.getJSON("https://wind-bow.gomix.me/twitch-api/channels/" + streams[value] + "?callback=?", function(data2) {
				var chanLink = data2.url;
				var logo = data2.logo;
				var pic = data2.profile_banner;
				var followers = data2.followers;
				var game = data2.game;
				console.log(data2);
				//$(".box").css("background-image", "url("+ pic +")");
				if (data2.status === 404) {
					$(".preview").append("<a class='offline' href='#'><div class='box offline'><img class='user-logo' src='" + logo + "' alt='User logo'><div class='user-label'><h2>" + chanName + "</h2></div><div class='game'><p>Channel Not Found</p></div></div><br>");
				} else if (data.stream === null) {
					$(".preview").append("<a class='offline' href='" + chanLink + "' target='_blank'><div class='box offline'><img class='user-logo' src='" + logo + "' alt='User logo'><div class='user-label'><h2>" + chanName + "</h2><p><i class='fa fa-users' aria-hidden='true'></i> Followers: " + followers + "</p></div><div class='game-offline'><p><span>Offline</span></p></div></div><br>");
				} else {
					$(".preview").append("<a class='online' href='" + chanLink + "' target='_blank'><div class='box online'><img class='user-logo' src='" + logo + "' alt='User logo'><div class='user-label'><h2>" + chanName + "</h2><p class='info1'><i class='fa fa-users' aria-hidden='true'></i> Followers: " + followers + "</p></div><div class='game'><p>Playing:<br><span class='status'>" + game + "</span></p></div></div><br>");
				}
			}); // getJSON channels
		}); //getJSON streams
	}
	for (var i = 0; i < streams.length; i++) {
		loop2(i);
	}

	$("#showOnline").click(function() {
		$(".online").hide();
		$(".offline").hide();
		$(".online").show();
	});
	$("#showOffline").click(function() {
		$(".online").hide();
		$(".offline").hide();
		$(".offline").show();
	});
	$("#showAll").click(function() {
		$(".online").hide();
		$(".offline").hide();
		$(".online").show();
		$(".offline").show();
	});
});
              
            
!
999px

Console