Difference between revisions of "Team:NUDT CHINA"

 
(240 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!doctype html>
+
{{NUDT_CHINA}}
 
<html lang="en">
 
<html lang="en">
 
<head>
 
<head>
 
     <meta charset="utf-8">
 
     <meta charset="utf-8">
 
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="description" content="A layout example with a side menu that hides on mobile, just like the Pure website.">
+
     <title>Team:NUDT_CHINA</title>
    <title>Responsive Side Menu &ndash; Layout Examples &ndash; Pure</title>
+
<script type="text/javascript" >
   
+
window.onload=function(){
   
+
var oContent = $('content');
   
+
var oLoading = $('loading');
   
+
var oList = $('Qidilist');
        <!--[if lte IE 8]>
+
var aLiList = getByClass( oList , 'liList' );
            <link rel="stylesheet" href="/combo/1.18.13?/css/layouts/side-menu-old-ie.css">
+
var oMenu = $('lay-menu');
        <![endif]-->
+
  var oNextBtn=$('next-button');
        <!--[if gt IE 8]><!-->
+
var aLiMenu = oMenu.getElementsByTagName('li');
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
+
var iNow = 0;
              <style type="text/css">
+
var prevIndex = 0;
<!--
+
var iContentHeight = 0;
.pure-menu-item .pure-menu-item {
+
var btn1 = $('btn1');
    display: block;
+
var btn2 = $('btn2');
}
+
var btn3 = $('btn3');
 +
var btn4 = $('btn4');
 +
contentAuto();
 +
mouseWheel();
 +
bindNav();
 +
add1();
 +
add2();
 +
window.onresize = fnResize; 
 +
function add1() {
 +
oNextBtn.onclick=function () {
 +
showLoading();
 +
};
 +
}
 +
function add2() {
 +
btn1.onclick=function () {
 +
toMove(1);
 +
iNow=1;
 +
}
 +
btn2.onclick=function () {
 +
toMove(2);
 +
iNow=2;
 +
}
 +
btn3.onclick=function () {
 +
toMove(3);
 +
iNow=3;
 +
}
 +
btn4.onclick=function () {
 +
toMove(0);
 +
iNow=0;
 +
}
 +
}
 +
function mouseWheel(){
 +
var bBtn = true;
 +
var timer = null;
 +
if(oContent.addEventListener){
 +
oContent.addEventListener('DOMMouseScroll',function(ev){
 +
var ev = ev || window.event;
 +
clearTimeout(timer);
 +
timer = setTimeout(function(){
 +
toChange(ev);
 +
},200);
 +
},false);
 +
}
 +
oContent.onmousewheel = function(ev){
 +
var ev = ev || window.event;
 +
clearTimeout(timer);
 +
timer = setTimeout(function(){
 +
toChange(ev);
 +
},200);
 +
};
 +
 +
function toChange(ev){
 +
if(ev.detail){
 +
bBtn = ev.detail > 0 ? true : false;
 +
}
 +
else{
 +
bBtn = ev.wheelDelta < 0 ? true : false;
 +
}
 +
 +
if(  iNow == aLiList.length-1){if(bBtn!=0){return;};}
 +
if( iNow == 0 ){if(bBtn==0){return;};}
 +
 +
prevIndex = iNow;
 +
if(bBtn){  //
 +
if(iNow != aLiList.length-1){
 +
iNow++;
 +
}
 +
toMove(iNow);
 +
}
 +
else{  //
 +
if(iNow != 0){
 +
iNow--;
 +
}
 +
toMove(iNow);
 +
}
 +
 +
if(ev.preventDefault){
 +
ev.preventDefault();
 +
}
 +
else{
 +
return false;
 +
}
 +
}
 +
 +
}
 +
function showLoading(){
 +
var oSpan = oLoading.getElementsByTagName('span')[0];
 +
var aDiv = oLoading.getElementsByTagName('div');
 +
oSpan.style.width = '100%';
 +
oSpan.addEventListener('webkitTransitionend',spanChange,false);
 +
oSpan.addEventListener('transitionend',spanChange,false);
 +
function spanChange(){
 +
if(oSpan.style.width == '100%'){
 +
oSpan.style.display = 'none';
 +
aDiv[0].style.height = 0;
 +
aDiv[1].style.height = 0;
 +
}
 +
}
 +
aDiv[0].addEventListener('webkitTransitionend',divChange,false);
 +
aDiv[0].addEventListener('transitionend',divChange,false);
 +
 +
function divChange(){
 +
oLoading.parentNode.removeChild(oLoading);
 +
}
 +
 +
}
  
.pure-menu-children {
+
function bindNav(){
    display: none;
+
for(var i=0;i<aLiMenu.length;i++){
    position: absolute;
+
aLiMenu[i].index = i;
    left: 100%;
+
aLiMenu[i].onclick = function(){
    top: 0;
+
prevIndex = iNow;
    margin: 0;
+
iNow = this.index;
    padding: 0;
+
toMove( this.index );
    z-index: 3;
+
};
 +
}
 +
}
 +
function toMove(index){
 +
oList.style.top = - index * iContentHeight + 'px';
 +
for(var i=0;i<aLiMenu.length;i++){
 +
aLiMenu[i].className = '';
 +
}
 +
aLiMenu[index].className = 'active';
 +
}
 +
 +
function contentAuto(){
 +
iContentHeight = viewHeight() ;
 +
oContent.style.height = iContentHeight + 'px';
 +
for(var i=0;i<aLiList.length;i++){
 +
aLiList[i].style.height = iContentHeight + 'px';
 +
}
 +
oList.style.top = - iNow * iContentHeight + 'px';
 +
}
 +
 +
function fnResize(){
 +
contentAuto();
 +
}
 +
 +
function $(id){
 +
return document.getElementById(id);
 +
}
 +
 +
function viewWidth(){
 +
return window.innerWidth || document.documentElement.clientWidth;
 +
}
 +
 +
function viewHeight(){
 +
return window.innerHeight || document.documentElement.clientHeight;
 +
}
 +
 +
function getByClass(oParent,sClass){
 +
var aElem = oParent.getElementsByTagName('*');
 +
var arr = [];
 +
for(var i=0;i<aElem.length;i++){
 +
if( aElem[i].className == sClass ){
 +
arr.push( aElem[i] );
 +
}
 +
}
 +
return arr;
 +
}
 
}
 
}
 
+
</script>
.pure-menu-horizontal .pure-menu-children {
+
<style type="text/css">
    left: 0;
+
.button-next{    font-weight: bold;
     top: auto;
+
     font-family: "Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace;
    width: inherit;
+
}
+
 
+
.pure-menu-allow-hover:hover > .pure-menu-children,
+
.pure-menu-active > .pure-menu-children {
+
    display: block;
+
 
     position: absolute;
 
     position: absolute;
 +
    min-width: 180px;
 +
    min-height: 40px;
 +
  height: 7%;
 +
  width: 13%;
 +
  bottom: 1%;
 +
  background: #fff;
 +
  border: 1px solid #fff;
 +
  border-radius: 2px;
 +
  color: #222;
 +
  text-align: center;
 +
  cursor: pointer;
 +
  transition: .2s ease-in-out;
 +
  transform: translate(-50%, -50%);font-size: large;
 
}
 
}
 
+
.button-next:hover {
/* Vertical Menus - show the dropdown arrow */
+
  background: transparent;
.pure-menu-has-children > .pure-menu-link:after {
+
  color: #fff;
    padding-left: 0.5em;
+
    content: "\25B8";
+
    font-size: small;
+
}
+
 
+
/* Horizontal Menus - show the dropdown arrow */
+
.pure-menu-horizontal .pure-menu-has-children > .pure-menu-link:after {
+
    content: "\25BE";
+
 
}
 
}
 +
.myheader{height: 100%; text-align: center; background-color: rgba(255,255,255,0);margin:0 auto;position: relative;}
 +
.content{width:100%;}
 +
li{ list-style:none;}
 +
#Qidilist{ width:100%; position:absolute; top:0; left:0; transition:.5s top;}
 +
#lay-menu{ position:fixed; right:0; top:50%; z-index:20;}
 +
#lay-menu li{ width:10px; height:10px; border-radius:50%; margin:10px; border:1px black solid; cursor:pointer;}
 +
#lay-menu li.active{ background:black; cursor:default;}
  
 +
.myheader img{width:100%; margin: 0;position: absolute;  top: 50%;transform: translate(0, -50%); left: 0;max-height: 80%;}
 +
.myheader h1{width:100%; margin: 0;position: absolute;  top: 40%;transform: translate(0, -50%); left: 0;max-height: 80%;font-size:78px; font-family:"Comic Sans MS",cursive;border-bottom: none;padding-bottom:40px;line-height:normal;}
 +
.myheader h3{width:100%; margin: 0;position: absolute;  top: 60%;transform: translate(0, -50%); left: 0;max-height: 80%;font-size:30px;border-bottom: none;font-weight:initial;font-family: "Big Caslon","Book Antiqua","Palatino Linotype",Georgia,serif;line-height:normal;}
 +
#loading div{ width:100%; height:50%; position:absolute; left:0; background:#009ee0; z-index:50; transition:1s;text-align: center;}
 +
#loading div:nth-of-type(1){ top:0;}
 +
#loading div:nth-of-type(2){ bottom:0;}
 +
#loading span{ width:0%; height:4px; background:white; position:absolute; left:0; top:50%; margin-top:-2px; z-index:60; transition:.10s;}
 
body {
 
body {
 
     color: #777;
 
     color: #777;
 
}
 
}
 
+
#Qidilist .liList{ width:100%; position:relative;  overflow:hidden;text-align: center;left:-30px;}
.pure-img-responsive {
+
.big-bg{position:absolute; top:0;left:0;height:100%;width:100%; z-index:9;}
    max-width: 100%;
+
@media (min-width: 92em) {
    height: auto;
+
  .myheader {
 +
        width: 85%;}
 
}
 
}
 
+
@media (max-width: 92em) {
/*
+
  .myheader {
Add transition to containers so they can push in and out.
+
        width: 85%;}
*/
+
#layout,
+
#menu,
+
.menu-link {
+
    -webkit-transition: all 0.2s ease-out;
+
    -moz-transition: all 0.2s ease-out;
+
    -ms-transition: all 0.2s ease-out;
+
    -o-transition: all 0.2s ease-out;
+
    transition: all 0.2s ease-out;
+
 
}
 
}
 
+
@media (max-width: 45em) {
/*
+
  .myheader {
This is the parent `<div>` that contains the menu and the content area.
+
        width: 100%;}
*/
+
#layout {
+
    position: relative;
+
    left: 0;
+
    padding-left: 0;
+
 
}
 
}
    #layout.active #menu {
 
        left: 150px;
 
        width: 150px;
 
    }
 
  
    #layout.active .menu-link {
