Difference between revisions of "Team:NAWI Graz/Templates/navbar"

Line 1: Line 1:
<html lang="en">
+
<html>
  <head>
+
    <!-- Required meta tags -->
+
    <meta charset="utf-8">
+
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+
  
    <!-- Bootstrap CSS -->
+
<script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
+
  
 +
// This is the jquery part of your template. 
 +
// Try not modify any of this code too much since it makes your menu work.
  
<style>
+
$(document).ready(function() {
  
/********************************* DEFAULT WIKI SETTINGS  ********************************/
+
$("#HQ_page").attr('id','');
  
#sideMenu,
+
// call the functions that control the menu
#top_title {
+
menu_functionality();
display: none;
+
hide_show_menu();
}
+
  
#content {
 
padding: 0px;
 
width: 100%;
 
}
 
  
body {
 
background-color: white;
 
width: 100%;
 
}
 
  
#bodyContent h1,
+
//this function controls the expand and collapse buttons of the menu and changes the +/- symbols
#bodyContent h2,
+
function menu_functionality() {
#bodyContent h3,
+
#bodyContent h4,
+
#bodyContent h5 {
+
margin-bottom: 0px;
+
}
+
  
#bodyContent {
+
//when clicking on a "menu_button", it will change the "+/-" accordingly and it will show/hide the corresponding submenu
padding-right: 0px;
+
$(".menu_button").click(function(){
}
+
  
#globalWrapper {
+
// add or remove the class "open" , this class holds the "-"
font-size: 100%;
+
$(this).children().toggleClass("open");
padding: 0px;
+
// show or hide the submenu
margin: -10px -20px -20px -20px;
+
$(this).next('.submenu_wrapper').fadeToggle(400);
}
+
});
  
.navbar-collapse {
+
// when the screen size is smaller than 800px, the display_menu_control button appears and will show/hide the whole menu
padding-left: 0px;
+
$("#display_menu_control").click(function(){
}
+
$('#menu_content').fadeToggle(400);
 +
});
  
#banner {
+
// call the current page highlight function
margin-top: 50px;
+
highlight_current_page();
 
}
 
}
  
#sideMenu {
 
margin-top: 10px;
 
}
 
  
.dropdown-menu li:hover .sub-menu {
+
// call the highlight current page function to show it on the menu with a different background color
visibility: visible;
+
function highlight_current_page() {
}
+
  
.dropdown:hover .dropdown-menu {
+
// 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
display: block;
+
$("#"+  wgPageName.substring(wgPageName.lastIndexOf("/")+1, wgPageName.length ) + "_page").addClass("current_page");
}
+
  
.navbar-nav .dropdown-menu,
+
// now that the current_page class has been added to a menu item, make the submenu fade in
.navbar .dropdown-menu {
+
$(".current_page").parents(".submenu_wrapper").fadeIn(400);
margin-top: 0;
+
// change the +/- symbol of the corresponding menu button
 +
$(".current_page").parents(".submenu_wrapper").prev().children().toggleClass("open");
 +
 
}
 
}
  
  
/********************************* CONTENT OF THE PAGE ********************************/
 
  
 +
// 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();
 +
}
  
/* Wrapper for the content */
+
// if the black menu bar has been loaded
 +
  if (document.getElementById('bars_item')) {
  
.content_wrapper {
+
// when the "bars_item" has been clicked
width: 85%;
+
$("#bars_item").click(function() {
margin-left: 150px;
+
$("#sideMenu").hide();
padding: 0px;
+
float: left;
+
background-color: white;
+
}
+
  
 +
// show/hide the menu wrapper
 +
$(".igem_2017_menu_wrapper").fadeToggle("100");
 +
});
 +
  }
  
/*LAYOUT */
+
// 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 {
.column {
+
    setTimeout(hide_show_menu, 15);
padding: 10px 0px;
+
}
float: left;
+
background-color: white;
+
 
}
 
}
  
.full_size {
 
width: 100%;
 
}
 
  
.full_size img {
+
});
padding: 10px 15px;
+
width: 96.5%;
+
}
+
  
.half_size {
 
width: 50%;
 
}
 
  
.half_size img {
+
</script>
padding: 10px 15px;
+
width: 93%;
+
}
+
  
