Skip to content

Instantly share code, notes, and snippets.

@csuszka
Created Apr 15, 2018
Embed
What would you like to do?
rdRYmz
<!-- <div class = "freecodecamp"><a href="https://www.twitch.tv/freecodecamp"
<H2><i class="fab fa-twitch fa-1x"></i> freeCodeCamp </H2>
<p>
</p></a>
</div> -->
<div class = "csuszka"><a href="https://www.twitch.tv/csuszka"
<H2><i class="fab fa-twitch fa-1x"></i> csuszka </H2>
<p>
</p></a>
</div>
$(document).ready(function() {
$.ajax("https://wind-bow.glitch.me/twitch-api/streams/csuszka", {
type: "GET",
dataType: "json",
data: {
origin: "*"
},
success: function(searchResult) {
if (searchResult.stream !== null) {
$(".csuszka").children().css('color', 'green');
} else $(".csuszka").children().css('color', 'gray');
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
H2{
}
i{
color: gray;
}
a {
text-decoration: none;
outline: none;
font-size: 50px;
}
a:link {
color: black;
}
a:visited {
color: black;
}
a:focus {
border-bottom: 2px solid;
color: black;
}
a:hover {
color: black;
text-decoration: none;
}
a:active {
color: black;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment