Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"

 
(165 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<html>
 
<html>
<style>
+
 
body {
+
<script>
   font-family: 'Arial, Helvetica, sans-serif';
+
function toggle_nav(btn) {
   color: black;
+
   var ctt = $('#content')[0]
  background-color: #FFFFFF;
+
   ctt.classList.toggle('nav-toggle')
 
}
 
}
#top_menu_under {
+
function toc_loop() {
   border-bottom: 0px;
+
   var TOP = window.pageYOffset + 50;
 +
  var headings = $('#toc ~ h2 > span:last-child, #toc ~ h3 >  span:last-child');
 +
  if (headings.length == 0) return
 +
 
 +
  for (var i = 0; i < headings.length; i++) {
 +
    var h = headings[i];
 +
    var top = $(h).offset().top;
 +
    if (top > TOP ) break
 +
  }
 +
  if (i > 0) h = headings[i-1]
 +
  //set h as reading part
 +
  var id = h.id;
 +
 
 +
  var prev_a = $('#toc a.reading');
 +
  var a = $('a[href="#'+ id +'"]');
 +
  prev_a.removeClass('reading');
 +
  a.addClass('reading');
 
}
 
}
#top_menu_14 {
+
function init() {
   border-bottom: 0px;
+
   $('#toc div#toctitle + ul a').click(
 +
    function(evnt){
 +
      var a = evnt.currentTarget;
 +
      var id = a.attributes["href"].value;
 +
      var ele = document.getElementById(id.slice(1, id.length));
 +
      var top = ele.offsetTop, docEle =  document.documentElement
 +
      var pageHeight = docEle.offsetHeight, windowHeight =  docEle.clientHeight
 +
 
 +
      if ((pageHeight - top) > windowHeight) setTimeout ("scrollBy(0, -20)", 10);
 +
    }
 +
  )
 +
 
 +
  setInterval("toc_loop()", 10);
 
}
 
}
#top_menu_inside {
+
 
   border-left: 0px;
+
$(document).ready(init)
   border-right: 0px;
+
</script>
   }
+
<style>
a:visited{
+
/* test BEGIN */
   color: #91B798;
+
h1.firstHeading{
 +
  display: none;
 +
}
 +
/* test END */
 +
/* color & font BEGIN */
 +
nav #hide-nav {
 +
   background-color: rgba(185,217,137,0.5);
 +
}
 +
nav #hide-nav svg * {
 +
   fill: #109E52;
 +
}
 +
nav {
 +
  background-image: url(/wiki/images/9/98/SJTUB_shade.png);
 +
   background-repeat: repeat;
 +
}
 +
nav, nav > ul > li:not(:first-child) a {
 +
  color: #109E52;
 +
}
 +
nav > ul > li:not(:first-child) li a {
 +
   background-color: #647E6A;
 +
  opacity: 0.85;
 +
}
 +
nav > ul > li:first-child  a{
 +
  color: white;
 
}
 
}
  
 +
nav {
 +
  font-family: "Tahoma, Geneva, sans-serif";
 +
}
  
/* layout BEGIN */
+
nav a {
#content {
+
   font-family: Arial;
   width: 100%;
+
   font-size: 1em;
   height: 100%;
+
   font-weight: 800;
   padding-left: 300px;
+
   text-transform: uppercase;
   padding-top: 20px;
+
 
}
 
}
  
 +
nav a:hover {
 +
  text-decoration: none;
 +
}
 +
nav > ul > li:not(:first-child) a:hover {
 +
  background-color: #FFFFFF;
 +
}
 +
 +
nav > ul > li:first-child > a {
 +
  background-color: rgba(87,172,101,0.8);
 +
}
 
nav {
 
nav {
  /* layout */
 
 
   position: fixed;
 
   position: fixed;
 
   top: 0px;
 
   top: 0px;
 
   left: 0px;
 
   left: 0px;
 +
  box-sizing: border-box;
 
   height: 100%;
 
   height: 100%;
   width: 250px;
+
   width: 14.5em;
 
   padding-top: 20px;
 
   padding-top: 20px;
   padding-right: 30px;
+
   padding-left: 1em;
 
   overflow: visible;
 
   overflow: visible;
 +
}
 +
.nav-toggle nav {
 +
  left: -15em;
 
}
 
}
  
