Allen850413 (Talk | contribs) |
Allen850413 (Talk | contribs) |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | <script> | ||
+ | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | |||
+ | $(document).ready(function() { | ||
+ | |||
+ | $("#HQ_page").attr('id',''); | ||
+ | |||
+ | |||
+ | //highlight current page on the menu | ||
+ | highlight_current_page_menu(); | ||
+ | |||
+ | //accessing submenus | ||
+ | $(".menu_item").click(function(){ | ||
+ | $(".submenu_control_icon", this).toggleClass("open"); | ||
+ | $(this).next(".submenu").fadeToggle(400); | ||
+ | }); | ||
+ | |||
+ | //mobile menu access | ||
+ | $(".igem_2018_team_mobile_bar").click(function(){ | ||
+ | $(this).next().toggleClass("displaying_menu"); | ||
+ | }); | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | function highlight_current_page_menu() { | ||
+ | |||
+ | var page_url="https://2018.igem.org/"; | ||
+ | page_url = page_url + wgPageName; | ||
+ | $("a[href$='"+ page_url +"']").children().addClass("current_page"); | ||
+ | |||
+ | //if the page is in a submenu, open the submenu and make the appropiate changes | ||
+ | if( $( ".current_page" ).hasClass( "submenu_item" )){ | ||
+ | |||
+ | $(".current_page").parent().parent().fadeToggle(400); | ||
+ | $(".current_page").parent().parent().prev().addClass("current_page"); | ||
+ | $(".menu_item.current_page > .submenu_control_icon").toggleClass("open"); | ||
+ | |||
+ | } | ||
+ | } | ||
+ | $(window).on('scroll',function() { | ||
+ | if($(window).scrollTop()) | ||
+ | { | ||
+ | $('.container').css('background', '#808080'); | ||
+ | $('nav ul li ul').css('background', '#808080'); | ||
+ | $('nav').css('opacity','1'); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | $('.container').css('background', '#000000'); | ||
+ | $('nav ul li ul').css('background', '#000000'); | ||
+ | $('nav').css('opacity','1'); | ||
+ | } | ||
+ | }); | ||
+ | // When the user scrolls the page, execute myFunction | ||
+ | window.onscroll = function() {myFunction()}; | ||
+ | |||
+ | function myFunction() { | ||
+ | var winScroll = document.body.scrollTop || document.documentElement.scrollTop; | ||
+ | var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; | ||
+ | var scrolled = (winScroll / height) * 100; | ||
+ | document.getElementById("myBar").style.height = scrolled + "%"; | ||
+ | } | ||
+ | |||
+ | $(document).ready(function(){ | ||
+ | // Add smooth scrolling to all links | ||
+ | $("a").on('click', function(event) { | ||
+ | |||
+ | // Make sure this.hash has a value before overriding default behavior | ||
+ | if (this.hash !== "") { | ||
+ | // Prevent default anchor click behavior | ||
+ | event.preventDefault(); | ||
+ | |||
+ | // Store hash | ||
+ | var hash = this.hash; | ||
+ | |||
+ | // Using jQuery's animate() method to add smooth page scroll | ||
+ | // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $(hash).offset().top | ||
+ | }, 800, function(){ | ||
+ | |||
+ | // Add hash (#) to URL when done scrolling (default click behavior) | ||
+ | window.location.hash = hash; | ||
+ | }); | ||
+ | } // End if | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $(window).on('scroll',function() { | ||
+ | if($(window).scrollTop()) | ||
+ | { | ||
+ | $('.container').css('background', '#808080'); | ||
+ | $('nav ul li ul').css('background', '#808080'); | ||
+ | $('nav').css('opacity','1'); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | $('.container').css('background', '#000000'); | ||
+ | $('nav ul li ul').css('background', '#000000'); | ||
+ | $('nav').css('opacity','1'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
+ | </script> | ||
+ | |||
+ | |||
<style> | <style> | ||
− | /* | + | |
− | + | /**************************************************************************************************************************************************************************************************/ | |
− | + | /* DEFAULT WIKI SETTINGS */ | |
− | #home_logo, #sideMenu { display:none; } | + | /**************************************************************************************************************************************************************************************************/ |
+ | |||
+ | |||
+ | #home_logo, #sideMenu { display:none; } | ||
#sideMenu, #top_title, .patrollink {display:none;} | #sideMenu, #top_title, .patrollink {display:none;} | ||
#content { margin-left:0px; margin-top:-7px; padding:0px; width:100%;} | #content { margin-left:0px; margin-top:-7px; padding:0px; width:100%;} | ||
Line 11: | Line 122: | ||
.judges-will-not-evaluate { border: 4px solid #e4dede; padding: 2% !important; width: 92%!important;} | .judges-will-not-evaluate { border: 4px solid #e4dede; padding: 2% !important; width: 92%!important;} | ||
+ | |||
+ | /**************************************************************************************************************************************************************************************************/ | ||
+ | /* CONTENT OF THE PAGE */ | ||
+ | /**************************************************************************************************************************************************************************************************/ | ||
+ | |||
/*mobile*/ | /*mobile*/ | ||
+ | /**************************************************************************************************************************************************************************************************/ | ||
+ | |||
+ | |||
/* 1800px */ | /* 1800px */ | ||
/************************************************/ | /************************************************/ | ||
Line 18: | Line 137: | ||
.igem_2018_team_menu {display:block;} | .igem_2018_team_menu {display:block;} | ||
} | } | ||
+ | |||
/* 1400px */ | /* 1400px */ | ||
/************************************************/ | /************************************************/ | ||
Line 25: | Line 145: | ||
.igem_2018_team_menu {display:block;} | .igem_2018_team_menu {display:block;} | ||
} | } | ||
+ | |||
@media only screen and (max-width: 1001px) { | @media only screen and (max-width: 1001px) { | ||
.igem_2018_team_menu {display:block;} | .igem_2018_team_menu {display:block;} | ||
} | } | ||
+ | |||
/* 1000px */ | /* 1000px */ | ||
/************************************************/ | /************************************************/ | ||
Line 37: | Line 159: | ||
} | } | ||
+ | |||
+ | |||
@media only screen and (max-width: 500px) { | @media only screen and (max-width: 500px) { | ||
.igem_2018_team_menu {min-width:100%; width:100%; } | .igem_2018_team_menu {min-width:100%; width:100%; } | ||
} | } | ||
− | /*************************************************************************************************************************************************************************************************************************************************************************************************************************************/ | + | |
− | /* | + | |
+ | /**************************************************************************************************************************************************************************************************/ | ||
+ | /**************************************************************************************************************************************************************************************************/ | ||
+ | /**************************************************************************************************************************************************************************************************/ | ||
.container { | .container { | ||
position: fixed; | position: fixed; | ||
Line 163: | Line 290: | ||
} | } | ||
+ | |||
+ | |||
+ | |||
.scroll-down: before { | .scroll-down: before { | ||
Line 186: | Line 316: | ||
} | } | ||
+ | |||
+ | |||
.scroll-down { | .scroll-down { | ||
margin-top: -50px; | margin-top: -50px; | ||
} | } | ||
+ | |||
@keyframes bounce { | @keyframes bounce { | ||
Line 247: | Line 380: | ||
z-index: -1; | z-index: -1; | ||
} | } | ||
+ | |||
.progress-bar { | .progress-bar { | ||
height: 0px; | height: 0px; | ||
Line 285: | Line 419: | ||
color: #f9f9f9; | color: #f9f9f9; | ||
} | } | ||
− | + | /**************************************************************************************************************************************************************************************************/ | |
− | + | /**************************************************************************************************************************************************************************************************/ | |
− | + | /**************************************************************************************************************************************************************************************************/ | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</style> | </style> |
Revision as of 04:12, 12 July 2018