cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="container-fluid" ng-app="AppTwitch">
			<img src="http://www.vincent-humeau.com/content/twitch/logo.png" class="img-fluid" id="logo"/>
			<div class="twitch-app--container">
				<div class="twitch-app--container--btn-status row">
					<div class="col-4">
						<button class="btn col-12 twitch-app--container--btn-status__active" id="btn-all">All</button>
					</div>
					<div class="col-4">
						<button class="btn col-12" id="btn-online">Online</button>
					</div>
					<div class="col-4">
						<button class="btn col-12" id="btn-offline">Offline</button>
					</div>
				</div>
				<div class="twitch-app--container--search">
					<div class="input-group">
						<input type="text" class="form-control" placeholder="Search" ng-model="searchChannel">
						<span class="input-group-btn">
							<button class="btn" type="button"><i class="fa fa-search" aria-hidden="true"></i></button>
						</span>
					</div>
				</div>
				<div ng-controller="mainController">
					<div ng-repeat="card in loopCards  | filter:searchChannel">
						<div class="twitch-app--container--coders-cards {{ card.filter }}">
							<a ng-href="{{ card.url }}" target="_blank" class="row">
								<div class="col-3 twitch-app--container--coders-cards--img-container">
									<img ng-src="{{ card.logo }}" class="img-fluid twitch-app--container--coders-cards--thumbnail"/>
								</div>
								<div class="col-9 twitch-app--container--coders-cards--content-container">
									<p class="user-name">{{ card.displayName }}<span class="status {{ card.status }}" ng-class=""><i class="fa fa-twitch" aria-hidden="true"></i></span></p>
									<p class="description">{{ card.description }}</p>
									<p class="stats"><i class="fa fa-heart" aria-hidden="true"></i> {{ card.followers }}
									<i class="fa fa-eye" aria-hidden="true"></i> {{ card.views }}</p>
								</div>
							</a>
						</div>
					</div>
				</div>
				
			</div>
		</div>
            
          
!
            
              $purple: #65439E;
$purple-light: #D7CFE6;
$yellow: #FFC455;
$green: #6EB084;
$red: #FD5948;
$white: #FFF;
$black: #000;
$grey: #606060;

$break-big: 720px;

//Mixin
@mixin transition($arg) {
	-webkit-transition: $arg; /* Safari */
	transition: all $arg;
	transition-timing-function: ease-in-out;
}
@mixin aspect-ratio($width, $height) {
	position: relative;
	display: block;
	height: 0;
	padding-bottom: ($height / $width) * 100%;
	overflow: hidden;
}
@mixin placeholer-color($pColor) {
	::-webkit-input-placeholder { /* WebKit, Blink, Edge */
		color: $pColor;
	}
	:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
		color: $pColor;
		opacity:  1;
	}
	::-moz-placeholder { /* Mozilla Firefox 19+ */
		color: $pColor;
		opacity:  1;
	}
	:-ms-input-placeholder { /* Internet Explorer 10-11 */
		color: $pColor;
	}
}

.clear-float{
	clear: both;
}
.bold-text{
	font-weight: bold;
}
.vcenter {
	display: inline-block;
	vertical-align: middle;
	float: none;
}
.capitalize{
	text-transform: capitalize;
}
input:focus,select:focus,textarea:focus,button:focus {
	outline: none;
}
body{
	background-color: $purple;

}
.container-fluid{
	max-width: 715px;
	margin: 0 auto;
	padding: 50px 0;
	@media screen and (max-width: $break-big) {
		margin: 0 5%;
	}
}
#logo{
	margin: 0 auto;
	display: block;
}
.twitch-app--container{
	background-color: $white;
	box-shadow: 10px 15px 75px rgba(0, 0, 0, 0.7);
	padding: 50px;
	padding-bottom: 25px;
	margin-top: 50px;
	@media screen and (max-width: $break-big) {
		padding: 10px;
		padding-bottom: 10px;
	}
	.twitch-app--container--btn-status{
		margin-bottom: 25px;
		@media screen and (max-width: $break-big) {
			margin-bottom: 10px;
		}
		.btn{
			border-radius: 0;
			background-color: $purple;
			color: $white;
			size: 1.2em;
			padding: 12px 0;
			&:hover{
				color: $white;
				box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.4);
			}
		}
		.twitch-app--container--btn-status__active{
			background-color: $purple-light;
			color: $purple;
			&:hover{
				color: $purple;
				box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
			}
		}

	}
	.twitch-app--container--search{
		margin-bottom: 50px;
		@media screen and (max-width: $break-big) {
			margin-bottom: 20px;
		}
		@include placeholer-color($purple);
		input{
			background-color: $purple-light;
			border: 0;
			border-radius: 0;
			box-shadow: none;
			color: $purple;
			&:hover, &:focus{
				color: $purple;
				box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.4);
			}
		}

		.btn{
			border-radius: 0;
			background-color: $purple;
			color: $white;
			size: 1.2em;
		}
	}
	.twitch-app--container--coders-cards{
		padding: 10px;
		margin-bottom: 25px;
		@media screen and (max-width: $break-big) {
			padding: 5px;
			margin-bottom: 5px;
		}
		@include transition(all 0.5s);
		a:hover, a:focus, a:visited, a:active, a{
			text-decoration: none !important;
		}
		&:hover{
			box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.7);
		}
		.twitch-app--container--coders-cards--img-container{
			padding-left: 15px;
			@media screen and (max-width: $break-big) {
				padding-top: 15px;
        padding-bottom: 15px;
			}
		}
		p{
			margin-bottom: 0;
			color: $grey;
		}
		.user-name{
			font-size: 1.8em;
			margin-bottom: 10px;
			color: $purple;
			.status{
				margin-left: 10px;
			}
			.active{
				color: $green;
			}
			.no-active{
				color: $red;
			}
			.no-found{
				color: $purple;
			}
		}
		.description{
			margin-bottom: 15px;
		}
		.stats{
			.fa{
				color: $purple;
				margin-right: 5px;
			}
			.fa-eye{
				margin-left: 20px;
			}
		}
	}
}
            
          
!
            
              var app = angular.module('AppTwitch', []);