nav > div:first-child {
+
nav svg {
   display: block;
+
  margin: auto;
   height: 80px;
+
  transform: matrix(1,0,0,1,0,0);
   text-align: center;
+
}
   line-height: 80px;
+
.nav-toggle nav svg {
 +
  transform: matrix(-1,0,0,1,0,0);
 +
}
 +
nav > * {
 +
  z-index: 1;
 +
}
 +
nav #hide-nav {
 +
   position: fixed;
 +
  top: 0px;
 +
  left: 0px;
 +
  width: 1em;
 +
   height: 100%;
 +
   z-index = 2;  
 +
}
 +
nav #hide-nav svg{
 +
   poiner-events: none;
 +
  position: absolute;
 +
  top: 50%;
 +
  left: 0.5px;
 +
  height: 40px;
 +
  margin-top: -20px;
 
}
 
}
  
Line 51: Line 137:
 
   margin: 0px;
 
   margin: 0px;
 
   padding: 0px;
 
   padding: 0px;
  padding-top: 1px;
 
  padding-bottom: 1px;
 
 
   list-style: none;
 
   list-style: none;
 
   width: 100%;
 
   width: 100%;
 +
}
 +
nav > ul {
 +
  margin-top: 7em;
 
}
 
}
 
nav > ul ul {
 
nav > ul ul {
Line 60: Line 147:
 
   padding: 0px;
 
   padding: 0px;
 
   top: 0px;
 
   top: 0px;
   left: 280px;
+
   left: 14.1em;
 
   height: 0px;
 
   height: 0px;
 
   width: 0px;
 
   width: 0px;
 
   overflow: hidden;
 
   overflow: hidden;
 +
  color: #FFFFFF;
 +
}
 +
nav > ul > ul > li a{
 +
  color: #FFFFFF;
 +
}
 +
nav > ul > ul > li:not(:first-child) a {
 +
  color: #FFFFFF;
 
}
 
}
 
nav > ul > li:hover ul, nav > ul > li ul:hover {
 
nav > ul > li:hover ul, nav > ul > li ul:hover {
   height: initial;
+
   height: 9em;
   width: initial;
+
   width: 14em;
 
}
 
}
nav > ul li {
+
nav li {
 
   margin-top: 0px;
 
   margin-top: 0px;
   margin-bottom: 1px;
+
   margin-bottom: 0px;
 
}
 
}
 
nav li:last-child {
 
nav li:last-child {
Line 82: Line 176:
 
nav a {
 
nav a {
 
   display: block;
 
   display: block;
   padding-left: 40px;
+
   padding-left: 2em;
   height: 45px;
+
   height: 4em;
   line-height: 45px;
+
   line-height: 4em;
 
}
 
}
 
nav > ul ul a {
 
nav > ul ul a {
   padding-left: 20px;
+
   padding-left: 1em;
   width: 230px;
+
   width: 15em;
 
}
 
}
/* layout END */
+
nav > ul > li > a:not(:last-child)::before {
 +
  content: "+";
 +
  position: absolute;
 +
  left: 0.5em;
 +
}
 +
/* color & font END */
  
  
/* color & font BEGIN */
+
 
nav {
+
/* layout BEGIN */
   background-color: #EEE;
+
body {
   color: #91B798;
+
   font-family: Trebuchet MS,"Helvetica Neue",Helvetica,Arial;
   font-family: "Tahoma, Geneva, sans-serif";
+
   color: black;
 +
   background-color: #FFFFFF;
 
}
 
}
nav > div:first-child {
+
h2{
   font-family: "Tahoma, Geneva, sans-serif";
+
  color:#FEFEFE;
   font-size: 2.2em;
+
  background-color:#57AB65;
 +
   font-size:500;
 +
  letter-spacing:-0.05em;
 +
   font-size:2em;
 
}
 
}
nav ul {
+
h3{
   background-color: #71B798;
+
   color:#57AB65;
 +
  font-weight:500;
 +
  font-size:2em;
 +
  letter-spacing:-0.05em;
 
}
 
}
nav > ul {
+
p{
 +
  color:#003219;
 +
  font-weight:400;
 +
  font-size:1.3em;
 
}
 
}
nav > ul ul {
+
a:link {
 +
  color: #109E52;
 +
}
 +
a:visited {
 +
  color: #8aa28e;
 
}
 
}
nav li {
+
#toc ul a{
   background-color: #EEE;
+
   font-family: Trebuchet MS,"Helvetica Neue",Helvetica,Arial;
 +
  border-left-color: #109E52;
 +
}
 +
#toc ul a.reading {
 +
  border-left-color: #5f7963;
 +
}
 +
#top_menu_under {
 +
  border-bottom: 0px;
 +
}
 +