.img:hover {
 
opacity: 1.0 !important;
 
}
 
  
.clear {
 
clear: both;
 
}
 
  
.highlight {
 
width: 90%;
 
margin: auto;
 
padding: 15px 5px;
 
background-color: #f2f2f2;
 
}
 
  
.judges-will-not-evaluate {
 
border: 4px solid #72c9b6;
 
display: block;
 
margin: 5px 15px;
 
width: 95%;
 
font-weight: bold;
 
}
 
  
 +
<style>
  
/*STYLING */
 
  
  
/* styling for the titles */
+
/***************************************************** 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-top:-7px; margin-left:0px;}
 +
body {background-color:white; }
 +
#bodyContent h1, #bodyContent h2, #bodyContent h3, #bodyContent h4, #bodyContent h5 { margin-bottom: 0px; }
  
.content_wrapper h1,
+
.content_wrapper h2 {
+
padding: 5px 15px;
+
border-bottom: 0px;
+
/**************************************************************** MENU ***************************************************************/
color: #72c9b6;
+
/* Wrapper for the menu */
}
+
.igem_2017_menu_wrapper {  
 +
width: 15%;
 +
height:100vh;
 +
position:fixed;
 +
right:0%;
 +
padding:0px;
 +
float:right;  
 +
border-left: 1px solid #d3d3d3;  
 +
background-color:#dddddd;  
 +
text-align:left;
 +
font-family:Tahoma, Geneva, sans-serif;
 +
overflow-y: auto;
 +
overflow-x: hidden;
 +
}
  
.content_wrapper h3,
+
/* this hides the scrollbar to keep view consistency */
.content_wrapper h4,
+
.igem_2017_menu_wrappe::-webkit-scrollbar {
.content_wrapper h5,
+
display: none;
.content_wrapper h6 {
+
}
padding: 5px 15px;
+
border-bottom: 0px;
+
color: #000000;
+
/* styling for links in the menu, removes the line under text */
}
+
.igem_2017_menu_wrapper a {
 +
text-decoration: none;  
 +
}
  
  
/* font and text */
+
/* styling for the images in the menu */
 +
.igem_2017_menu_wrapper img {
 +
width: 100%;
 +
}
  
.content_wrapper p {
+
/* styling for the menu buttons */
padding: 0px 15px;
+
.igem_2017_menu_wrapper .menu_button {  
font-size: 13px;
+
width: 100%;
font-family: 'Roboto', sans-serif;
+
padding: 10px 0px 10px 15px;
}
+
float:left;
 +
border-bottom: 1px solid #d3d3d3;  
 +
font-size: 12px;  
 +
font-weight: bold;  
 +
color: #5e5f5f;
 +
cursor: pointer;
 +
}
  
  
/* Links */
+
.igem_2017_menu_wrapper .menu_bottom_padding {
 +
width: 100%;
 +
height: 30px;
 +
float:left;
 +
}
  
.content_wrapper a {
+
.menu_button.direct_to_page {  
font-weight: bold;
+
padding-left: 36px;
text-decoration: underline;
+
}
text-decoration-color: #72c9b6;
+
color: #72c9b6;
+
-webkit-transition: all 0.4s ease;
+
-moz-transition: all 0.4s ease;
+
-ms-transition: all 0.4s ease;
+
-o-transition: all 0.4s ease;
+
transition: all 0.4s ease;
+
}
+
  
  
/* hover for the links */
+
.igem_2017_menu_wrapper .menu_button .expand_collapse_icon {
 +
width:10%;
 +
float:left;
 +
}
  
.content_wrapper a:hover {
+
.igem_2017_menu_wrapper .menu_button .expand_collapse_icon::before {
 +
content: "+"; 
 +
}
 +
 +
.open::before {
 +
content: "-" !important; 
 +
}
 +
 +
 +
 +
/* styling for the menu buttons on hover */
 +
.igem_2017_menu_wrapper .menu_button:hover, .igem_2017_menu_wrapper .submenu_button:hover ,  .submenu_button.current_page:hover {  
 +
background-color: #3399ff;
 
text-decoration: none;
 
text-decoration: none;
color: #000000;
+
color:#ffffff;  
}
+
}
  
 +