+
.next-button {z-index:10;position:absolute;font-weight: bold;
        left: 150px;
+
     font-family: "Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace;
     }
+
  top: 40%;
/*
+
  left: 50%;font-size:29px;font-weight:10px;
The content `<div>` is where all your content goes.
+
  z-index: 10;
*/
+
  padding: 1em 2.5em;
.content {
+
  background: #fff;
    margin: 0 auto;
+
  border: 1px solid #fff;
    padding: 0 2em;
+
  border-radius: 4px;
    max-width: 800px;
+
  color: #222;
    margin-bottom: 50px;
+
  font-size: large;
    line-height: 1.6em;
+
  text-align: center;
 +
  cursor: pointer;
 +
  transition: .2s ease-in-out;
 +
  transform: translate(-50%, -50%);}
 +
.next-button:hover {
 +
  background: transparent;
 +
  color: #fff;
 
}
 
}
 +
.under-bg{z-index: 0.5;opacity: 1; position: fixed; top: 0; left: 0; width: 100%; height: 100%;}
 +
</style>
  
.header {
 
    margin: 0;
 
    color: #333;
 
    text-align: center;
 
    padding: 2.5em 2em 0;
 
    border-bottom: 1px solid #eee;
 
}
 
    .header h1 {
 
        margin: 0.2em 0;
 
        font-size: 3em;
 
        font-weight: 300;
 
    }
 
    .header h2 {
 
        font-weight: 300;
 
        color: #ccc;
 
        padding: 0;
 
        margin-top: 0;
 
    }
 
 
