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
.container
	.row
		.col-12
			div(class="row d-flex justify-content-center pt-50")
				div(class="title col-12 text-center") Twitch Streams
			div(class="row d-flex justify-content-center ")
				div(class="col-lg-6 col-md-6 col-sm-12 col-xs-12 twitch-panel")
					ul(class="mainMenu")
						li(class="menu-btn active" id="all") All
						li(class="menu-btn" id="online") Online
						li(class="menu-btn" id="offline") Offline
					div(class="twitch-list col-12")
				
              
            
!

CSS

              
                $main-color: #94d8a6
$main-color-shadow: #afd7b4
$purple: #645e8e
$twitch-panel-color: #f3eabf
$twitch-panel-shadow: #f1cfa1

@import url(https://fonts.googleapis.com/css?family=Cantarell:400i)
@import url(https://fonts.googleapis.com/css?family=Gugi)

body
	background-color: $main-color


.pt-50
	padding-top: 50px


.twitch-panel
	height: auto
	background-color: $twitch-panel-color
	border-radius: 5px
	padding: 0px
	margin-bottom: 15px

.mainMenu
	height: 45px
	position: relative
	padding: 0px
	background-color: $main-color
	border-top: 1px solid $twitch-panel-color
	border-right: 1px solid $twitch-panel-color
	border-left: 1px solid $twitch-panel-color
	border-radius: 5px 5px 0px 0px
	
.menu-btn
	font-family: Gugi
	font-weight: bold
	padding: 10px 24px
	margin: 0px
	color: $twitch-panel-color
	background-color: $main-color
	border-right: 1px solid $twitch-panel-color
	position: relative
	list-style-type: none
	display: inline-block
	&:first-child
		padding-right: 25px
	&:last-child
		border: none
	&:hover
		cursor: pointer

.active
	&:after,&:before
		top: 100%
		left: 50%
		border: solid transparent
		content: " "
		height: 0
		width: 0
		position: absolute
		pointer-events: none
	&:after
		border-top-color: $main-color
		border-width: 10px
		margin-left: -10px
		z-index: 10

.twitch-streams
	padding: 10px 0px
	border-bottom: 2px solid $twitch-panel-shadow
	&:last-child
		border: none

.title
	font-size: 3.5em
	font-family: Gugi
	color: $twitch-panel-color
	text-shadow: 3px 5px $twitch-panel-shadow
	padding-bottom: 15px

#name,
#name a
	color: $main-color
	font-family: Gugi

#name a:hover,
#name a:focus
	color: $purple
	font-family: Gugi

#streaming
	font-family: 'Cantarell', sans-serif
	font-size: .8em
	color: $purple

.logo
	width: 100%
	height: auto
	border: 1px solid $purple
	border-radius: 50%

.reset-margin
	margin: 0px
.reset-padding
	padding: 0px
.hidden
	display: none
              
            
!

JS

              
                var streamers = ["freecodecamp", "GeoffStorbeck", "terakilobyte", "habathcx","notmichaelmcdonald","RobotCaleb","medrybw","comster404","brunofin","thomasballinger","joe_at_underflow","noobs2ninjas","mdwasp","beohoff","xenocomagain"];
var apiURL = "https://wind-bow.glitch.me/twitch-api/";

function getTwitch(){
	streamers.forEach(function(channels){
		
		function makeURL(type, name) {
      return apiURL + type + '/' + name + '?callback=?';
    };
		
		$.getJSON(makeURL("streams", channels), function(data){
			var game,status;
			
			if(data.stream === null){
				game = "Offline";
        status = "offline";
			}else if(data.stream === undefined){
				game = "Account Closed";
        status = "offline";
			}else{
				game = data.stream.game;
        status = "online";
			}
			
		$.getJSON(makeURL("channels",channels),function(data){
			var logo,name,description;
			
			if(data.logo != null)
				logo = data.logo;
			else
				logo = "https://dummyimage.com/50x50/ecf0e7/5c5457.jpg&text=0x3F";

			var name = data.display_name != null ? data.display_name : channels;
      var description = status === "online" ? ': ' + data.status : "";
				
				var html = '<div class="row twitch-streams reset-margin ' + 
          status + '">' + 
				'<div class="col-2" id="icon">'+
						'<img src="' + logo + '" class="logo"></div>'+
						'<div class="col-10 text-center reset-padding" id="name">'+
							'<a href="' +  data.url + '" target="_blank">' + name + '</a>'+ 							'<div class="text-center reset-padding" id="streaming">'+ 
          		game + '<span class="">' + 
          		description + '</span></div>'+
						'</div>'+
					'</div>';
        status === "online" ? $(".twitch-list").prepend(html) : $(".twitch-list").append(html);
			})
		});
	});
};

$(document).ready(function(){
	getTwitch();
	
	$(".menu-btn").click(function(){
		$(".menu-btn").removeClass("active");
    $(this).addClass("active");
		var status = $(this).attr('id');
		
    if (status === "all") {
      $(".online, .offline").removeClass("hidden");
    } else if (status === "online") {
      $(".online").removeClass("hidden");
      $(".offline").addClass("hidden");
    } else {
      $(".offline").removeClass("hidden");
      $(".online").addClass("hidden");
    }
	});
});
              
            
!
999px

Console