Template:Team:Edinburgh/Code

From 2013.igem.org

(Difference between revisions)
 
(90 intermediate revisions not shown)
Line 15: Line 15:
   font-family: Arial, Times, serif;
   font-family: Arial, Times, serif;
   font-size: 12pt;
   font-size: 12pt;
-
}
 
-
 
 
-
h2 {
 
-
color: #2b6196;
 
}
}
h2 {
h2 {
-
color: #2b6196;
+
color: #3b71b6;
-
  font-size: 120%;
+
  font-size: 130%;
}
}
Line 31: Line 27:
   text-align: center;
   text-align: center;
   line-height: 40px;
   line-height: 40px;
 +
}
 +
.toc{
 +
display: none;
 +
}
 +
 +
.right {
 +
float: right;
 +
cursor: deafault;
 +
margin-right: 10px;
 +
margin-top: 10px;
 +
vertical-align: top;
 +
}
 +
 +
 +
#flags{
 +
float:right;
}
}
Line 45: Line 57:
   min-height: 500px;
   min-height: 500px;
   text-align: justify;
   text-align: justify;
 +
}
 +
 +
.content img {
 +
text-align: center;
}
}
Line 60: Line 76:
background-color: #2b6196;
background-color: #2b6196;
 +
}
 +
 +
.counter {
 +
margin: 10px;
 +
margin-top: 30px;
 +
text-align: center;
 +
  font-weight: bold !important;
 +
}
 +
 +
 +
.counter a {
 +
color: #2b6196;
}
}
Line 65: Line 93:
   font-family: Perpetua, serif;
   font-family: Perpetua, serif;
   font-size: 150%;
   font-size: 150%;
 +
}
 +
 +
.gallery {
 +
border: 8px solid #fbc089;
 +
border-radius: 10px;
 +
margin-top: 30px;
 +
margin-left: -2px !important;
 +
margin-right: 8px;
 +
}
 +
.gallery p{
 +
margin: 0px
}
}
Line 71: Line 110:
}
}
 +
.social {
 +
margin-top: 30px;
 +
margin-right: 10px;
 +
text-align: center;
 +
  font-size: 150%;
 +
}
 +
 +
.social a, .social a:visited {
 +
color: #2b6196 !important;
 +
text-decoration: underline;
 +
}
 +
 +
.social p {
 +
  margin: 0px;
 +
}
 +
.menu {
.menu {
     background-color: #fff;
     background-color: #fff;
Line 89: Line 144:
table {
table {
   border-collapse: collapse;
   border-collapse: collapse;
 +
}
 +
 +
.members_table td {
 +
vertical-align: middle;
}
}
Line 115: Line 174:
#side_menu a, #side_menu a:visited{
#side_menu a, #side_menu a:visited{
-
   color: #207010;
+
   color: #106000;
   text-decoration: none;
   text-decoration: none;
}
}
Line 126: Line 185:
     margin-right: 10px;
     margin-right: 10px;
     font-size: 14pt;
     font-size: 14pt;
 +
     font-weight: bold;
     font-weight: bold;
     display: block;
     display: block;
Line 131: Line 191:
     border-radius: 10px;
     border-radius: 10px;
background-color: #acd8a6;
background-color: #acd8a6;
-
padding: 7px;
+
padding: 3px;
-
padding-left: 12px;
+
padding-right: 5px;
 +
padding-left: 10px;
margin-bottom: 5px;
margin-bottom: 5px;
}  
}  
Line 145: Line 206:
.home_side_menu_item a {
.home_side_menu_item a {
   color: #003366 !important;
   color: #003366 !important;
 +
 +
}
 +
.home_side_menu_item .selflink {
 +
  color: #904400 !important;
 +
  margin-right: 6px !important;
}
}
Line 151: Line 217:
  list-style-type: disc;
  list-style-type: disc;
  list-style-image: none;
  list-style-image: none;
 +
}
 +
 +
li {
 +
line-height: 1.5em;
}
}
Line 156: Line 226:
     display: none;
     display: none;
     left: -20px;
     left: -20px;
-
     margin-top: 10px;
+
     margin-top: 5px;
}
}
Line 195: Line 265:
   position: relative;
   position: relative;
   display: block;
   display: block;
 +
}
 +
 +
.side_menu_item a{
 +
  margin-right: 6px;
}
}
Line 210: Line 284:
   color : #2b6196;
   color : #2b6196;
  font-weight: bold;
  font-weight: bold;
 +
margin-right: 6px;
}
}
Line 262: Line 337:
.backToTop a:visited{
.backToTop a:visited{
color: #2b6196;
color: #2b6196;
 +
}
 +
 +
.menu_button {
 +
  display: none;
 +
}
 +
 +
.selflink {
 +
  color: #001f3d !important;
 +
  cursor: default !important;
 +
margin-right: 6px;
 +
  text-decoration: none !important;
}
}
Line 268: Line 354:
          
          
<script type="text/javascript">
<script type="text/javascript">
-
     