.content-subhead {
 
    margin: 50px 0 20px 0;
 
    font-weight: 300;
 
    color: #888;
 
}
 
 
 
 
/*
 
The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
 
appears on the left side of the page.
 
*/
 
 
#menu {
 
    margin-left: -150px; /* "#menu" width */
 
    width: 150px;
 
    position: fixed;
 
    top: 0;
 
    left: 0;
 
    bottom: 0;
 
    z-index: 1000; /* so the menu or its navicon stays above all content */
 
    background: #191818;
 
    overflow-y: auto;
 
    -webkit-overflow-scrolling: touch;
 
}
 
    /*
 
    All anchors inside the menu should be styled like this.
 
    */
 
    #menu a {
 
        color: #999;
 
        border: none;
 
        padding: 0.6em 0 0.6em 0.6em;
 
    }
 
 
    /*
 
    Remove all background/borders, since we are applying them to #menu.
 
    */
 
    #menu .pure-menu,
 
    #menu .pure-menu ul {
 
        border: none;
 
        background: transparent;
 
    }
 
 
    /*
 
    Add that light border to separate items into groups.
 
    */
 
    #menu .pure-menu ul,
 
    #menu .pure-menu .menu-item-divided {
 
        border-top: 1px solid #333;
 
    }
 
        /*
 
        Change color of the anchor links on hover/focus.
 
        */
 
        #menu .pure-menu li a:hover,
 
        #menu .pure-menu li a:focus {
 
            background: #333;
 
        }
 
 
    /*
 
    This styles the selected menu item `<li>`.
 
    */
 
    #menu .pure-menu-selected,
 
    #menu .pure-menu-heading {
 
        background: #1f8dd6;
 
    }
 
        /*
 
        This styles a link within a selected menu item `<li>`.
 
        */
 
        #menu .pure-menu-selected a {
 
            color: #fff;
 
        }
 
 
    /*
 
    This styles the menu heading.
 
    */
 
    #menu .pure-menu-heading {
 
        font-size: 110%;
 
        color: #fff;
 
        margin: 0;
 
    }
 
 