/* styling for the menu button when it is the current page */
 +
.current_page {
 +
background-color:#7fc1f7  !important;
 +
color:#5e5f5f !important;
 +
}
  
/* non numbered lists */
 
  
.content_wrapper ul {
+
/* styling for the submenu buttons */
padding: 0px 20px;
+
.igem_2017_menu_wrapper .submenu_button {  
font-size: 13px;
+
width: 100%;
font-family: 'Quicksand', sans-serif;
+
padding: 10px 0px 10px 34px;  
}
+
float:left;
 +
background-color:#f2f2f2;  
 +
border-bottom: 1px solid #d3d3d3;
 +
font-size: 12px;  
 +
color: #5e5f5f;
 +
cursor: pointer;
 +
}
  
 +
/* wrapper for the submenu items, they are hidden by default*/
 +
.igem_2017_menu_wrapper .submenu_wrapper {
 +
display:none;
 +
}
  
/* numbered lists */
+
/* when the page size is bigger than 800px, this show/hide control is hidden by default */
 +
.igem_2017_menu_wrapper #display_menu_control {
 +
display:none;
 +
text-align:center;
 +
}
 +
  
.content_wrapper ol {
+
/***************************************************** CONTENT OF THE PAGE ****************************************************/
padding: 0px;
+
font-size: 13px;
+
font-family: 'Quicksand', sans-serif;
+
}
+
  
 +
/* Wrapper for the content */
 +
.igem_2017_content_wrapper {
 +
width: 81%;
 +
margin: 2%;
 +
display:block;
 +
float:left;
 +
background-color:white;
 +
font-family:Tahoma, Geneva, sans-serif;
 +
}
  
/* Table */
 
  
.content_wrapper table {
+
/********************************* HTML STYLING  *********************************/
width: 97%;
+
margin: 15px 10px;
+
border: 1px solid #d3d3d3;
+
border-collapse: collapse;
+
}
+
  
 +
/* styling for the titles h1 h2 */
 +
.igem_2017_content_wrapper h1, .igem_2017_content_wrapper h2 {
 +
padding:5px 15px;
 +
border-bottom: 0px;
 +
color: #3399ff;
 +
}
  
/* table cells */
 
  
.content_wrapper td {
+
/* styling for the titles  h3 h4 h5 h6*/
padding: 10px;
+
.igem_2017_content_wrapper h3, .igem_2017_content_wrapper h4, .igem_2017_content_wrapper h5, .igem_2017_content_wrapper h6 {  
vertical-align: text-top;
+
padding:5px 15px;  
border: 1px solid #d3d3d3;
+
border-bottom:0px;  
border-collapse: collapse;
+
color: #000000;
}
+
}
  
  
/* table headers */
+
/* font and text */
 +
.igem_2017_content_wrapper p {
 +
padding: 0px 15px;
 +
font-size: 13px;
 +
}
  
.content_wrapper th {
+
/* Links */
padding: 10px;
+
.igem_2017_content_wrapper a {  
vertical-align: text-top;
+
font-weight: bold;  
border: 1px solid #d3d3d3;
+
text-decoration: underline;
border-collapse: collapse;
+
text-decoration-color: #3399ff;
background-color: #f2f2f2;
+
color: #3399ff;
}
+
-webkit-transition: all 0.4s ease;
 +
-moz-transition: all 0.4s ease;  
 +
-ms-transition: all 0.4s ease;  
 +
-o-transition: all 0.4s ease;
 +
transition: all 0.4s ease;
 +
}
  
 +
/* hover for the links */
 +
.igem_2017_content_wrapper a:hover {
 +
text-decoration:none;
 +
color:#000000;
 +
}
  
/* Button class */
+
/* non numbered lists */
 +
.igem_2017_content_wrapper ul {
 +
padding:0px 20px;
 +
font-size: 13px;
 +
font-family:Tahoma, Geneva, sans-serif;
 +
}
  