app.controller('mainController', function($scope, $http) {

  $scope.channels = ["freecodecamp", "sssmcgrath", "JessicaMak", "Adam13531", "iDevelopThings","JHobz296", "VladimirYuldashev", "Serpent_AI", "Preyahtno", "EkoJR", "P1llus", "SixDegreesOfGaming", "BensHobbies", "Scorpion_SK", "f_artletsfart", "iloveCode", "TheJordach", "ca2live", "Jaskowicz", "kdo_92", "Bamboy360", "Greenie996", "VoxelV", "player_dbr", "TheGoodIdeaCo", "WindPoweredGames", "Hunter_Reborn", "WobblyTrout", "XRA_", "dndn1011", "SoulFoam", "GalacticGlum", "Mahyar121", "AlerDenisov", "joshuaskelly", "cksdhlkz", "Supercoder", "EvilFreelancer", "Neticulis", "Golgothus", "FailedSleep", "VladStarkovsky", "PavanKataria", "4f3c5", "oddvacado_was_taken", "Kayvak", "ca2live"];

  var linkStreams = 'https://wind-bow.glitch.me/twitch-api/streams/';
  var linkChannels = 'https://wind-bow.glitch.me/twitch-api/channels/';
  var callback = '?callback=';

  function getStream() {
    $scope.loopCards = [];
    angular.forEach($scope.channels, function(channelName) {
      $http.get(linkStreams + channelName + callback).then(function(dataStream){
        if (dataStream.data.stream == null) {
          $http.get(linkChannels + channelName + callback).then(function (dataChannel){
              if (dataChannel.data.status === 404){
                $scope.loopCards.push({
                  displayName: channelName,
                  logo: 'http://www.vincent-humeau.com/content/twitch/404.jpg',
                  status: 'no-found',
                  views: '?',
                  followers: '?',
                  url: '#',
                  description: 'User not found',
				  filter: 'filter-not-found',
                });
              }
              else{
                $scope.loopCards.push({
                  displayName: dataChannel.data.display_name,
                  logo:  dataChannel.data.logo,
                  status: 'no-active',
                  views: dataChannel.data.views,
                  followers: dataChannel.data.followers,
                  url: dataChannel.data.url,
                  description: 'Offline',
				  filter: 'filter-offline',
                });
              }
            });
          }
          else{
            $scope.loopCards.push({
              displayName: dataStream.data.stream.channel.display_name,
              logo: dataStream.data.stream.channel.logo,
              status: 'active',
              views: dataStream.data.stream.channel.views,
              followers: dataStream.data.stream.channel.followers,
              url: dataStream.data.stream.channel.url,
              description: dataStream.data.stream.channel.status,
			  filter: 'filter-online',
            });
          }
      });
    });
  };
  getStream();
});

var jQuery = jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery('#btn-all').click(function(){
		jQuery('.filter-offline').show("slow");
		jQuery('.filter-not-found').show("slow");
		jQuery('.filter-online').show("slow");
		jQuery('.twitch-app--container--btn-status__active').removeClass('twitch-app--container--btn-status__active');
		jQuery(this).addClass('twitch-app--container--btn-status__active');
	});
	jQuery('#btn-online').click(function(){
		jQuery('.filter-offline').hide("slow");
		jQuery('.filter-not-found').hide("slow");
		jQuery('.filter-online').show("slow");
		jQuery('.twitch-app--container--btn-status__active').removeClass('twitch-app--container--btn-status__active');
		jQuery(this).addClass('twitch-app--container--btn-status__active');
	});
	jQuery('#btn-offline').click(function(){
		jQuery('.filter-offline').show("slow");
		jQuery('.filter-not-found').hide("slow");
		jQuery('.filter-online').hide("slow");
		jQuery('.twitch-app--container--btn-status__active').removeClass('twitch-app--container--btn-status__active');
		jQuery(this).addClass('twitch-app--container--btn-status__active');
	});
});
            
          
!
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.
Loading ..................

Console