(194 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<script> | <script> | ||
+ | |||
+ | // This is the jquery part of your template. | ||
+ | // Try not modify any of this code too much since it makes your menu work. | ||
+ | |||
+ | $(document).ready(function() { | ||
+ | |||
+ | $("#HQ_page").attr('id',''); | ||
+ | |||
+ | // call the functions that control the menu | ||
+ | menu_functionality(); | ||
+ | hide_show_menu(); | ||
+ | |||
+ | |||
+ | |||
+ | //this function controls the expand and collapse buttons of the menu and changes the +/- symbols | ||
+ | function menu_functionality() { | ||
+ | |||
+ | //when clicking on a "menu_button", it will change the "+/-" accordingly and it will show/hide the corresponding submenu | ||
+ | $(".menu_button").click(function(){ | ||
+ | |||
+ | // add or remove the class "open" , this class holds the "-" | ||
+ | $(this).children().toggleClass("open"); | ||
+ | // show or hide the submenu | ||
+ | $(this).next('.submenu_wrapper').fadeToggle(400); | ||
+ | }); | ||
+ | |||
+ | // when the screen size is smaller than 800px, the display_menu_control button appears and will show/hide the whole menu | ||
+ | $("#display_menu_control").click(function(){ | ||
+ | $('#menu_content').fadeToggle(400); | ||
+ | }); | ||
+ | |||
+ | // call the current page highlight function | ||
+ | highlight_current_page(); | ||
+ | } | ||
+ | |||
+ | |||
+ | // call the highlight current page function to show it on the menu with a different background color | ||
+ | function highlight_current_page() { | ||
+ | |||
+ | // select a page from the menu based on the id assigned to it and the current page name and add the class "current page" to make it change background color | ||
+ | $("#"+ wgPageName.substring(wgPageName.lastIndexOf("/")+1, wgPageName.length ) + "_page").addClass("current_page"); | ||
+ | |||
+ | // now that the current_page class has been added to a menu item, make the submenu fade in | ||
+ | $(".current_page").parents(".submenu_wrapper").fadeIn(400); | ||
+ | // change the +/- symbol of the corresponding menu button | ||
+ | $(".current_page").parents(".submenu_wrapper").prev().children().toggleClass("open"); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | // allow button on the black menu bar to show/hide the side menu | ||
+ | function hide_show_menu() { | ||
+ | |||
+ | // in case you preview mode is selected, the menu is hidden for better visibility | ||
+ | if (window.location.href.indexOf("submit") >= 0) { | ||
+ | $(".igem_2017_menu_wrapper").hide(); | ||
+ | } | ||
+ | |||
+ | // if the black menu bar has been loaded | ||
+ | if (document.getElementById('bars_item')) { | ||
+ | |||
+ | // when the "bars_item" has been clicked | ||
+ | $("#bars_item").click(function() { | ||
+ | $("#sideMenu").hide(); | ||
+ | |||
+ | // show/hide the menu wrapper | ||
+ | $(".igem_2017_menu_wrapper").fadeToggle("100"); | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | // because the black menu bars loads at a different time than the rest of the page, this function is set on a time out so it can run again in case it has not been loaded yet | ||
+ | else { | ||
+ | setTimeout(hide_show_menu, 15); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | }); | ||
+ | |||
</script> | </script> | ||
Line 13: | Line 93: | ||
+ | /***************************************************** DEFAULT WIKI SETTINGS ****************************************************/ | ||
+ | |||
+ | /* Clear the default wiki settings */ | ||
+ | |||
+ | #home_logo, #sideMenu { display:none; } | ||
+ | #sideMenu, #top_title, .patrollink {display:none;} | ||
+ | #content { width:100%; padding:0px; margin-left:0px;} #bodyContent h1, #bodyContent h2, #bodyContent h3, #bodyContent h4, #bodyContent h5 { margin-bottom: 0px; } | ||
+ | |||
+ | #mw-content-text > p{ | ||
+ | margin:0; | ||
+ | } | ||
+ | |||
+ | |||
/**************************************************************** MENU ***************************************************************/ | /**************************************************************** MENU ***************************************************************/ | ||
/* Wrapper for the menu */ | /* Wrapper for the menu */ | ||
Line 127: | Line 220: | ||
/* Wrapper for the content */ | /* Wrapper for the content */ | ||
− | + | .igem_2017_content_wrapper { | |
width: 75%; | width: 75%; | ||
− | margin | + | margin: 0 auto; |
− | + | ||
− | + | ||
display:block; | display:block; | ||
float:left; | float:left; | ||
− | background-color: | + | background-color:black; |
font-family:Tahoma, Geneva, sans-serif; | font-family:Tahoma, Geneva, sans-serif; | ||
} | } | ||
Line 140: | Line 231: | ||
/********************************* HTML STYLING *********************************/ | /********************************* HTML STYLING *********************************/ | ||
+ | #BACKGROUND { | ||
+ | background-image: url(https://static.igem.org/mediawiki/2017/d/d9/Back_gray.png); | ||
+ | background-position: center center; | ||
+ | background-repeat: no-repeat; | ||
+ | background-attachment: fixed; | ||
+ | background-size: cover; | ||
+ | } | ||
+ | |||
+ | #wrapper { | ||
+ | width: 90%; | ||
+ | margin: 0 auto; | ||
+ | background-color: #ffffff; | ||
+ | padding-top:0; | ||
+ | padding-bottom:0; | ||
+ | } | ||
+ | |||
/* styling for the titles h1 h2 */ | /* styling for the titles h1 h2 */ | ||
− | h1 | + | h1{ |
− | padding:5px 15px; | + | font-size: 300%; |
+ | font-family: serif, 'Times New Roman'; | ||
+ | padding:35px 5px 15px 15px; | ||
border-bottom: 0px; | border-bottom: 0px; | ||
− | color: # | + | color: #606060; |
text-align: center; | text-align: center; | ||
+ | line-height:120px; | ||
+ | } | ||
+ | h2 { | ||
+ | font-size: 45px; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | padding:5px 15px; | ||
+ | border-bottom: 0px; | ||
+ | color:#606060; | ||
+ | text-align: left; | ||
+ | line-height:90px; | ||
} | } | ||
− | /* styling for the titles h3 h4 | + | /* styling for the titles h3 h4 h6*/ |
− | h3, | + | h3 { |
+ | font-size:300%; | ||
+ | font-family: serif, 'Times New Roman'; | ||
padding:5px 15px; | padding:5px 15px; | ||
border-bottom:0px; | border-bottom:0px; | ||
− | color: # | + | color: #606060; |
− | text-align: | + | margin-right:10%; |
+ | margin-left:10%; | ||
+ | line-height:60px; | ||
+ | } | ||
+ | h4 { | ||
+ | font-size:30px; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | padding:5px 15px; | ||
+ | border-bottom:0px; | ||
+ | color: #606060; | ||
+ | text-align: left; | ||
+ | line-height:60px; | ||
+ | } | ||
+ | |||
+ | h5 { | ||
+ | margin-left: 10%; | ||
+ | margin-right:10%; | ||
+ | font-size:200%; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | padding:5px 15px; | ||
+ | color: #78563d; | ||
+ | text-align: left; | ||
+ | line-height:60px; | ||
+ | border-bottom:1px solid #78563d; | ||
+ | } | ||
+ | h6 { | ||
+ | border-bottom:1px solid #78563d; | ||
+ | margin-left:10%; | ||
+ | margin-right:10%; | ||
+ | font-size:150%; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | padding:5px 15px; | ||
+ | border-bottom:0px; | ||
+ | color: #606060; | ||
+ | text-align: left; | ||
+ | line-height:60px; | ||
} | } | ||
/* font and text */ | /* font and text */ | ||
− | + | p { | |
+ | color:#606060; | ||
+ | margin-right:10%; | ||
+ | margin-left:10%; | ||
+ | font-family: serif, 'Times New Roman'; | ||
padding: 0px 15px; | padding: 0px 15px; | ||
− | font-size: | + | font-size: 140%; |
− | text-align: | + | text-align: left; |
} | } | ||
− | |||
/* Links */ | /* Links */ | ||
− | + | a { color:#78563d; | |
− | + | -ebkit-transition: all 0.4s ease; | |
− | + | -moz-transition: all 0.4s ease; | |
− | + | ||
− | + | ||
− | - | + | |
− | + | ||
-ms-transition: all 0.4s ease; | -ms-transition: all 0.4s ease; | ||
-o-transition: all 0.4s ease; | -o-transition: all 0.4s ease; | ||
Line 180: | Line 335: | ||
/* hover for the links */ | /* hover for the links */ | ||
− | + | a:hover { | |
− | text-decoration: | + | text-decoration:underline; |
− | + | ||
} | } | ||
/* top banner list */ | /* top banner list */ | ||
+ | #header{ | ||
+ | background-color:#606060; | ||
+ | position:fixed; | ||
+ | width:90%; | ||
+ | margin-left:5%; | ||
+ | margin-right:0; | ||
+ | z-index:2; | ||
+ | } | ||
ul.nv { | ul.nv { | ||
+ | position:fixed; | ||
width:100%; | width:100%; | ||
− | height: | + | min-height: 40px; |
position: relative; | position: relative; | ||
− | + | font-size: 0px; | |
− | + | margin-left:0; | |
} | } | ||
ul.nv li { | ul.nv li { | ||
− | width: | + | width: 10%; |
display: inline-block; | display: inline-block; | ||
list-style-type: none; | list-style-type: none; | ||
Line 201: | Line 364: | ||
vertical-align: center; | vertical-align: center; | ||
text-align: center; | text-align: center; | ||
− | font-size: | + | font-size:20px; |
letter-spacing: normal; | letter-spacing: normal; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | margin-bottom:0px; | ||
+ | white-space:nowrap; | ||
} | } | ||
ul.nv a { | ul.nv a { | ||
− | background-color: # | + | background-color: #606060; |
color: white; | color: white; | ||
− | line-height: | + | line-height: 60px; |
text-align: center; | text-align: center; | ||
text-decoration: none; | text-decoration: none; | ||
Line 215: | Line 381: | ||
} | } | ||
ul.nv a:hover { | ul.nv a:hover { | ||
− | background-color: # | + | background-color: #aade29; |
− | color: # | + | color: #000000; |
} | } | ||
Line 224: | Line 390: | ||
ul.nv ul{ | ul.nv ul{ | ||
+ | width: 120%; | ||
display: none; | display: none; | ||
margin: 0px; | margin: 0px; | ||
padding: 0px; | padding: 0px; | ||
position: absolute; | position: absolute; | ||
+ | white-space:normal; | ||
+ | font-size:0; | ||
} | } | ||
+ | ul.nv ul li { | ||
+ | width: 120%; | ||
+ | border-top: 1px solid #ffffff; | ||
+ | text-align : center; | ||
+ | font-family: serif, 'Times New Roman'; | ||
+ | white-space:normal; | ||
+ | font-size:15px; | ||
+ | } | ||
+ | ul.nv ul li a { | ||
+ | line-height: 1.5em; | ||
+ | text-align: center; | ||
+ | padding-left: 5px; | ||
+ | font-weight: normal; | ||
+ | } | ||
+ | ul.nv ul li a:hover { | ||
+ | background-color: #aade29; | ||
+ | color: #000000; | ||
+ | } | ||
+ | #blank{ | ||
+ | margin-right:30%; | ||
+ | } | ||
+ | |||
/* non numbered lists */ | /* non numbered lists */ | ||
.igem_2017_content_wrapper ul { | .igem_2017_content_wrapper ul { | ||
Line 404: | Line 595: | ||
} | } | ||
p{ | p{ | ||
− | font-size: | + | font-size: 140%; |
} | } | ||
</style> | </style> |
Latest revision as of 15:36, 1 November 2017