+
   
 +
$(function() {
 +
var touchscreen = ("ontouchstart" in document.documentElement);
 +
var active=1;
 +
var menu_buttons = $(".menu_button");
 +
$(menu_buttons).css("display", "table-cell");
 +
    for (var i=0; i< menu_buttons.length; i++) {
 +
    active=1;
 +
    var menu_links = $(menu_buttons[i]).children("a");
 +
    for (var j=0; j < menu_links.length; j++) {
 +
            if (menu_links[j].href.indexOf("Team:Edinburgh/") > -1) {
 +
                if (window.location.href.indexOf(menu_links[j].href) > -1) {
 +
                    active = 3;
 +
                }
 +
            } else if ($(".home_side_menu_item").length> 0 ) {
 +
active = 3;
 +
            }
 +
}
 +
$(menu_links).css("display", "none");
 +
    menu_links[active-1].style.display = "block";
 +
 +
if (active==3) {
 +
$(menu_buttons[i]).parent("tr").siblings(":last").children("td").filter(function(index) {return index==i}).children("a").addClass("selflink");
 +
}
 +
 
 +
if (touchscreen) continue;
 +
 +
menu_buttons[i].onmouseover = (function() {
 +
var children = $(menu_buttons[i]).children("a");
 +
return function() {
 +
$(children).css("display", "none");
 +
children[1].style.display = "block";
 +
}
 +
})();
 +
 +
menu_buttons[i].onmouseout = (function() {
 +
var children = $(menu_buttons[i]).children("a");
 +
return function() {
 +
active=1;
 +
for (var j=0; j < children.length; j++) {
 +
if (children[j].href.indexOf("Team:Edinburgh/") > -1) {
 +
if (window.location.href.indexOf(children[j].href) > -1) {
 +
active = 3;
 +
}
 +
} else if ($(".home_side_menu_item").length> 0 ) {
 +
active = 3;
 +
}
 +
}
 +
$(children).css("display", "none");
 +
children[active-1].style.display = "block";
 +
}
 +
})();
 +
}
 +
 
 +
    menu_links = $("#side_menu_items > li > a");
 +
 
 +
for (var j=0; j < menu_links.length; j++) {
 +
active=1;
 +
if (window.location.href.indexOf(menu_links[j].href, window.location.href.length-menu_links[j].href.length) > -1) {
 +
active = 3;
 +
}
 +
if (active==3) {
 +
$(menu_links[j]).addClass("selflink");
 +
}
 +
}    
 +
});
 +
 +
$(function() {
 +
 
 +
    $(".bagpipes").attr("src", "//www.youtube.com/embed/Z_AHBSvXHDM?rel=0");
 +
$(".genablerlinkers").attr("src", "http://www.genablerlinkers.appspot.com");
 +
$(".outreachvideo").attr("src", "//www.youtube.com/embed/t7wQX_EFrdY?rel=0");
 +
 
 +
});
 +
 +
var gallery_active_id = 0;
 +
 
$(function() {
$(function() {
     $(".selflink").parentsUntil($("#side_menu"), "li").children("ul").css("display","block");
     $(".selflink").parentsUntil($("#side_menu"), "li").children("ul").css("display","block");
 +
 +
});
 +
 +
$(function() {
 +
      $(".gallery img").css("display", "none");
 +
      if ($(".gallery img")[gallery_active_id]) $(".gallery img")[gallery_active_id].style.display="block";
 +
      setInterval("changeGalleryPic()", 5000) ; 
 +
 +
});
 +
 +
function changeGalleryPic() {
 +
      gallery_active_id += 1;
 +
      if (gallery_active_id >= $(".gallery img").length) gallery_active_id = 0;
 +
      $(".gallery img").css("display", "none");
 +
      if ($(".gallery img")[gallery_active_id]) $(".gallery img")[gallery_active_id].style.display="block";
 +
}
 +
 +
$(function() {
 +
 +
$("#flags img").css("cursor", "pointer");
 +
$("#flags img").css("cursor", "hand");
 +
 +
$("#languages").children("div").css("display", "none"); $("#english").css("display", "block");
 +
 +
    var english = $("#flags img")[0];
 +
    if(english) english.onclick=function() {$("#languages").children("div").css("display", "none"); $("#english").css("display", "block")};
 +
 +
    var french= $("#flags img")[1];
 +
    if(french) french.onclick=function() {$("#languages").children("div").css("display", "none"); $("#french").css("display", "block")};
 +
 +
var german= $("#flags img")[2];
 +
    if(german) german.onclick=function() {$("#languages").children("div").css("display", "none"); $("#german").css("display", "block")};
 +
 +
    var chinese = $("#flags img")[3];
 +
    if(chinese ) chinese .onclick=function() {$("#languages").children("div").css("display", "none"); $("#chinese ").css("display", "block")};
 +
 +
  var polish = $("#flags img")[4];
 +
    if(polish ) polish .onclick=function() {$("#languages").children("div").css("display", "none"); $("#polish ").css("display", "block")};
 +
 +
    var lithuanian= $("#flags img")[5];
 +
    if(lithuanian) lithuanian.onclick=function() {$("#languages").children("div").css("display", "none"); $("#lithuanian").css("display", "block")};
 +
 +
  var bulgarian = $("#flags img")[6];
 +
    if(bulgarian ) bulgarian .onclick=function() {$("#languages").children("div").css("display", "none"); $("#bulgarian ").css("display", "block")};
 +
 +
    var greek = $("#flags img")[7];
 +
    if(greek ) greek.onclick=function() {$("#languages").children("div").css("display", "none");
 +
$("#greek ").css("display", "block")};
 +
});
});
Line 282: Line 493:
     });
     });
