Line 1: | Line 1: | ||
<html> | <html> | ||
− | |||
− | |||
− | |||
<script> | <script> | ||
// This is the jquery part of your template. Try not modify any of this code since it makes your menu work. | // This is the jquery part of your template. Try not modify any of this code since it makes your menu work. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | $(document).ready(function() { | ||
+ | hide_show_menu(); | ||
+ | $("#HQ_page").attr('id',''); | ||
− | $( "#load_menu_here" ).load( "https://2017.igem.org/HQ: | + | $( "#load_menu_here" ).load( "https://2017.igem.org/HQ:Menu_test #Menu" , function() { |
//executes menu functionality ( accordion and toggles) once the menu is loaded | //executes menu functionality ( accordion and toggles) once the menu is loaded | ||
Line 45: | Line 40: | ||
− | |||
function highlight_current_page () { | function highlight_current_page () { | ||
+ | wgPageName = wgPageName.replace(/\//g,"-"); // remove dashes from page name and turn them into "-" | ||
− | |||
$('#' + wgPageName).addClass("current_page"); | $('#' + wgPageName).addClass("current_page"); | ||
Line 57: | Line 51: | ||
case 0: // this is a main menu item | case 0: // this is a main menu item | ||
− | + | ||
− | + | ||
− | + | ||
− | + | $(".current_page > .submenu_access").addClass("less"); | |
+ | $(".current_page > .submenu").fadeIn(400); | ||
break; | break; | ||
+ | |||
+ | |||
case 1: // this is a link inside a submenu | case 1: // this is a link inside a submenu | ||
− | |||
− | |||
− | |||
− | |||
− | case 2: // this is a link inside a submenu | + | $('#' + wgPageName.substr(0, wgPageName.indexOf('-') )).addClass("current_page"); |
− | $( | + | $(".current_page > .submenu_access").addClass("less"); |
− | $("#" + wgPageName. | + | $(".current_page > .submenu").fadeIn(400); |
+ | break; | ||
+ | |||
+ | case 2: // this is a link inside a submenu | ||
+ | |||
+ | $('#' + wgPageName.substr(0, wgPageName.lastIndexOf('-') )).addClass("current_page"); | ||
+ | $('#' + wgPageName.substr(0, wgPageName.indexOf('-') )).addClass("current_page"); | ||
+ | |||
+ | $(".current_page > .submenu_access").addClass("less"); | ||
+ | $(".current_page > .submenu").fadeIn(400); | ||
+ | |||
+ | |||
+ | $("#" + wgPageName.slice(wgPageName.indexOf("-")+1, wgPageName.lastIndexOf("-")) +"_submenu" ).fadeIn(400); | ||
+ | $("#" + wgPageName.slice(wgPageName.indexOf("-")+1, wgPageName.lastIndexOf("-")) +"_submenu" ).prev().addClass("less"); | ||
+ | |||
+ | break; | ||
− | |||
− | |||
− | |||
− | |||
} | } | ||
Line 83: | Line 87: | ||
− | //menu functionality | + | //menu functionality |
function menu_functionality() { | function menu_functionality() { | ||
$(".submenu_access").click(function(){ | $(".submenu_access").click(function(){ | ||
− | |||
$(this).next().fadeToggle(400); | $(this).next().fadeToggle(400); | ||
$(this).toggleClass("less"); | $(this).toggleClass("less"); | ||
− | |||
}); | }); | ||
Line 101: | Line 103: | ||
+ | $("#main_menu_control").click(function() { | ||
+ | |||
+ | if($('.submenu').is(':visible')) { | ||
+ | $(".submenu").hide(); | ||
+ | $(".submenu_access").removeClass("less"); | ||
+ | } | ||
+ | else { | ||
+ | $(".submenu").show(); | ||
+ | $(".submenu_access").addClass("less"); | ||
+ | } | ||
+ | }); | ||
} | } | ||
− | |||
− | function | + | function hide_show_menu() { |
− | |||
+ | if (document.getElementById('bars_item')) { | ||
+ | $("#bars_item").click(function() { | ||
+ | $("#sideMenu").hide(); | ||
+ | $(".menu_wrapper").fadeToggle("100"); | ||
+ | $(".content_wrapper").toggleClass("full_screen"); | ||
+ | }); | ||
+ | } | ||
+ | else { | ||
+ | setTimeout(hide_show_menu, 15); | ||
+ | } | ||
} | } | ||
+ | //make boxes same height | ||
+ | |||
+ | function make_boxes_same_height() { | ||
+ | $(".same_height").css('height', Math.max(($(".same_height.A").height()),($(".same_height.B").height()), ($(".same_height.C").height()) ) ); | ||
+ | } | ||
− | //image slider | + | //image slider |
$(function () { | $(function () { | ||
Line 149: | Line 175: | ||
make_boxes_same_height(); | make_boxes_same_height(); | ||
+ | |||
}); | }); | ||
+ | |||
Line 164: | Line 192: | ||
/********************************* DEFAULT WIKI SETTINGS ********************************/ | /********************************* DEFAULT WIKI SETTINGS ********************************/ | ||
− | #home_logo { display:none; } | + | #home_logo, #sideMenu { display:none; } |
#sideMenu, #top_title, .patrollink {display:none;} | #sideMenu, #top_title, .patrollink {display:none;} | ||
#content { padding:0px; width:100%; margin-top:-7px; margin-left:0px;} | #content { padding:0px; width:100%; margin-top:-7px; margin-left:0px;} | ||
Line 173: | Line 201: | ||
/* Wrapper for the menu */ | /* Wrapper for the menu */ | ||
.menu_wrapper { | .menu_wrapper { | ||
− | width: | + | width: 15%; |
height:100vh; | height:100vh; | ||
position:fixed; | position:fixed; | ||
padding:0px; | padding:0px; | ||
float:right; | float:right; | ||
− | background-color:# | + | background-color:#dddddd; |
text-align:left; | text-align:left; | ||
− | + | right:0%; | |
overflow-y: auto; | overflow-y: auto; | ||
overflow-x: hidden; | overflow-x: hidden; | ||
} | } | ||
+ | |||
/* styling for the images in the side menu */ | /* styling for the images in the side menu */ | ||
.menu_wrapper img { | .menu_wrapper img { | ||
− | width: | + | width: 70%; |
margin: auto; | margin: auto; | ||
+ | padding-left: 20%; | ||
} | } | ||
+ | |||
+ | |||
+ | .logo_container { float:left; width:80%; } | ||
/* class that shows the menu is displayed while the menu is loading */ | /* class that shows the menu is displayed while the menu is loading */ | ||
Line 196: | Line 229: | ||
} | } | ||
− | |||
− | |||
− | + | .menu_bottom_padding { | |
− | . | + | background-color: #f2f2f2; |
− | background-color: #f2f2f2; | + | padding: 10px 0px; |
− | padding: 10px 0px; | + | float: left; |
− | float:left; | + | height:40px; |
− | + | ||
} | } | ||
− | |||
− | + | .menu_item_wrapper { | |
− | . | + | width:100%; |
− | width: 100%; | + | float: left; |
+ | border-bottom: 1px solid #d3d3d3; | ||
+ | background-color: #dddddd; | ||
+ | padding: 2px 0px 0px 0px; | ||
} | } | ||
− | + | .menu_item_wrapper:hover, .submenu_item:hover , .sub_submenu_item:hover, .submenu > .submenu_access:hover { | |
− | . | + | background-color:#00bdcd; |
− | + | text-decoration: none; | |
+ | cursor:pointer; | ||
} | } | ||
− | + | .submenu_access:hover { background-color: #f2f2f2;} | |
− | . | + | |
− | + | .submenu > .submenu_access:hover { background-color: #ffffff;} | |
− | + | ||
− | + | ||
− | + | .menu_icon { width: 20%; float:left;} | |
− | + | ||
+ | |||
+ | .menu_wrapper .menu_icon img { | ||
+ | width: 20px; | ||
+ | padding: 5px 10px 5px 5px; | ||
} | } | ||
+ | |||
+ | /* styling for menu items in the menu */ | ||
+ | .menu_item { float:left; padding: 9px 0px 7px 0px; font-weight: bold; color: #000000;} | ||
− | . | + | .submenu_item.current_page, .menu_item_wrapper.current_page, .sub_submenu_item.current_page { background-color: #00bdcd;} |
− | + | ||
+ | .submenu_item.with_submenu_items { width: 70%;} | ||
+ | |||
+ | /* defines width - for menu items that take you to a page */ | ||
+ | .page_link { | ||
+ | width: 80%; | ||
+ | } | ||
+ | |||
+ | /* defines width - for menu items that take you to a hub */ | ||
+ | .hub_link { | ||
+ | width: 60%; | ||
} | } | ||
Line 237: | Line 287: | ||
} | } | ||
− | + | .submenu > .menu_item > .submenu { | |
− | .submenu > .menu_item | + | color: #666666; |
− | + | font-weight: normal; | |
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | + | .sub_submenu_item { | |
− | + | background-color: white; | |
− | background-color: | + | float: left; |
− | color: | + | width: 100%; |
− | + | padding: 10px 0px 10px 15%; | |
− | + | color: black; | |
+ | font-weight: bold; | ||
+ | border-bottom: 1px solid #dddddd; | ||
} | } | ||
− | |||
.submenu_access { | .submenu_access { | ||
float: left; | float: left; | ||
− | |||
color: #000000; | color: #000000; | ||
padding: 10px 0px; | padding: 10px 0px; | ||
Line 264: | Line 310: | ||
font-weight: bold; | font-weight: bold; | ||
width:20%; | width:20%; | ||
− | text-align:center; | + | background-color: #dddddd; |
− | + | text-align: center; | |
+ | margin-bottom: -2px; | ||
+ | margin-top: -2px; | ||
} | } | ||
Line 272: | Line 320: | ||
content: "+"; | content: "+"; | ||
} | } | ||
+ | |||
+ | .submenu > .submenu_access { background-color: #f2f2f2; border-bottom: 1px solid #d3d3d3; margin:0px;} | ||
.menu_title { | .menu_title { | ||
− | |||
− | |||
float: left; | float: left; | ||
width: 100%; | width: 100%; | ||
− | font-size: | + | font-size: 12px; |
− | color: # | + | color: #000000; |
+ | padding: 10px 0px; | ||
+ | background-color: #f2f2f2; | ||
+ | padding-left: 5%; | ||
+ | border-bottom: 1px solid #d3d3d3; | ||
} | } | ||
+ | |||
+ | .submenu_item { width: 100%; | ||
+ | background-color: #f2f2f2; | ||
+ | padding: 10px 0px 10px 10%; | ||
+ | float: left; | ||
+ | border-bottom: 1px solid #d3d3d3; | ||
+ | color: black; | ||
+ | font-weight: bold;} | ||
Line 300: | Line 360: | ||
cursor: pointer; | cursor: pointer; | ||
} | } | ||
+ | |||
+ | |||
Line 311: | Line 373: | ||
margin: 2%; | margin: 2%; | ||
} | } | ||
+ | |||
+ | .content_wrapper.full_screen { | ||
+ | width: 96%; | ||
+ | } | ||
+ | |||
/*LAYOUT */ | /*LAYOUT */ | ||
Line 403: | Line 470: | ||
.highlight.turquoise_top { | .highlight.turquoise_top { | ||
− | border-top: 4px solid # | + | border-top: 4px solid #00bdcd; |
} | } | ||
.highlight.turquoise_border { | .highlight.turquoise_border { | ||
− | border: 4px solid # | + | border: 4px solid #00bdcd; |
} | } | ||
Line 424: | Line 491: | ||
.button a { | .button a { | ||
− | color: # | + | color: #000000 !important; |
font-weight: bold; | font-weight: bold; | ||
margin: auto; | margin: auto; | ||
text-decoration: none !important; | text-decoration: none !important; | ||
− | background-color: # | + | background-color: #00bdcd; |
padding: 10px 15px; | padding: 10px 15px; | ||
} | } | ||
.button a:hover { | .button a:hover { | ||
− | background-color: # | + | background-color: #000000; |
+ | color: #00bdcd !important; | ||
} | } | ||
Line 441: | Line 509: | ||
.multiple_links a:hover { | .multiple_links a:hover { | ||
− | color: # | + | color: #004789 !important; |
} | } | ||
Line 463: | Line 531: | ||
padding:5px 15px; | padding:5px 15px; | ||
border-bottom:0px; | border-bottom:0px; | ||
− | color: # | + | color: #00bdcd; |
} | } | ||
Line 486: | Line 554: | ||
font-weight: bold; | font-weight: bold; | ||
text-decoration: underline; | text-decoration: underline; | ||
− | text-decoration-color:# | + | text-decoration-color:#004789; |
− | color: # | + | color: #004789; |
-webkit-transition: all 0.4s ease; | -webkit-transition: all 0.4s ease; | ||
-moz-transition: all 0.4s ease; | -moz-transition: all 0.4s ease; | ||
Line 614: | Line 682: | ||
border-top: 1px solid #d3d3d3; | border-top: 1px solid #d3d3d3; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 665: | Line 688: | ||
/********************************* RESPONSIVE STYLING ********************************/ | /********************************* RESPONSIVE STYLING ********************************/ | ||
− | /* IF THE SCREEN IS LESS THAN | + | /* IF THE SCREEN IS LESS THAN 1200PX */ |
− | @media only screen and (max-width: | + | @media only screen and (max-width: 1200px) { |
#content {width:100%; } | #content {width:100%; } | ||
− | .menu_wrapper {width:15%;} | + | .menu_wrapper {width:15%; right:0%;} |
.highlight {padding:10px 0px;} | .highlight {padding:10px 0px;} | ||
− | .load_menu_here {display:none;} | + | .load_menu_here, .menu_icon {display:none;} |
− | + | ul.image_slider { padding:0px; width: 100%; margin: auto;} | |
+ | .menu_item, .submenu_item, .sub_submenu_item, .menu_title { padding: 9px 0px 7px 10px; font-size: 10px;} | ||
+ | .menu_item.hub_link { width: 70%;} | ||
+ | .submenu > .submenu_access { font-size: 10px; padding: 8px 0px; } | ||
+ | .submenu_access{ font-size: 10px; padding: 10px 0px;} | ||
} | } | ||
− | |||
/* IF THE SCREEN IS LESS THAN 800PX */ | /* IF THE SCREEN IS LESS THAN 800PX */ | ||
@media only screen and (max-width: 800px) { | @media only screen and (max-width: 800px) { | ||
− | |||
− | |||
− | .menu_wrapper { width:100%; height: 15%; position:relative; left:0%;} | + | .collapsable_menu_control, .menu_icon, .submenu_access { display:block;} |
+ | .load_menu_here, .menu_bottom_padding {display:none;} | ||
+ | .menu_wrapper { width:100%; height: 15%; position:relative; left:0%;} | ||
.content_wrapper {width:100%; margin-left:0px;} | .content_wrapper {width:100%; margin-left:0px;} | ||
− | .column.half_size | + | .column.half_size, .column.third_size, .column.fourth_size {width:100%; } |
− | + | ||
− | + | ||
.column img { width: 100%; padding: 5px 0px;} | .column img { width: 100%; padding: 5px 0px;} | ||
− | |||
.highlight {padding:15px 5px;} | .highlight {padding:15px 5px;} | ||
.menu_wrapper img { width: 30%; margin-left: 35%;} | .menu_wrapper img { width: 30%; margin-left: 35%;} | ||
+ | .menu_item, .submenu_item, .sub_submenu_item, .menu_title { padding:10px 0px 10px 10%; font-size: 13px; } | ||
+ | .submenu > .submenu_access { font-size: 13px; padding: 10px 0px;} | ||
+ | .submenu_access{ font-size: 13px; padding: 12px 0px; } | ||
+ | .submenu_item { padding-left: 15%;} | ||
+ | .sub_submenu_item { padding-left: 20%;} | ||
+ | .menu_item {width:70%;} | ||
+ | .submenu_item.with_submenu_items {width: 65%;} | ||
+ | .menu_item.hub_link { width:50%;} | ||
+ | |||
} | } | ||
Line 715: | Line 747: | ||
<div class="menu_wrapper" > | <div class="menu_wrapper" > | ||
+ | <div class="collapsable_menu_control"> MENU 三 </div> | ||
+ | |||
+ | <div> | ||
+ | <a href="https://2017.igem.org/Main_Page"> | ||
+ | <div class="logo_container"> | ||
+ | <img src="https://static.igem.org/mediawiki/2017/0/09/2017igem_demo_icon-13-22.svg"></a> | ||
+ | </div> | ||
+ | </a> | ||
+ | <div class="submenu_access less" id="main_menu_control"></div> | ||
+ | </div> | ||
− | |||
− | |||
Revision as of 22:18, 6 February 2017