mirror of
https://github.com/TotalFreedomMC/Website.git
synced 2024-12-22 16:25:12 +00:00
Side Menu Closing on Click. Fixes #38
This commit is contained in:
parent
f3b855b6d0
commit
7b046e7aca
1 changed files with 45 additions and 41 deletions
84
js/main.js
84
js/main.js
|
@ -1,7 +1,11 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(".button-collapse").sideNav();
|
$(".button-collapse").sideNav({
|
||||||
$('.modal-trigger').leanModal();
|
closeOnClick: true
|
||||||
$('.tooltipped').tooltip({delay: 50});
|
});
|
||||||
|
$('.modal-trigger').leanModal();
|
||||||
|
$('.tooltipped').tooltip({
|
||||||
|
delay: 50
|
||||||
|
});
|
||||||
|
|
||||||
var interval = 15000;
|
var interval = 15000;
|
||||||
var autoRefresh = setTimeout(function() {
|
var autoRefresh = setTimeout(function() {
|
||||||
|
@ -9,14 +13,14 @@ $(document).ready(function() {
|
||||||
},
|
},
|
||||||
interval);
|
interval);
|
||||||
|
|
||||||
var refresh = function() {
|
var refresh = function() {
|
||||||
$.getJSON("http://us.mc-api.net/v3/server/info/play.totalfreedom.me:28965", function(json) {
|
$.getJSON("http://us.mc-api.net/v3/server/info/play.totalfreedom.me:28965", function(json) {
|
||||||
if (json.online !== true) {
|
if (json.online !== true) {
|
||||||
$("#online").html('<span style="color: firebrick; font-weight: bolder;"> Server is Offline</span>');
|
$("#online").html('<span style="color: firebrick; font-weight: bolder;"> Server is Offline</span>');
|
||||||
$(".button").hide();
|
$(".button").hide();
|
||||||
} else {
|
} else {
|
||||||
$("#online").html('TotalFreedom has <font color="green">' + json.players.online + '</font> players online!');
|
$("#online").html('TotalFreedom has <font color="green">' + json.players.online + '</font> players online!');
|
||||||
$("#players-online").html(json.players.online + ' online players!');
|
$("#players-online").html(json.players.online + ' online players!');
|
||||||
$('.button').show();
|
$('.button').show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -26,50 +30,50 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var currentYear = (new Date).getFullYear();
|
var currentYear = (new Date).getFullYear();
|
||||||
|
|
||||||
$("#curYear").text((new Date).getFullYear());
|
$("#curYear").text((new Date).getFullYear());
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.one').click(function() {
|
$('.one').click(function() {
|
||||||
$('.a').fadeToggle("slow");
|
$('.a').fadeToggle("slow");
|
||||||
$(".one i").toggleClass('fa-chevron-right', 1000);
|
$(".one i").toggleClass('fa-chevron-right', 1000);
|
||||||
$(".one i").toggleClass('fa-chevron-down', 1000);
|
$(".one i").toggleClass('fa-chevron-down', 1000);
|
||||||
});
|
});
|
||||||
$('.two').click(function() {
|
$('.two').click(function() {
|
||||||
$('.b').fadeToggle("slow");
|
$('.b').fadeToggle("slow");
|
||||||
$(".two i").toggleClass('fa-chevron-right');
|
$(".two i").toggleClass('fa-chevron-right');
|
||||||
$(".two i").toggleClass('fa-chevron-down');
|
$(".two i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.three').click(function() {
|
$('.three').click(function() {
|
||||||
$('.c').fadeToggle("slow");
|
$('.c').fadeToggle("slow");
|
||||||
$(".three i").toggleClass('fa-chevron-right');
|
$(".three i").toggleClass('fa-chevron-right');
|
||||||
$(".three i").toggleClass('fa-chevron-down');
|
$(".three i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.four').click(function() {
|
$('.four').click(function() {
|
||||||
$('.d').fadeToggle("slow");
|
$('.d').fadeToggle("slow");
|
||||||
$(".four i").toggleClass('fa-chevron-right');
|
$(".four i").toggleClass('fa-chevron-right');
|
||||||
$(".four i").toggleClass('fa-chevron-down');
|
$(".four i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.five').click(function() {
|
$('.five').click(function() {
|
||||||
$('.e').fadeToggle("slow");
|
$('.e').fadeToggle("slow");
|
||||||
$(".five i").toggleClass('fa-chevron-right');
|
$(".five i").toggleClass('fa-chevron-right');
|
||||||
$(".five i").toggleClass('fa-chevron-down');
|
$(".five i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.six').click(function() {
|
$('.six').click(function() {
|
||||||
$('.f').fadeToggle("slow");
|
$('.f').fadeToggle("slow");
|
||||||
$(".six i").toggleClass('fa-chevron-right');
|
$(".six i").toggleClass('fa-chevron-right');
|
||||||
$(".six i").toggleClass('fa-chevron-down');
|
$(".six i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.seven').click(function() {
|
$('.seven').click(function() {
|
||||||
$('.g').fadeToggle("slow");
|
$('.g').fadeToggle("slow");
|
||||||
$(".seven i").toggleClass('fa-chevron-right');
|
$(".seven i").toggleClass('fa-chevron-right');
|
||||||
$(".seven i").toggleClass('fa-chevron-down');
|
$(".seven i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
$('.eight').click(function() {
|
$('.eight').click(function() {
|
||||||
$('.h').fadeToggle("slow");
|
$('.h').fadeToggle("slow");
|
||||||
$(".eight i").toggleClass('fa-chevron-right');
|
$(".eight i").toggleClass('fa-chevron-right');
|
||||||
$(".eight i").toggleClass('fa-chevron-down');
|
$(".eight i").toggleClass('fa-chevron-down');
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in a new issue