-
$(function() {
+
 
-
  var touchscreen = ("ontouchstart" in document.documentElement);
+
-
  var menu_buttons = document.getElementsByClassName("menu_button");
+
-
  for (var i = 0; i < menu_buttons.length; i++) {
+
-
      var count = 0;
+
-
      var active=1;
+
-
      var children = menu_buttons[i].childNodes;
+
-
      for (var j=0; j< children.length; j++) {
+
-
          if (children[j].tagName == "A") {
+
-
            if (window.location.href.indexOf(children[j].href,window.location.href.length - children[j].href.length) > -1) {
+
-
                if (active==1) active = 3;
+
-
              }
+
-
          }
+
-
      }
+
-
      for (var j=0; j< children.length; j++) {
+
-
          if (children[j].tagName == "A") {
+
-
              var grandchildren = children[j].childNodes;
+
-
      for (var k=0; k< grandchildren.length; k++) {
+
-
if (grandchildren[k].tagName == "IMG") {
+
-
                    count = count + 1;
+
-
                    if (count==active) {
+
-
                        grandchildren[k].style.display = "block";
+
-
                    } else {
+
-
                        grandchildren[k].style.display = "none";
+
-
                    }
+
-
                }
+
-
              }
+
-
          }
+
-
      }
+
-
      if (touchscreen) continue;
+
-
      menu_buttons[i].onmouseover = (function() {
+
-
        var children = menu_buttons[i].childNodes;
+
-
        return function() {
+
-
            var count = 0;
+
-
            var active = 2;
+
-
            for (var j=0; j< children.length; j++) {
+
-
              if (children[j].tagName == "A") {
+
-
                    var grandchildren = children[j].childNodes;
+
-
            for (var k=0; k< grandchildren.length; k++) {
+
-
        if (grandchildren[k].tagName == "IMG") {
+
-
                          count = count + 1;
+
-
                          if (count==active) {
+
-
                              grandchildren[k].style.display = "block";
+
-
                          } else {
+
-
                              grandchildren[k].style.display = "none";
+
-
                          }
+
-
                        }
+
-
                    }
+
-
                }
+
-
              }
+
-
          }
+
-
      })();
+
-
    menu_buttons[i].onmouseout = (function() {
+
-
        var children = menu_buttons[i].childNodes;
+
-
        return function() {
+
-
            var count = 0;
+
-
            var active = 1;
+
-
            for (var j=0; j< children.length; j++) {
+
-
              if (children[j].tagName == "A") {
+
-
                    if (window.location.href.indexOf(children[j].href,window.location.href.length - children[j].href.length) > -1) {
+
-
                        if (active==1) active = 3;
+
-
                    }
+
-
                }
+
-
            }
+
-
            for (var j=0; j< children.length; j++) {
+
-
                if (children[j].tagName == "A") {
+
-
                    var grandchildren = children[j].childNodes;
+
-
            for (var k=0; k< grandchildren.length; k++) {
+
-
        if (grandchildren[k].tagName == "IMG") {
+
-
                          count = count + 1;
+
-
                          if (count==active) {
+
-
                              grandchildren[k].style.display = "block";
+
-
                          } else {
+
-
                              grandchildren[k].style.display = "none";
+
-
                          }
+
-
                        }
+
-
                    }
+
-
                }
+
-
              }
+
-
          }
+
-
      })();     
+
-
  }
+
-
});
+
</script>  
</script>  
Line 537: Line 666:
   }
   }
});
});
 +
 +
</script>
</script>

Latest revision as of 00:27, 5 October 2013