.button_click {
+
/* numbered lists */
margin: 10px auto;
+
.igem_2017_content_wrapper ol {
padding: 15px;
+
padding:0px;  
width: 12%;
+
font-size: 13px;
text-align: center;
+
font-family:Tahoma, Geneva, sans-serif;  
font-weight: bold;
+
}
background-color: #72c9b6;
+
cursor: pointer;
+
-webkit-transition: all 0.4s ease;
+
-moz-transition: all 0.4s ease;
+
-ms-transition: all 0.4s ease;
+
-o-transition: all 0.4s ease;
+
transition: all 0.4s ease;
+
}
+
  
 +
/* Table */
 +
.igem_2017_content_wrapper table {
 +
width: 97%;
 +
margin:15px 10px;
 +
border: 1px solid #d3d3d3;
 +
border-collapse: collapse;
 +
}
  
/* button class on hover */
+
/* table cells */
 +
.igem_2017_content_wrapper  td {
 +
padding: 10px;
 +
vertical-align: text-top;
 +
border: 1px solid #d3d3d3;
 +
border-collapse: collapse;
 +
}
  
.button_click:hover {
+
/* table headers */
background-color: #000000;
+
.igem_2017_content_wrapper th {  
color: #72c9b6;
+
padding: 10px;
}
+
vertical-align: text-top;
 +
border: 1px solid #d3d3d3;  
 +
border-collapse: collapse;
 +
background-color:#f2f2f2;  
 +
}
  
.top-pad {
 
padding: 35px;
 
}
 
  
 +
/**********************************LAYOUT CLASSES **********************************/
  
/********************************* RESPONSIVE STYLING ********************************/
+
/* general class for column divs */
 +
.igem_2017_content_wrapper .column  {
 +
padding: 10px 0px;
 +
float:left;
 +
}
  
 +
/* class for a full width column */
 +
.column .full_size {
 +
width:100%;
 +
}
  
/* IF THE SCREEN IS LESS THAN 1000PX */
+
/* styling for images in a full width column*/
 +
.column.full_size img {
 +
width:97%;
 +
padding: 10px 15px;
 +
}
  
@media only screen and (max-width: 1000px) {
+
/* class for a half width column */
#content {
+
.column.half_size {
width: 100%;
+
width: 50%;  
}
+
}
.menu_wrapper {
+
/* styling for images in a half width column*/
width: 15%;
+
.column.half_size img {  
}
+
width: 94.5%;
.content_wrapper {
+
padding: 10px 15px;
margin-left: 15%;
+
}
}
+
.menu_item {
+
display: block;
+
}
+
.icon {
+
display: none;
+
}
+
.highlight {
+
padding: 10px 0px;
+
}
+
}
+
  
  
/* IF THE SCREEN IS LESS THAN 680PX */
 
  
@media only screen and (max-width: 680px) {
 
.collapsable_menu_control {
 
display: block;
 
}
 
.menu_item {
 
display: none;
 
}
 
.menu_wrapper {
 
width: 100%;
 
height: 15%;
 
position: relative;
 
}
 
.content_wrapper {
 
width: 100%;
 
margin-left: 0px;
 
}
 
.column.half_size {
 
width: 100%;
 
}
 
.column img {
 
width: 100%;
 
padding: 5px 0px;
 
}
 
.icon {
 
display: block;
 
}
 
.highlight {
 
padding: 15px 5px;
 
}
 
}
 
</style>
 
<script>
 
  
// This is the jquery part of your template.  Try not modify any of this code since it makes your menu work.
+
/********************************* SUPPORT CLASSES ********************************/
  
