2016-11-14 17:42:07 +00:00
$ ( window ) . on ( 'load' , function ( ) { // makes sure the whole site is loaded
$ ( '#loading' ) . fadeOut ( ) ; // will first fade out the loading animation
$ ( '#load_screen' ) . delay ( 350 ) . fadeOut ( 'slow' ) ; // will fade out the white DIV that covers the website.
$ ( 'body' ) . delay ( 350 ) . css ( { 'overflow' : 'visible' } ) ;
} )
$ ( document ) . ready ( function ( ) {
$ ( ".skip" ) . click ( function ( ) {
$ ( '#loading' ) . fadeOut ( ) ; // will first fade out the loading animation
$ ( '#load_screen' ) . delay ( 350 ) . fadeOut ( 'slow' ) ; // will fade out the white DIV that covers the website.
$ ( 'body' ) . delay ( 350 ) . css ( { 'overflow' : 'visible' } ) ;
} ) ;
2016-10-24 12:52:27 +00:00
} ) ;
2016-08-26 17:01:25 +00:00
$ ( document ) . ready ( function ( ) {
2016-09-18 21:07:04 +00:00
$ ( ".button-collapse" ) . sideNav ( {
closeOnClick : true
} ) ;
$ ( '.modal-trigger' ) . leanModal ( ) ;
$ ( '.tooltipped' ) . tooltip ( {
delay : 50
} ) ;
2016-08-26 17:01:25 +00:00
var interval = 15000 ;
var autoRefresh = setTimeout ( function ( ) {
refresh ( ) ;
} ,
interval ) ;
2016-09-18 21:07:04 +00:00
var refresh = function ( ) {
2017-01-02 17:22:45 +00:00
$ . getJSON ( "https://mcapi.ca/query/play.totalfreedom.me:28965/extensive" , function ( json ) {
if ( json . status !== true ) {
$ ( "#online" ) . html ( '<span style="color: firebrick; font-weight: bolder;"> Server is Offline</span><br/><small style="font-size: .5em;">Check out our <a href="status">Associated Servers</a>!</small>' ) ;
2016-08-26 17:01:25 +00:00
$ ( ".button" ) . hide ( ) ;
} else {
2016-11-14 17:42:07 +00:00
$ ( "#online" ) . html ( 'TotalFreedom has <font color="green">' + json . players . online + '</font> players online!<br/>' ) ;
2016-09-18 21:07:04 +00:00
$ ( "#players-online" ) . html ( json . players . online + ' online players!' ) ;
2016-08-26 17:01:25 +00:00
$ ( '.button' ) . show ( ) ;
}
} ) ;
autoRefresh ;
}
refresh ( ) ;
} ) ;
2017-01-02 17:22:45 +00:00
2016-11-20 10:02:37 +00:00
$ ( document ) . ready ( function ( ) {
2016-12-29 16:50:14 +00:00
$ ( '.brand-logo' ) . typed ( {
strings : [ '<small class="hide-on-med-and-down">play.</small>TotalFreedom<small class="hide-on-med-and-down">.me</small>' ] ,
typeSpeed : 30
} ) ;
2017-01-02 17:22:45 +00:00
} ) ;
2016-12-29 16:50:14 +00:00
2017-01-02 17:22:45 +00:00
$ ( document ) . ready ( function ( ) {
2016-11-20 10:02:37 +00:00
( new Date ) . getFullYear ( ) ;
$ ( "#curYear" ) . text ( ( new Date ) . getFullYear ( ) )
} ) ;
$ ( document ) . ready ( function ( ) {
( new Date ) . getFullYear ( ) ;
$ ( "#curYear" ) . text ( ( new Date ) . getFullYear ( ) ) ;
} ) ;
$ ( document ) . ready ( function ( ) {
$ ( ".one" ) . click ( function ( ) {
$ ( ".a" ) . fadeToggle ( 300 ) ;
$ ( ".one i" ) . toggleClass ( "fa-chevron-right" , 1e3 ) ;
$ ( ".one i" ) . toggleClass ( "fa-chevron-down" , 1e3 )
} ) ;
$ ( ".two" ) . click ( function ( ) {
$ ( ".b" ) . fadeToggle ( 300 ) ;
$ ( ".two i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".two i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".three" ) . click ( function ( ) {
$ ( ".c" ) . fadeToggle ( 300 ) ;
$ ( ".three i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".three i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".four" ) . click ( function ( ) {
$ ( ".d" ) . fadeToggle ( 300 ) ;
$ ( ".four i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".four i" ) . toggleClass ( "fa-chevron-down" )
} ) ;
$ ( ".five" ) . click ( function ( ) {
$ ( ".e" ) . fadeToggle ( 300 ) ;
$ ( ".five i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".five i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".six" ) . click ( function ( ) {
$ ( ".f" ) . fadeToggle ( 300 ) ;
$ ( ".six i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".six i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".seven" ) . click ( function ( ) {
$ ( ".g" ) . fadeToggle ( 300 ) ;
$ ( ".seven i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".seven i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".eight" ) . click ( function ( ) {
$ ( ".h" ) . fadeToggle ( 300 ) ;
$ ( ".eight i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".eight i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
$ ( ".nine" ) . click ( function ( ) {
$ ( ".i" ) . fadeToggle ( 300 ) ;
$ ( ".nine i" ) . toggleClass ( "fa-chevron-right" ) ;
$ ( ".nine i" ) . toggleClass ( "fa-chevron-down" ) ;
} ) ;
2016-12-30 09:25:23 +00:00
} ) ;
2017-01-02 17:22:45 +00:00
$ ( document ) . ready ( function ( ) {
2016-12-30 09:25:23 +00:00
$ ( "#top" ) . click ( function ( ) {
$ ( 'html, body' ) . animate ( {
scrollTop : $ ( "html, body" ) . offset ( ) . top
} , 1000 ) ;
} ) ;
$ ( "#rules" ) . click ( function ( ) {
$ ( 'html, body' ) . animate ( {
scrollTop : $ ( "#rules-sec" ) . offset ( ) . top
} , 1000 ) ;
} ) ;
$ ( "#staff" ) . click ( function ( ) {
$ ( 'html, body' ) . animate ( {
scrollTop : $ ( "#staff-sec" ) . offset ( ) . top
} , 1000 ) ;
} ) ;
$ ( "#brand-top" ) . click ( function ( ) {
$ ( 'html, body' ) . animate ( {
scrollTop : $ ( "html, body" ) . offset ( ) . top
} , 1000 ) ;
} ) ;
} ) ;