/* -- Dynamic Button For Responsive Menu -------------------------------------*/
 
 
/*
 
The button to open/close the Menu is custom-made and not part of Pure. Here's
 
how it works:
 
*/
 
 
/*
 
`.menu-link` represents the responsive menu toggle that shows/hides on
 
small screens.
 
*/
 
.menu-link {
 
    position: fixed;
 
    display: block; /* show this only on small screens */
 
    top: 0;
 
    left: 0; /* "#menu width" */
 
    background: #000;
 
    background: rgba(0,0,0,0.7);
 
    font-size: 10px; /* change this value to increase/decrease button size */
 
    z-index: 10;
 
    width: 2em;
 
    height: auto;
 
    padding: 2.1em 1.6em;
 
}
 
 
    .menu-link:hover,
 
    .menu-link:focus {
 
        background: #000;
 
    }
 
 
    .menu-link span {
 
        position: relative;
 
        display: block;
 
    }
 
 
    .menu-link span,
 
    .menu-link span:before,
 
    .menu-link span:after {
 
        background-color: #fff;
 
        width: 100%;
 
        height: 0.2em;
 
    }
 
 
        .menu-link span:before,
 
        .menu-link span:after {
 
            position: absolute;
 
            margin-top: -0.6em;
 
            content: " ";
 
        }
 
 
        .menu-link span:after {
 
            margin-top: 0.6em;
 
        }
 
 
 
/* -- Responsive Styles (Media Queries) ------------------------------------- */
 
 
/*
 
Hides the menu at `48em`, but modify this based on your app's needs.
 
*/
 
@media (min-width: 48em) {
 
 
    .header,
 
    .content {
 
        padding-left: 2em;
 
        padding-right: 2em;
 
    }
 
 
    #layout {
 
        padding-left: 150px; /* left col width "#menu" */
 
        left: 0;
 
    }
 
    #menu {
 
        left: 150px;
 
    }
 
 
    .menu-link {
 
        position: fixed;
 
        left: 150px;
 
        display: none;
 
    }
 
 
    #layout.active .menu-link {
 
        left: 150px;
 
    }
 
}
 
 
@media (max-width: 48em) {
 
    /* Only apply this when the window is small. Otherwise, the following
 
    case results in extra padding on the left:
 
        * Make the window small.
 
        * Tap the menu to trigger the active state.
 
        * Make the window large again.
 
    */
 
    #layout.active {
 
        position: relative;
 
        left: 150px;
 
    }
 
}
 
