Difference between revisions of "Team:UCL/Bactoman"

Line 4: Line 4:
 
<head>
 
<head>
  
<style type="text/javascript">
+
<script language="JavaScript">
+
<!--
(function(){
+
 
+
/* Here you make an array with all the URL's of the images you would like to have in your slideshow.*/
var counter = 0,
+
 
$items = document.querySelectorAll('.diy-slideshow figure'),
+
var image = new Array("/wiki/images/8/8d/UCLbactoman1.png", "/wiki/images/9/92/UCLbactoman2.png",  
numItems = $items.length;
+
"/wiki/images/a/af/Uclbactoman3.png", "/wiki/images/f/fb/Uclbactoman4.png")
+
 
var showCurrent = function(){
+
var imgNumber=1
var itemToShow = Math.abs(counter%numItems);
+
 
+
/* This number is used to refer to a value of the Array and to know what image should be shown next. */
[].forEach.call( $items, function(el){
+
 
el.classList.remove('show');
+
 
});
+
var numberOfImg = image.length
+
 
$items[itemToShow].classList.add('show');
+
/* This is the total amount of images you use, it is used to determine if the imgNumber can still grow. */
};
+
 
+
 
document.querySelector('.next').addEventListener('click', function() {
+
/* Now it's time to make the functions for the next and previous buttons */
counter++;
+
 
showCurrent();
+
function previousImage(){
}, false);
+
  if(imgNumber > 1){
+
    imgNumber--
document.querySelector('.prev').addEventListener('click', function() {
+
    }
counter--;
+
showCurrent();
+
/* The if statement is used to know if you aren't already at the first image, because if you are, imgNumber may not decrease. */
}, false);
+
+
})();
+
 
   
 
   
 +
  else{
 +
  imgNumber = numberOfImg
 +
}
 +
 +
/* If you already are at the first image, and you click the previous button, the slideshow must show the last image. */
 +
 +
 +
  document.slideImage.src = image[imgNumber-1]
 +
 
 +
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
 +
 +
 +
  }
 +
function nextImage(){
 +
  if(imgNumber < numberOfImg){
 +
    imgNumber++
 +
    }
 +
 +
/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */
 +
 +
  else{
 +
  imgNumber = 1
 +
}
 +
 +
/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */
 +
 +
 +
  document.slideImage.src = image[imgNumber-1]
 +
 
 +
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
 +
 +
 +
  }
 +
 
 +
 
 +
/* Now it is time for the code that preloads the images. */
 +
 +
/* Check if your browser supports the Image Object. */
 +
 +
if(document.images){
  
  
 +
  /* Create a new Image Object. */
 +
 
 +
  var image1 = new Image()
 +
 
 +
 
 +
  /* Give the source of the image to the Image Object. */
 +
 
 +
  image1.src = "/wiki/images/8/8d/UCLbactoman1.png"
 +
 
 +
 
 +
  /* Repeat this for all the images you would like to preload.
 +
 
 +
  Make sure that you do not preload too many images, this will make your document load slow. */
 +
  var image2 = new Image()
 +
  image2.src = "/learn/javascript/Apple.jpg"
 +
  var image3 = new Image()
 +
  image3.src = "/learn/javascript/Linux.png"
 +
  var image4 = new Image()
 +
  image4.src = "/learn/javascript/Windows.jpg"
 +
  }
 +
 
 +
//-->
 
</script>
 
</script>
  
Line 409: Line 468:
 
letter-spacing: 2px;
 
letter-spacing: 2px;
 
}
 
}
 
 
.diy-slideshow{
 
  position: relative;
 
  display: block;
 
  overflow: hidden;
 
}
 
figure{
 
  position: absolute;
 
  opacity: 0;
 
  transition: 1s opacity;
 
}
 
figcaption{
 
  position: absolute;
 
  font-family: sans-serif;
 
  font-size: .8em;
 
  bottom: .75em;
 
  right: .35em;
 
  padding: .25em;
 
  color: #fff;
 
  background: rgba(0,0,0, .25);
 
  border-radius: 2px;
 
}
 
figcaption a{
 
  color: #fff;
 
}
 
figure.show{
 
  opacity: 1;
 
  position: static;
 
  transition: 1s opacity;
 
}
 
.next, .prev{
 
  color: #fff;
 
  position: absolute;
 
  background: rgba(0,0,0, .6);
 
  top: 50%;
 
  z-index: 1;
 
  font-size: 2em;
 
  margin-top: -.75em;
 
  opacity: .3;
 
  user-select: none;
 
}
 
.next:hover, .prev:hover{
 
  cursor: pointer;
 
  opacity: 1;
 
}
 
.next{
 
  right: 0;
 
  padding: 10px 5px 15px 10px;
 
  border-top-left-radius: 3px;
 
  border-bottom-left-radius: 3px;
 
}
 
.prev{
 
  left: 0;
 
  padding: 10px 10px 15px 5px;
 
  border-top-right-radius: 3px;
 
  border-bottom-right-radius: 3px;
 
}
 
 
  
  
Line 488: Line 488:
  
  
<div class="diy-slideshow">
+
<table>
    <figure class="show">
+
<tr>
        <img name="https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png" width="100%" /><figcaption></figcaption>
+
<td> <img name="https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png" name="slideImage"></td>
    </figure>
+
</tr>
  <figure>
+
<tr>
    <img src="http://themarklee.com/wp-content/uploads/2013/12/starlight.jpg" width="100%" /><figcaption>"Starlight" by <a href="http://www.flickr.com/photos/chaoticmind75/10738494123/in/set-72157626146319517">ChaoticMind75</a>.</figcaption>  
+
<td><a href="JavaScript:previousImage()">Previous</a></td><td><a href="JavaScript:nextImage()">Next</a></td>
    </figure>
+
</tr>
    <figure>
+
</table>
        <img src="http://themarklee.com/wp-content/uploads/2013/12/snowstorm.jpg" width="100%" /><figcaption>"Snowstorm" by <a href="http://www.flickr.com/photos/tylerbeaulawrence/8539457508/">Beaulawrence</a>.</figcaption>  
+
    </figure>
+
  <figure>
+
        <img src="http://themarklee.com/wp-content/uploads/2013/12/misty-winter-afternoon.jpg" width="100%" /><figcaption>"Misty winter afternoon" by <a href="http://www.flickr.com/photos/22746515@N02/5277611659/">Bert Kaufmann</a>.</figcaption>
+
    </figure>
+
  <figure>
+
        <img src="http://themarklee.com/wp-content/uploads/2013/12/good-morning.jpg" width="100%" /><figcaption>"Good Morning!" by <a href="http://www.flickr.com/photos/frank_wuestefeld/4306107546/">Frank Wuestefeld</a>.</figcaption>
+
    </figure>
+
  <figure>
+
        <img src="http://themarklee.com/wp-content/uploads/2013/12/driving-home-for-christmas.jpg" width="100%" /><figcaption>"Driving home for Christmas" by <a href="http://www.flickr.com/photos/22746515@N02/5292186041/">Bert Kaufmann</a>.</figcaption>
+
    </figure>
+
  <span class="prev">&laquo;</span>
+
  <span class="next">&raquo;</span>
+
</div>
+
  
  
  
<div style="width: 90%; margin: auto;">
 
</div>
 
  
  

Revision as of 20:30, 31 October 2015

'

Bactoman is a comic aimed to introduce our project to a younger audience. Set in a dystopian future where the mentally ill are excommunicated and abandoned by the society, Nathan Navaro takes the mantle of Bactoman to challenge the broken society. Bactoman utilises synthetic biology to help people with mental disorders!

PreviousNext