Difference between revisions of "Team:Cardiff Wales/gallery"

Line 1: Line 1:
 
{{Cardiff_Wales/footer}}
 
{{Cardiff_Wales/footer}}
 
{{Cardiff_Wales/navigationbar}}
 
{{Cardiff_Wales/navigationbar}}
 +
<!DOCTYPE html>
 
<html>
 
<html>
<head>
+
<title>W3.CSS</title>
 +
<meta name="viewport" content="width=device-width, initial-scale=1">
 +
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
 
<style>
 
<style>
div.gallery {
+
.mySlides {display:none}
    margin: 5px;
+
.w3-left, .w3-right, .w3-badge {cursor:pointer}
    border: 1px solid #ccc;
+
.w3-badge {height:13px;width:13px;padding:0}
    float: left;
+
    width: 180px;
+
}
+
 
+
div.gallery:hover {
+
    border: 1px solid #777;
+
}
+
 
+
div.gallery img {
+
    width: 100%;
+
    height: auto;
+
}
+
 
+
div.desc {
+
    padding: 15px;
+
    text-align: center;
+
}
+
 
</style>
 
</style>
</head>
 
<div class="maincontent">
 
 
<body>
 
<body>
<center>
 
<h1> Gallery </h1>
 
</center>
 
<br><br><br><br><br>
 
  
<div class="gallery">
+
<div class="w3-container">
   <a target="_blank" href="https://static.igem.org/mediawiki/2018/e/e9/T--Cardiff_Wales--LilyAvatar.png">
+
   <h2>Slideshow Indicators</h2>
    <img src="https://static.igem.org/mediawiki/2018/e/e9/T--Cardiff_Wales--LilyAvatar.png" alt="LilyAvatar" width="600" height="400">
+
   <p>An example of using buttons to indicate how many slides there are in the slideshow, and which slide the user is currently viewing.</p>
   </a>
+
  <div class="desc">Lily's avatar as a placeholder</div>
+
 
</div>
 
</div>
  
<div class="gallery">
+
<div class="w3-content w3-display-container" style="max-width:800px">
   <a target="_blank" href="https://static.igem.org/mediawiki/2018/8/85/T--Cardiff_Wales--Aphidlogo.png">
+
   <img class="mySlides" src="img_nature_wide.jpg" style="width:100%">
     <img src="https://static.igem.org/mediawiki/2018/8/85/T--Cardiff_Wales--Aphidlogo.png" alt="Logo" width="600" height="400">
+
  <img class="mySlides" src="img_snow_wide.jpg" style="width:100%">
  </a>
+
  <img class="mySlides" src="img_mountains_wide.jpg" style="width:100%">
  <div class="desc">Our logo as a placeholder</div>
+
  <div class="w3-center w3-container w3-section w3-large w3-text-white w3-display-bottommiddle" style="width:100%">
 +
     <div class="w3-left w3-hover-text-khaki" onclick="plusDivs(-1)">&#10094;</div>
 +
    <div class="w3-right w3-hover-text-khaki" onclick="plusDivs(1)">&#10095;</div>
 +
    <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(1)"></span>
 +
    <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(2)"></span>
 +
    <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(3)"></span>
 +
  </div>
 
</div>
 
</div>
  
 +
<script>
 +
var slideIndex = 1;
 +
showDivs(slideIndex);
 +
 +
function plusDivs(n) {
 +
  showDivs(slideIndex += n);
 +
}
 +
 +
function currentDiv(n) {
 +
  showDivs(slideIndex = n);
 +
}
 +
 +
function showDivs(n) {
 +
  var i;
 +
  var x = document.getElementsByClassName("mySlides");
 +
  var dots = document.getElementsByClassName("demo");
 +
  if (n > x.length) {slideIndex = 1}   
 +
  if (n < 1) {slideIndex = x.length}
 +
  for (i = 0; i < x.length; i++) {
 +
    x[i].style.display = "none"; 
 +
  }
 +
  for (i = 0; i < dots.length; i++) {
 +
    dots[i].className = dots[i].className.replace(" w3-white", "");
 +
  }
 +
  x[slideIndex-1].style.display = "block"; 
 +
  dots[slideIndex-1].className += " w3-white";
 +
}
 +
</script>
  
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 20:04, 3 September 2018

<!DOCTYPE html> W3.CSS

Slideshow Indicators

An example of using buttons to indicate how many slides there are in the slideshow, and which slide the user is currently viewing.