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.

              <header class="row header">
	<div class="small-12 columns text-center">
		<img class="header-logo" src="https://cdn1.iconfinder.com/data/icons/simple-icons/512/twitch-512-black.png" alt="logo">
	<div class="small-12 columns text-center">
		<h1 class="header-title">TWITCH STREAMS</h1>
	<div class="row status">
		<div class="small-12 columns text-center status">
			<span id="all">All</span>
			<span id="online">Online</span>
			<span id="offline">Offline</span>

<section class="streams text-center"></section>

	<div class="row">
		<div class="small-12 columns text-center">
			<span>By <a href="https://www.freecodecamp.com/ritvarsz" target="_blank">RitvarsZ</a></span>
$twitch: #6441a5
$twitch-hover: #4B317C
$online: #9CC7E4
$online-hover: #7595AB
$offline: #939798
$offline-hover: #252626
$dark: #4A4C4D
$black: #2F3133

//Vertical center
@media all and (min-width: 1024px)
		display: flex
		align-items: center
		justify-content: center

//Reset CSS
	padding: 0
	margin: 0

	background-color: #dddfff
	font-family: 'Press Start 2P'

	max-height: 230px
	max-width: 230px

	color: black
	font-family: 'Press Start 2P'
	margin-bottom: 50px

//Online - Offline modes
.online, #online
	background-color: $online

.offline, #offline
	background-color: $dark

	background-color: $black

	background-color: $twitch

	margin: 20px
		padding: 5px
		border-radius: 7px

	font-size: 16px
	cursor: pointer
	font-weight: bold

	background-color: $online-hover

	background-color: $twitch-hover

	background-color: $offline-hover

	margin-top: 11px
	margin-bottom: 11px
	border-radius: 11px
	margin: 0 25px 0 25px

	margin: 7px 0 7px 0

	margin-bottom: 15px
	font-weight: 900
	font-size: 11px

	text-decoration: none
	color: #000
              //Set variables;
var streamers = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas", "comster404", "brunofin "];
var urlCheck = "https://wind-bow.gomix.me/twitch-api/channels/"; //Used for checking if channel is not deleted
var urlData = "https://wind-bow.gomix.me/twitch-api/streams/"; //Used for getting data from streams
var dataCheck, dataStream, url, logo, name, game, status, description, className;

//Iterate through every user from array, to get data
for (var i = 0; i < streamers.length; i++) {
		$.getJSON(urlCheck + streamers[i] + "?callback=?"),
		$.getJSON(urlData + streamers[i] + "?callback=?")

//Function for displaying data on page
function displayData(dataCheck, dataStream) {
	//Set status
	if (typeof dataCheck[0].error === 'string') {
		status = "Not Found";
		logo = "http://wewanaplay.com/wp-content/uploads/2013/02/Space_invader-vilain-300x300.jpg";
		description = "This account is closed";
		url = "#";
		name = (dataStream[0]._links.channel).split("/").pop();
		className = "notfound";
	} else if (dataStream[0].stream !== null) {
		status = "Online";
		className = "online";
	} else {
		status = "Offline";
		className = "offline";
	//Set variables channel if exists
	if (status != "Not Found") {
		url = dataCheck[0].url;
		logo = dataCheck[0].logo;
		name = dataCheck[0].display_name;
		description = (dataCheck[0].status !== null ? dataCheck[0].status : "Description not available");
		game = dataCheck[0].game;
	//Display data
		'<a href=' + url + ' target='+ (url == "#" ? "_self" : "_blank") +'>' +
		'<div class="row stream ' + className + '">' +
		'<div class="small-12 medium-12 large-2 logo v_align columns">' +
		'<img class="logo" src=' + logo + ' alt="Channel logo">' +
		'</div>' +

		'<div class="channel small-12 medium-12 large-3 columns v_align">' +
		'<p>' + name + '</p>' +
		'</div>' +

		'<div class="game small-12 medium-12 large-2 columns">' +
		'<p>' + (status == "Online" ? game : status) + '</p>' +
		'</div>' +

		'<div class="description medium-12 small-12 large-5 columns">' +
		'<p>' + description + '</p>' +
		'</div>' +
		'</div>' +
}//End of displayData();

//Function for switching between modes(All, Online, Offline)
function toggle() {
	//t=time(ms), used for animation
	var t = 500;
	//Functions for toggling between modes
	$("#all").click(function() {
	$("#online").click(function() {
	$("#offline").click(function() {

$(document).ready(function() {
	//When page has loaded, run toggle function
🕑 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 ..................