Your Favorite Twitch App
How do I make an your favorite twitch app?
This application lets you add and keep track of your favorite twitch streamers. Know if they are online, offline, and what game they are playing. . What is a your favorite twitch app? How do you make a your favorite twitch app? This script and codes were developed by Vinny on 15 October 2022, Saturday.
Your Favorite Twitch App - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Your Favorite Twitch App</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<div class="containter"> <div class="row lg-margin"> <div class="col-md-4 col-md-offset-1"> <div class="tabs"> <ul class="top-tabs"> <li id="all">All</li> <li id="online">Online</li> <li id="offline" style="border-right: none;">Offline</li> </ul> <div class="clear"></div> </div> <div class="main-feed text-center"> <div class="input-group center-block"> <input type="text" class="search form-control input-sm"> <button class="btn btn-default search-btn">Search</button> </div> </div> <div class="feed"> </div> </div> <!--end col--> <div class="col-md-5 col-md-offset-1 margin-bottom"> <div class="main-image"> <img class="img-responsive" src="http://ggsoku.com/wp-content/uploads/f5fb91f882ecfa5f46a2859fc211f167.jpeg" /> </div> <p class="lead">Welcome to my application! This app allows you to keep track of your favorite twitch streamers. Enjoy :)</p> <label for="streamer">Add a Streamer:</label> <input class="streamer-name form-control input-sm" type="text" name="streamer"> <div id="add-delete-btns"> <div id="add-stream" class="list-button">Add</div> </div> <!--end add delete buttons divs--> <div class="error"></div> </div> <!--end col--> </div> <!--end row --> <div class="row"> <footer> <p class="pull-left">Made by Vinny ©</p> <div class="social-media pull-right"> <a href="https://www.facebook.com/vinny.aceto" target="_blank"><span class="media-icon fa fa-facebook-square"></span></a> <a href="https://twitter.com/vinaceto" target="_blank"><span class="media-icon fa fa-twitter-square"></span></a> <a href="https://www.linkedin.com/in/vinaceto" target="_blank"><span class="media-icon fa fa-linkedin-square"></span</a> </div> </footer> </div> <!--endfooter row-->
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Your Favorite Twitch App - Script Codes CSS Codes
body { background-color: #6441A5; color: white; font-family: 'Montserrat'Arial, verdana, sans-serif;
}
.margin-bottom { margin-bottom: 15%;
}
.test { background-color: #09c61c;
}
.lg-margin { margin-top: 3%;
}
.main-feed { width: 100%; height: 5em; padding-left: 1.5em; padding-right: 1.5em; background-color: white;
}
.top-tabs { background-color: white; list-style-type: none; margin: 0 auto; padding-left:.3em; padding-right:.3em; border: 1px solid white;
}
.top-tabs li { background-color: #794ec9; display: inline-block; margin-top:.3em; width: 32%; text-align: center; padding-top: 1.8em; padding-bottom: 1.8em;
}
.top-tabs:last-child{ padding-right: 0px !important;
}
.top-tabs li:hover { background-color: #9F60B4; font-weight: bold; cursor: pointer;
}
.clear { clear: both;
}
.input-group { position: relative; top: 1.4em;
}
.search { box-shadow: 4px 5px 5px #888888; width: 70% !important;
}
.search-btn { box-shadow: 4px 5px 5px #888888; display:inline;
}
.feed { width: 100%; max-height: 500px; overflow: auto; border-top: 1px solid #8E8E8E; background-color: white; padding-bottom: 1em;
}
.item { width: 100%; text-align: center; margin-top: 1.5em; background-color: green;
}
.icon { height: 20%; border-radius: 100px; width: 20%; float: left; margin-left: 2em; margin-right: 1.1em;
}
.title { font-size: 1.2em; font-weight: bold; color: black; float: left; position: relative; top: 1.2em;
}
.online { color: #10CE06; animation: glow .5s infinite alternate;
}
@keyframes glow { to { text-shadow: 0 0 12px green; }
}
.offline { color: red;
}
.stat { height: 20px; width: 50px; border-radius: 100px; float: right; position: relative; top: 1.6em;
}
#add-delete-btns { margin-top: 2%;
}
.list-button { margin-top: 2%; padding: 10px; border: 1px solid white; display: inline-block; border-radius: 2px;
}
.list-button:hover{ background-color: #9F60B4; cursor: pointer;
}
#delete-stream { margin-left: 2%;
}
footer { background-color: #432C6D; height: 10em; width: 100%; margin-top: 10%; position: relative; top: 100%;
}
footer p { margin-left: 5%; margin-top: 5%;
}
footer div { margin-right: 5%; margin-top: 5%;
}
.media-icon { padding-left: 1em; padding-right: 1em; font-size: 2em;
}
footer a { color: white;
}
footer a:hover { font-size: 1.6em; color: white;
}
.game { color: black !important; font-size: .5em;
}
.error { display: none; border: 1px solid red; border-radius: 2px; padding: 2%; background-color: #F79B9B; color: red; margin-top: 2%;
}
Your Favorite Twitch App - Script Codes JS Codes
$(document).ready(function() { var users = ["freecodecamp", "Sabre_AP", "MissMiaRose", "prawnn", "itshafu", "MissPetrai", "cchristiee", "middleditch", "MedryBW", "s1mpleof", "rxysurfchic", "lucyyfurr", "tsm_theoddone", "kaceytron", "trick2g"]; var twitchUrl = "https://api.twitch.tv/kraken/"; var tracker = 0; function addToMenu(u, t, orderId, g) { if (u === null) { $(".feed").prepend("<a href='www.twitch.tv/" + t + "/profile' target='_blank'><div id='d" + orderId.toString() + "' class='item'><img class='icon' src='https://images.duckduckgo.com/iu/?u=http%3A%2F%2Fhydra-media.cursecdn.com%2Fguildwiki.gamepedia.com%2Fthumb%2Fa%2Fac%2FNo_image_available.svg%2F512px-No_image_available.svg.png%3Fversion%3Dda06fddcdd06470a79a998b6e7be11fc&f=1'><span class='title'>" + t + "<br/><span class='game'></span></span></div><div class='clear'></div></a>"); return; } $(".feed").prepend("<a href='https://www.twitch.tv/" + t + "' target='_blank'><div id='d" + orderId.toString() + "' class='item'><img class='icon' src='" + u + "'><span class='title'>" + t + "<br/><span class='game'></span></span></div><div class='clear'></div></a>"); return; } //function to append online/offline icon to widget{ function addStatus(s, i, orderId, g) { console.log(g); var ordered = "#d" + orderId.toString(); $(ordered).append("<span class='stat " + s + " fa fa-" + i + "'></span>"); if (g !== undefined) { $(ordered + ' .game').text(g); } return; } //function to check if online pr not function online(user, orderId) { $.get(twitchUrl + "streams/" + user, function(info) { var status = info.stream; var onOff; var faIcon; if (status === null) { onOff = "offline"; faIcon = "close"; addStatus(onOff, faIcon, orderId); return; } else { var activity = info.stream.game; onOff = "online"; faIcon = "user"; addStatus(onOff, faIcon, orderId, activity); return; } }, "jsonp"); // end get function } //end online function //get info from API function getInfo(user, orderId) { $.get(twitchUrl + "users/" + user, function(data) { var userIcon = data.logo; var userTitle = data.name; if(userTitle == undefined){ $('.error').text('* Twitch user not found!').css('display','block').fadeOut(3000); return -1; } console.log(data.name); addToMenu(userIcon, userTitle, orderId); online(user, orderId); return; }, "jsonp"); } //loop through the array of usernames to add them to the twitch widget for (var i = 0; i < users.length; ++i) { var twitchUsers = getInfo(users[i], i); if(twitchUsers === -1){tracker = i-1;i-=1}else{ tracker = i; } } //online click button $("#online").click(function() { console.log('clicked'); $('.stat.offline').parent().css("display", "none"); $(".stat.online").parent().css("display", "block"); }); //offline click button $("#offline").click(function() { $('.stat.online').parent().css("display", "none"); $(".stat.offline").parent().css("display", "block"); }); //all click button $("#all").click(function() { $(".stat.online").parent().css("display", "block"); $(".stat.offline").parent().css("display", "block"); }); //search button $('.search-btn').click(function() { var userValue = $(".search").val().toString(); if (userValue === "") { return; } $(".stat").parent().css("display", "none"); $("span:contains('" + userValue + "')").parent().css('display', 'block'); }); //add button $("#add-stream").click(function(){ console.log("add clicked"); tracker += 1; var streamerName = $(".streamer-name").val(); if(streamerName === ""){ $('.error').text('* You did not enter a name!').css('display','block').fadeOut(3000); return; } getInfo(streamerName,tracker); });
}); //end document ready
Developer | Vinny |
Username | vinnyA3 |
Uploaded | October 15, 2022 |
Rating | 3 |
Size | 4,754 Kb |
Views | 20,240 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Growing Image Blocks | 1,899 Kb |
CSS Binary Sunset on Tatooine | 4,350 Kb |
Svg-play | 2,641 Kb |
Dragon Ball in Pure CSS | 3,721 Kb |
Movie Card | 3,986 Kb |
CSS Animations and Effects | 5,637 Kb |
Pure CSS Image Slider | 3,288 Kb |
Batman Emblem in Pure CSS - chrome tested only | 3,781 Kb |
Tic Tac Toe Bro | 3,332 Kb |
Rotating CSS Cube | 3,724 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Smoke Shader - Frame Buffer | Omarshe7ta | 2,672 Kb |
Importable Clearfix | Corysimmons | 1,411 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Button Option Group | Honchoman | 1,859 Kb |
JQuery AJAX reddit Exercise | Btholt | 1,777 Kb |
Awesome | Samarthpd | 2,901 Kb |
Sinclair Research Computers | MattCowley | 3,068 Kb |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
HexMaze | Cantelope | 4,825 Kb |
Degree Picker | Idered | 4,307 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!