#top_menu_14 {
 +
  border-bottom: 0px;
 +
}
 +
#top_menu_inside {
 +
  border-left: 0px;
 +
  border-right: 0px;
 
}
 
}
  
nav a {
+
#toc {
   font-family: "Tahoma, Geneva, sans-serif";
+
  position: fixed;
   text-transform: uppercase;
+
  right: 1em;
 +
  top: 10em;
 +
  width: 16em;
 +
   font-size: 0.6em;
 +
   border: 0px;
 +
  background: white;
 
}
 
}
nav > ul > li:first-child > a {
+
#toc .tocnumber {
   background-color: #00CC99;
+
  display: none;
 +
}
 +
#toc * {
 +
  margin-top: 0px;
 +
  margin-bottom: 0px;
 +
}
 +
#toc ul ul {
 +
  margin-left: 0px;
 +
}
 +
#toc ul a {
 +
   border-left: 0.4em solid;
 +
  padding:0.4em 0 0.4em 0.8em;
 +
  font-weight:700;
 +
}
 +
#toc ul ul a {
 +
  padding-left:1.5em;
 +
  font-weight:500;
 
}
 
}
/* color & font END */
 
  
 +
#content {
 +
  box-sizing: border-box;
 +
  width: 100%;
 +
  height: 100%;
 +
  padding-left: 17em;
 +
  padding-right: 2em;
 +
  padding-top: 20px;
 +
}
 +
#content.nav-toggle {
 +
  padding-left: 4em;
 +
}
 +
p img{
 +
  float:right;
 +
  margin-left:2em;
 +
  margin-bottom:2em;
 +
}
 +
article#mainArticle{
 +
  width:80%;
 +
}
 +
p{
 +
  text-align:justify;
 +
}
 +
/* layout END */
 +
 +
 +
 +
/* animation BEGIN */
 +
nav {
 +
  transition: left 0.4s;
 +
}
 +
#content {
 +
  transition: padding-left 0.4s;
 +
}
  
/* animation BEGIN
 
 
nav > ul ul {
 
nav > ul ul {
   transition: opacity 0.4s, height 0.2s, width 0.1s;
+
   transition: opacity 0.3s, height 0.3s, width 0.3s;
   transition-delay: 0.5s;
+
   transition-delay: 0.2s;
 
   opacity: 0;
 
   opacity: 0;
 
}
 
}
Line 134: Line 313:
 
   opacity: 0.99;
 
   opacity: 0.99;
 
}
 
}
animation END */
+
nav a {
 +
  transition: background-color 0.1s;
 +
}
 +
/* animation END */
  
 
</style>
 
</style>
  
 
     <nav>
 
     <nav>
       <div>SJTU Bio-X</div>
+
       <div id="hide-nav" onclick="toggle_nav(this)"><svg width="6px" height="24px"><polygon points="6,0 0,12 6,24"/></svg></div>
 +
      <div id="shade"></div>
 
       <ul>
 
       <ul>
 
<li><a href="#">home</a></li>
 
<li><a href="#">home</a></li>
Line 150: Line 333:
 
  </ul>
 
  </ul>
 
</li>
 
</li>
 +
        <li><a href="#">notebooks</a></li>
 +
<li><a href="#">safety</a></li>
 +
<li><a href="#">parts</a></li>
 
<li><a href="#">modeling</a></li>
 
<li><a href="#">modeling</a></li>
 
<li>
 
<li>
  <a href="#">parts</a>
+
  <a href="#" >human practices</a>
</li>
+
<li><a href="#">notebooks</a></li>
+
<li><a href="#">safety</a></li>
+
<li>
+
  <a href="#">human practices</a>
+
 
  <ul>
 
  <ul>
 
    <li><a href="#">process flow</a></li>
 
    <li><a href="#">process flow</a></li>
Line 164: Line 345:
 
  </ul>
 
  </ul>
 
</li>
 
</li>
<li><a href="#">team</a></li>
+
<li><a href="#">self-judging</a></li>
 +
        <li>
 +
  <a href="#">team</a>
 +
  <ul>
 +
    <li><a href="#">team members</a></li>
 +
    <li><a href="#">attribution</a></li>
 +
  </ul>
 +
</li>
 
       </ul>
 
       </ul>
 
     </nav>
 
     </nav>
 +
 +
  <article id="mainArticle">
 
</html>
 
</html>

Latest revision as of 07:41, 21 August 2015