-->
 
            </style>
 
        <!--<![endif]-->
 
    <!--[if lt IE 9]>
 
        <script src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
 
    <![endif]-->
 
    <script>
 
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
 
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
   
 
    ga('create', 'UA-41480445-1', 'purecss.io');
 
    ga('send', 'pageview');
 
    </script>
 
 
</head>
 
</head>
<body>
+
<img class="under-bg" src="https://static.igem.org/mediawiki/2017/c/cc/T-NUDT_CHINA-MainPage1.jpg" alt="">
 
+
<div id="loading">
 
+
    <div><img src="https://static.igem.org/mediawiki/2017/1/17/T-NUDT_CHINA-loadingBg3.jpg" alt="" class="big-bg"></div>
 
+
        <div><img src="https://static.igem.org/mediawiki/2017/a/ab/T-NUDT_CHINA-loadingBg4.jpg" alt="" class="big-bg">
 
+
            <a class="next-button" id="next-button">Get Started!</a>
 
+
        </div>
 
+
<div id="layout">
+
    <!-- Menu toggle -->
+
    <a href="#menu" id="menuLink" class="menu-link">
+
        <!-- Hamburger icon -->
+
 
         <span></span>
 
         <span></span>
     </a>
+
     </div>
 
+
 
    <div id="menu">
+
  <div id="layout">
         <div class="pure-menu">
+
         <a href="#menu" id="menuLink" class="menu-link">
             <img class="pure-img-responsive" src="http://farm8.staticflickr.com/7357/9086701425_fda3024927.jpg" alt="Mountain">
+
             <span></span>
            <!--<a class="pure-menu-heading" href="#">Company</a>-->
+
        </a>
            <div class="custom-restricted-width">
+
        <div id="menu">
            <ul class="pure-menu-list">
+
        <div class="pure-menu"><img src="https://static.igem.org/mediawiki/2017/4/4f/T-NUDT_CHINA-icon01.png" width=240px height=190px alt="">
                 <li class="pure-menu-item pure-menu-selected"><a href="#" class="pure-menu-link">Home</a></li>
+
          <ul class="pure-menu-list">
                 <li class="pure-menu-item"><a href="#" class="pure-menu-link">About</a></li>
+
            <li class="pure-menu-item"><a class="pure-menu-heading" href="https://2017.igem.org/Team:NUDT_CHINA" class="pure-menu-link">HOME</a></li>             
 
+
         
                <li class="pure-menu-item" class="menu-item-divided pure-menu-selected">
+
            <li class="pure-menu-item pure-menu-has-children">
                    <a href="#" class="pure-menu-link">Services</a>
+
              <class="pure-menu-link"onclick="Show('team_show')">TEAM</a>
                 </li>
+
              <ul class="pure-menu-children" id="team_show">
 
+
                 <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Team" class="pure-menu-link">Team</a></li>
                 <li class="pure-menu-item"><a href="#" class="pure-menu-link">Contact</a></li>
+
                 <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Collaborations" class="pure-menu-link">Collaborations</a></li>
                 <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
+
            </ul>
                  <a href="#" id="menuLink1" class="pure-menu-link">More</a>
+
            </li>
                  <ul class="pure-menu-children">
+
            <li class="pure-menu-item pure-menu-has-children">
                      <li class="pure-menu-item"><a href="#" class="pure-menu-link">Autos</a></li>
+
              <a  class="pure-menu-link"onclick="Show('project_show')">PROJECT</a>
                      <li class="pure-menu-item"><a href="#" class="pure-menu-link">Flickr</a></li>
+
              <ul class="pure-menu-children" id="project_show">
                      <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
+
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Description" class="pure-menu-link">Description</a></li>
                          <a href="#" id="menuLink1" class="pure-menu-link">Even More</a>
+
                 <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Design" class="pure-menu-link">Design</a></li>
                          <ul class="pure-menu-children">
+
                 <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Experiments" class="pure-menu-link">Experiment</a></li>
                            <li class="pure-menu-item"><a href="#" class="pure-menu-link">Foo</a></li>
+
                 <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Notebook" class="pure-menu-link">Notebook</a></li>
                            <li class="pure-menu-item"><a href="#" class="pure-menu-link">Bar</a></li>
+
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Results" class="pure-menu-link">Results</a></li>
                            <li class="pure-menu-item"><a href="#" class="pure-menu-link">Baz</a></li>
+
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Demonstrate" class="pure-menu-link">Demonstrate</a></li>
                          </ul>