$(document).ready(function() {
+
/* class that clears content below*/
 +
.igem_2017_content_wrapper .clear {
 +
clear:both;
 +
}
 +
 +
 +
/* adds extra spacing when clearing content */
 +
.igem_2017_content_wrapper  .clear.extra_space {
 +
height: 30px;
 +
}
  
$("#HQ_page").attr('id','');
 
 
  
if ( wgPageName.substring( 0, 8) == "Template")  {  // if the page is a template it displays the full name in a single line
+
/* highlight class, makes content slightly smaller */
$("#team_name").html( wgPageName );  
+
.igem_2017_content_wrapper .highlight {
}
+
margin: 0px 15px;
 +
padding: 15px 0px;
 +
}
  
else if (  ( (wgPageName.match(/\//g) || []).length ) == 0 ) {  // if it is the home page , just print the team's name
 
$("#team_name").html( wgPageName.substring( 5, wgPageName.length ) );
 
}
 
  
else {
+
/* highlight class, adds a gray background */
// this adds the team's name as an h1
+
.igem_2017_content_wrapper .highlight.gray {
$("#team_name").html( wgPageName.substring( 5 , wgPageName.indexOf("/")  ) );  
+
background-color: #f2f2f2;  
 +
}
  
// this adds the page's title as an h4
+
/* highlight with decoration blue line on top */
$("#page_name").html (    ( wgPageName.substring( wgPageName.indexOf("/") + 1, wgPageName.length ) ).replace( /\/|_/g , " ")  );
+
.igem_2017_content_wrapper .highlight.blue_top {
}
+
    border-top: 4px solid #3399ff;
 +
}
  
 +
/* highlight with a full blue border decoration */
 +
.igem_2017_content_wrapper .highlight.blue_border {
 +
    border: 4px solid  #3399ff;
 +
}
  
  
 +
/* button class */
 +
.igem_2017_content_wrapper .button{
 +
max-width: 35%;
 +
margin: 30px auto;
 +
padding: 12px 10px;
 +
    background-color: #3399ff;
 +
    text-align: center;
 +
  color: #ffffff;
 +
-webkit-transition: all 0.4s ease;
 +
-moz-transition: all 0.4s ease;
 +
-ms-transition: all 0.4s ease;
 +
-o-transition: all 0.4s ease; transition: all 0.4s ease; 
 +
}
  
$('#accordion').find('.menu_item').click(function(){
+
/* styling for button on hover */
 +
.igem_2017_content_wrapper .button:hover{
 +
background-color: #3399ff;
 +
    color: #000000;
 +
}
  
//Expand or collapse this panel
 
submenu = $(this).find('.submenu');
 
submenu.toggle();
 
  
icon = $(this).find('.icon');
 
  
if ( !$( submenu ).is(':visible') ) {
 
icon.removeClass("less").addClass("plus");
 
}
 
else {
 
icon.removeClass("plus").addClass("less");
 
}
 
  
//Hide the other panels
+
/***************************************************** RESPONSIVE STYLING ****************************************************/
$(".submenu").not(submenu).hide();
+
$(".icon").not(icon).removeClass("less").addClass("plus");
+
});
+
  
 +
/* IF THE SCREEN IS LESS THAN 1200PX */
 +
@media only screen and (max-width: 1200px) {
  
$(".collapsable_menu_control").click(function() {
+
#content {width:100%; }
$(".menu_item").toggle();
+
.igem_2017_menu_wrapper {width:15%; right:0;}
});
+
.highlight {padding:10px 0px;}
 +
.igem_2017_menu_wrapper #display_menu_control { display:none; }
 +
#menu_content { display:block;}
 +
.menu_button.direct_to_page {padding-left: 17px;}
 +
 +
}
  
$( window ).resize(function() {
+
/* IF THE SCREEN IS LESS THAN 800PX */
$(".menu_item").show();
+
@media only screen and (max-width: 800px) {
});
+
 
 +
.igem_2017_menu_wrapper { width:100%; height: 15%; position:relative; left:0%;}
 +
.igem_2017_content_wrapper {width:100%; margin-left:0px;}
 +
.column.half_size  {width:100%; }
 +
.column.full_size img, .column.half_size img {  width: 100%; padding: 10px 0px;}  
 +
.highlight {padding:15px 5px;}
 +
.igem_2017_menu_wrapper #display_menu_control { display:block; }
 +
#menu_content { display:none;}
 +
.igem_2017_menu_wrapper .menu_button .expand_collapse_icon { width: 5%; }
 +
.menu_bottom_padding {display:none;}
 +
.menu_button.direct_to_page { padding-left: 36px; }
 +
}
  
  
});
+
</script>
+
  </head>
+
/* special class that the system uses to make sure the team wants a page to be evaluated */
 +
.judges-will-not-evaluate {
 +
    width: 96.6%;
 +
  margin: 5px 15px;
 +
  display: block;
 +
border: 4px solid #3399ff;
 +
    font-weight: bold;
 +
}
 +
 +
</style>
  
 
   <body>
 
   <body>

Revision as of 16:36, 3 October 2017