+
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Improve" class="pure-menu-link">Improve</a></li>
                      </li>
+
            </ul>
                  </ul>
+
            </li>
                </li>
+
            <li class="pure-menu-item pure-menu-has-children">
 +
              <a  class="pure-menu-link"onclick="Show('part_show')">PARTS</a>
 +
              <ul class="pure-menu-children" id="part_show">
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Parts" class="pure-menu-link">Parts</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Basic_Part" class="pure-menu-link">Basic Parts</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Composite_Part" class="pure-menu-link">Composite Parts</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Part_Collection" class="pure-menu-link">Part Collection</a></li>
 +
            </ul>
 +
            </li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Attributions" class="pure-menu-link">Attributions</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/InterLab" class="pure-menu-link">InterLab</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Model" class="pure-menu-link">Model</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Safety" class="pure-menu-link">SAFETY</a></li>
 +
            <li class="pure-menu-item pure-menu-has-children">
 +
              <a  class="pure-menu-link"onclick="Show('HP_show')">HP</a>
 +
              <ul class="pure-menu-children" id="HP_show">
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/HP/Silver" class="pure-menu-link">Silver HP</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/HP/Gold_Integrated" class="pure-menu-link">Integrated & Gold</a></li>
 +
                <li class="pure-menu-item"><a href="https://2017.igem.org/Team:NUDT_CHINA/Engagement" class="pure-menu-link">Public Engagement</a></li>
 +
            </ul>
 +
            </li>
 
             </ul>
 
             </ul>
 +
        </div> 
 
         </div>
 
         </div>
 +
        <div id="content" class="content">
 +
    <ul id="lay-menu">
 +
        <li class="active"></li>
 +
            <li></li>
 +
            <li></li>
 +
            <li></li>
 +
        </ul>
 +
    <ul id="Qidilist">
 +
      <li id="abstract" class="liList">
 +
            <div class="myheader"id="main"><h1>MiRNA &nbsp;&nbsp;Locker</h1><h3>A Modularized DNA Assembly As miRNA Inhibitors</h3><button id="btn1" class="button-next">How it works?</button></div>
 +
            </li>
 +
      <li id="abstract" class="liList">
 +
            <div class="myheader"id="main"><img class="strory-telling1" src="https://static.igem.org/mediawiki/2017/a/ad/T-NUDT_CHINA-story1.png" no-repeat; ><button id="btn2" class="button-next">Next</button></div>
 +
            </li>
 +
      <li id="abstract" class="liList">
 +
            <div class="myheader"id="main"><img class="strory-telling2" src="https://static.igem.org/mediawiki/2017/3/35/T-NUDT_CHINA-story2.png" no-repeat; ><button id="btn3" class="button-next">Next</button></div>
 +
            </li>
 +
      <li id="abstract" class="liList">
 +
            <div class="myheader"id="main"><img class="strory-telling3" src="https://static.igem.org/mediawiki/2017/1/1e/T-NUDT_CHINA-story3.png" no-repeat; ><button id="btn4" class="button-next">Back</button></div>
 +
            </li>
 +
   
 +
        </ul>
 
         </div>
 
         </div>
    </div>
+
          
 
+
    <div id="main">
+
         <div class="header">
+
            <h1>Page Title</h1>
+
            <h2>A subtitle for your page goes here</h2>
+
        </div>
+
 
+
        <div class="content">
+
            <h2 class="content-subhead">How to use this layout</h2>
+
            <p>
+
                To use this layout, you can just copy paste the HTML, along with the CSS in <a href="/css/layouts/side-menu.css" alt="Side Menu CSS">side-menu.css</a>, and the JavaScript in <a href="/js/ui.js">ui.js</a>. The JS file uses vanilla JavaScript to simply toggle an <code>active</code> class that makes the menu responsive.
+
            </p>
+
 
+
            <h2 class="content-subhead">Now Let's Speak Some Latin</h2>
+
            <p>
+
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
            </p>
+
 
+
            <div class="pure-g">
+
                <div class="pure-u-1-4">
+
                    <img class="pure-img-responsive" src="http://farm3.staticflickr.com/2875/9069037713_1752f5daeb.jpg" alt="Peyto Lake">
+
                </div>
+
                <div class="pure-u-1-4">
+
                    <img class="pure-img-responsive" src="http://farm3.staticflickr.com/2813/9069585985_80da8db54f.jpg" alt="Train">
+
                </div>
+
                <div class="pure-u-1-4">
+
                    <img class="pure-img-responsive" src="http://farm6.staticflickr.com/5456/9121446012_c1640e42d0.jpg" alt="T-Shirt Store">
+
                </div>
+
                <div class="pure-u-1-4">
+
                    <img class="pure-img-responsive" src="http://farm8.staticflickr.com/7357/9086701425_fda3024927.jpg" alt="Mountain">
+
                </div>
+
            </div>
+
 
+
            <h2 class="content-subhead">Try Resizing your Browser</h2>
+
            <p>
+
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
            </p>
+
        </div>
+
    </div>
+
 
</div>
 
</div>
 
+
<script type="text/javascript">
 
+
( function(window,document){
 
+
 
+
<script type="text/javascript" >
+
(function (window, document) {
+
  
 
     var layout  = document.getElementById('layout'),
 
     var layout  = document.getElementById('layout'),
Line 457: Line 392:
  
 
}(this, this.document));
 
}(this, this.document));
(function (window, document) {
+
</script>
    'use strict';
+
 
+
    // Enable drop-down menus in Pure
+
    // Inspired by YUI3 gallery-simple-menu by Julien LeComte
+
    // [https://github.com/yui/yui3-gallery/blob/master/src/gallery-simple-menu/js/simple-menu.js]
+
 
+
    function PureDropdown(dropdownParent) {
+
 
+
        var PREFIX = 'pure-',
+
            ACTIVE_CLASS_NAME = PREFIX + 'menu-active',
+
            ARIA_ROLE = 'role',
+
            ARIA_HIDDEN = 'aria-hidden',
+
            MENU_OPEN = 0,
+
            MENU_CLOSED = 1,
+
            MENU_PARENT_CLASS_NAME = 'pure-menu-has-children',
+
            MENU_ACTIVE_SELECTOR = '.pure-menu-active',
+
            MENU_LINK_SELECTOR = '.pure-menu-link',
+
            MENU_SELECTOR = '.pure-menu-children',
+
            DISMISS_EVENT = (window.hasOwnProperty &&
+
                window.hasOwnProperty('ontouchstart')) ?
+
                    'touchstart' : 'mousedown',
+
 
+
            ARROW_KEYS_ENABLED = true,
+
 
+
            ddm = this; // drop down menu
+
 
+
            this._state = MENU_CLOSED;
+
 
+
            this.show = function () {
+
                if (this._state !== MENU_OPEN) {
+
                    this._dropdownParent.classList.add(ACTIVE_CLASS_NAME);
+
                    this._menu.setAttribute(ARIA_HIDDEN, false);
+
                    this._state = MENU_OPEN;
+
                }
+
            };
+
 
+
            this.hide = function () {
+
                if (this._state !== MENU_CLOSED) {
+
                    this._dropdownParent.classList.remove(ACTIVE_CLASS_NAME);
+
                    this._menu.setAttribute(ARIA_HIDDEN, true);
+
                    this._link.focus();
+
                    this._state = MENU_CLOSED;
+
                }
+
            };
+
 
+
            this.toggle = function () {
+
                this[this._state === MENU_CLOSED ? 'show' : 'hide']();
+
            };
+
 
+
            this.halt = function (e) {
+
                e.stopPropagation();
+
                e.preventDefault();
+
            };
+
 
+
            this._dropdownParent = dropdownParent;
+
            this._link = this._dropdownParent.querySelector(MENU_LINK_SELECTOR);
+
            this._menu = this._dropdownParent.querySelector(MENU_SELECTOR);
+
            this._firstMenuLink = this._menu.querySelector(MENU_LINK_SELECTOR);
+
 
+
            // Set ARIA attributes
+
            this._link.setAttribute('aria-haspopup', 'true');
+
            this._menu.setAttribute(ARIA_ROLE, 'menu');
+
            this._menu.setAttribute('aria-labelledby', this._link.getAttribute('id'));
+
            this._menu.setAttribute('aria-hidden', 'true');
+
            [].forEach.call(
+
                this._menu.querySelectorAll('li'),
+
                function(el){
+
                    el.setAttribute(ARIA_ROLE, 'presentation');
+
                }
+
            );
+
            [].forEach.call(
+
                this._menu.querySelectorAll('a'),
+
                function(el){
+
                    el.setAttribute(ARIA_ROLE, 'menuitem');
+
                }
+
            );
+
 
+
            // Toggle on click
+
            this._link.addEventListener('click', function (e) {
+
                e.stopPropagation();
+
                e.preventDefault();
+
                ddm.toggle();
+
            });
+
 
+
            // Keyboard navigation
+
            document.addEventListener('keydown', function (e) {
+
                var currentLink,
+
                    previousSibling,
+
                    nextSibling,
+
                    previousLink,
+
                    nextLink;
+
 
+
                // if the menu isn't active, ignore
+
                if (ddm._state !== MENU_OPEN) {
+
                    return;
+
                }
+
 
+
                // if the menu is the parent of an open, active submenu, ignore
+
                if (ddm._menu.querySelector(MENU_ACTIVE_SELECTOR)) {
+
                    return;
+
                }
+
 
+
                currentLink = ddm._menu.querySelector(':focus');
+
 
+
                // Dismiss an open menu on ESC
+
                if (e.keyCode === 27) {
+
                    /* Esc */
+
                    ddm.halt(e);
+
                    ddm.hide();
+
                }
+
                // Go to the next link on down arrow
+
                else if (ARROW_KEYS_ENABLED && e.keyCode === 40) {
+
                    /* Down arrow */
+
                    ddm.halt(e);
+
                    // get the nextSibling (an LI) of the current link's LI
+
                    nextSibling = (currentLink) ? currentLink.parentNode.nextSibling : null;
+
                    // if the nextSibling is a text node (not an element), go to the next one
+
                    while (nextSibling && nextSibling.nodeType !== 1) {
+
                        nextSibling = nextSibling.nextSibling;
+
                    }
+
                    nextLink = (nextSibling) ? nextSibling.querySelector('.pure-menu-link') : null;
+
                    // if there is no currently focused link, focus the first one
+
                    if (!currentLink) {
+
                        ddm._menu.querySelector('.pure-menu-link').focus();
+
                    }
+
                    else if (nextLink) {
+
                        nextLink.focus();
+
                    }
+
                }
+
                // Go to the previous link on up arrow
+
                else if (ARROW_KEYS_ENABLED && e.keyCode === 38) {
+
                    /* Up arrow */
+
                    ddm.halt(e);
+
                    // get the currently focused link
+
                    previousSibling = (currentLink) ? currentLink.parentNode.previousSibling : null;
+
                    while (previousSibling && previousSibling.nodeType !== 1) {
+
                        previousSibling = previousSibling.previousSibling;
+
                    }
+
                    previousLink = (previousSibling) ? previousSibling.querySelector('.pure-menu-link') : null;
+
                    // if there is no currently focused link, focus the last link
+
                    if (!currentLink) {
+
                        ddm._menu.querySelector('.pure-menu-item:last-child .pure-menu-link').focus();
+
                    }
+
                    // else if there is a previous item, go to the previous item
+
                    else if (previousLink) {
+
                        previousLink.focus();
+
                    }
+
                }
+
            });
+
 
+
            // Dismiss an open menu on outside event
+
            document.addEventListener(DISMISS_EVENT, function (e) {
+
                var target = e.target;
+
                if (target !== ddm._link && !ddm._menu.contains(target)) {
+
                    ddm.hide();
+
                    ddm._link.blur();
+
                }
+
            });
+
  
 +
<script type="text/javascript" >
 +
    function Show(tagId) {
 +
    if (document.getElementById(tagId).style.display=="none") {
 +
    document.getElementById(tagId).style.display="block";
 +
   
 +
    }
 +
    else {
 +
    document.getElementById(tagId).style.display="none";
 
     }
 
     }
 
    function initDropdowns() {
 
        var dropdownParents = document.querySelectorAll('.pure-menu-has-children');
 
        for (var i = 0; i < dropdownParents.length; i++) {
 
            var ddm = new PureDropdown(dropdownParents[i]);
 
        }
 
 
     }
 
     }
 
    initDropdowns();
 
 
}(this, this.document));
 
 
 
</script>
 
</script>
 
 
</body>
 
</body>
 
</html>
 
</html>

Latest revision as of 02:17, 2 November 2017

Team:NUDT_CHINA