Difference between revisions of "Team:Technion HS Israel/teamGallery"

(Replaced content with "{{Technion_HS_Israel4}} <html> <link href="//2015.igem.org/Template:Technion_HS_Israel4/Technion_HS_Israel_menu_style?action=raw&ctype=text/css" <rel="stylesheet"> <ifram...")
Line 3: Line 3:
 
<link href="//2015.igem.org/Template:Technion_HS_Israel4/Technion_HS_Israel_menu_style?action=raw&ctype=text/css" <rel="stylesheet">
 
<link href="//2015.igem.org/Template:Technion_HS_Israel4/Technion_HS_Israel_menu_style?action=raw&ctype=text/css" <rel="stylesheet">
  
<html lang="en">
+
<iframe id='iframe' src='//flickrit.com/slideshowholder.php?height=600&width=800&size=big&userId=135532117@N02&click=true&caption=true&credit=1&theme=1&thumbnails=1&transition=0&layoutType=fixed&sort=0' scrolling='no' frameborder='0' width='800' height='610'></iframe>
<head>
+
<meta charset="utf-8">
+
<title>Slideshow holder</title>
+
<style>
+
.galleria-info-description>a{
+
color:white !important;
+
}
+
</style>
+
<style>
+
/* include the styles here from the .css file that could change */
+
body {
+
background-color:#fff;
+
}
+
.galleria-container {
+
position: relative;
+
overflow: hidden;
+
background: #fff;
+
}
+
.galleria-stage {
+
position: absolute;
+
top:  12px;
+
bottom: 72px;
+
left: 10px;
+
right: 10px;
+
overflow:hidden;
+
}
+
.galleria-thumbnails-container {
+
height: 50px;
+
bottom: 10px;
+
position: absolute;
+
left: 10px;
+
right: 10px;
+
z-index: 2;
+
}
+
.galleria-carousel .galleria-thumbnails-list {
+
margin-left: 30px;
+
margin-right: 30px;
+
}
+
.galleria-thumbnails .galleria-image {
+
height: 40px;
+
width: 60px;
+
background: #000;
+
margin: 0 5px 0 0;
+
border: 0px solid #000;
+
float: left;
+
cursor: pointer;
+
}
+
.galleria-thumb-nav-left, .galleria-thumb-nav-right {
+
cursor: pointer;
+
display: none;
+
background-position: -495px 5px;
+
position: absolute;
+
left: 0;
+
top: 0;
+
height: 40px;
+
width: 23px;
+
z-index: 3;
+
opacity: .8;
+
filter: alpha(opacity=80);
+
}
+
.galleria-thumb-nav-right {
+
background-position: -578px 5px;
+
border-right: none;
+
right: 0;
+
left: auto;
+
}
+
.galleria-credit {
+
color:#333;
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+
font-size:57%;
+
 
+
bottom: 5px;
+
position: absolute;
+
+
right: 20px;
+
z-index: 4;
+
}
+
a:link, a:visited, a:active, a:focus {
+
color:#333;
+
}
+
a:hover {
+
color:#3b9f3b;
+
}
+
.content {
+
width:100%;
+
height:0px;
+
}
+
.galleria-info-link {
+
background-position: -669px -5px;
+
opacity: .7;
+
filter: alpha(opacity=70);
+
position: absolute;
+
width: 20px;
+
height: 20px;
+
cursor: pointer;
+
background-color: #fff;
+
}
+
#galleria {
+
width:100%;
+
max-width: 800px; height: 600px;}
+
.galleria-thumb-nav-left, .galleria-thumb-nav-right, .galleria-info-link, .galleria-info-close, .galleria-image-nav-left, .galleria-image-nav-right {
+
background-image: url(/themes/classic-map-dark.png);
+
background-repeat: no-repeat;
+
}
+
.galleria-image-nav-left, .galleria-image-nav-right {
+
opacity: 0.7;
+
filter: alpha(opacity=30);
+
cursor: pointer;
+
width: 62px;
+
height: 124px;
+
position: absolute;
+
left: 10px;
+
z-index: 2;
+
background-position: 0 46px;
+
}
+
.galleria-image-nav-right {
+
left: auto;
+
right: 10px;
+
background-position: -254px 46px;
+
z-index: 2;
+
}
+
.notouch .galleria-thumb-nav-left:hover, .notouch .galleria-thumb-nav-right:hover {
+
opacity: 1;
+
filter: alpha(opacity=100);
+
}
+
.touch .galleria-thumb-nav-left:active, .touch .galleria-thumb-nav-right:active {
+
opacity: 1;
+
filter: alpha(opacity=100);
+
}
+
 
+
.galleria-info {
+
top:  12px;
+
left: 10px;
+
right: 10px;
+
    z-index: 2;
+
    position: absolute;
+
}
+
 
+
</style>
+
 
+
<!-- load jQuery -->
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
+
 
+
<!-- load Galleria -->
+
<script src="//cdnjs.cloudflare.com/ajax/libs/galleria/1.4.2/galleria.min.js"></script>
+
 
+
<!-- load flickr plugin -->
+
<script src="js/galleria.flickr.min.js"></script>
+
<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-23877530-2', 'flickrit.com');
+
ga('send', 'pageview');
+
 
+
</script>
+
</head>
+
<body>
+
<div class="content">
+
 
+
  <!-- Adding gallery images. This is just a container for the dynamic flickr images -->
+
  <div id="galleria"></div>
+
</div>
+
<script>
+
window.onscroll = function() {
+
document.body.scrollTop = 0;
+
}
+
var speed = 5000;
+
var clickNext = true;
+
Galleria.loadTheme('themes/galleria.classic.min.js');
+
// handle image changing
+
+
/*
+
Note:
+
This is probably the most confusing part of the code... Galleria's option to link back to the image on Flickr
+
is broken, so I had to come up with a way to generate the correct URL for each picture in order to adhere to guidelines
+
It's just a bunch of string parsing in order to get a link that works
+
*/
+
+
Galleria.on('image', function(e){
+
            var img = e.imageTarget;
+
            var picSource = $(img).attr("src");
+
            if (picSource == undefined){
+
            picSource = $("img:first").attr("src");
+
            }
+
            var slashPieces = picSource.split("/"); 
+
            var lastSlash = (slashPieces[slashPieces.length -1]);
+
            var lastPieces = lastSlash.split("_");
+
            var newUrl = "http://flickr.com/photo.gne?id=" + lastPieces[0];
+
            $("#flick").attr("href", newUrl);
+
});
+
+
+
+
/*
+
Note:
+
Here's where the slideshow gets initialized, using a lot of PHP echos to fill in the appropriate values
+
*/
+
+
Galleria.run('#galleria',
+
{autoplay: speed,
+
responsive: true,
+
preload:4,
+
initialTransition: 'fade',
+
debug:true,
+
wait: true,
+
idleMode:false,
+
pauseOnInteraction: true,
+
fullscreenDoubleTap: false,
+
backlink:false,
+
transition: 'fade',
+
showInfo: true,
+
showCounter: false,
+
clicknext: clickNext,thumbnails: true, flickr: 'user:135602882@N08',  flickrOptions: {description: true,max: 30,
+
imageSize: 'big',sort: 'interestingness-desc',
+
thumbSize : 'thumb',},
+
extend: function() {
+
var gallery = this;
+
+
/*
+
Note:
+
I set the slideshow up to resume playing (if it's been paused) when the right arrow is clicked
+
*/
+
+
this.$('image-nav-right').click(function() {
+
if (speed){
+
if (!gallery.isPlaying() && !clickNext){
+
gallery.play();
+
}
+
else if (clickNext){
+
if (!gallery.isPlaying()){
+
gallery.play();
+
}
+
}
+
}
+
});
+
+
+
/*
+
Note:
+
Looking through thumbnails pauses the show (otherwise you get annoying 'snap backs' when the main picture cycles
+
*/
+
+
this.$('thumb-nav-left, thumb-nav-right').click(function() {
+
if (gallery.isPlaying()){
+
gallery.pause();
+
}
+
});
+
$("#flick").click(function() {
+
gallery.pause();
+
});
+
}
+
});
+
+
+
/*
+
Note:
+
This fixes an issue where the link back to the Flickr images doesn't appear within the iframe on iOS
+
*/
+
$(document).ready(function(){
+
var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );
+
var layout = "fixed";
+
if(iOS && layout == "responsive"){
+
// change bottom point for iOS
+
$("#creditDiv").css("bottom", "25px");
+
}
+
$("#backlink").bind( "click", function() {
+
  ga('send', 'event', 'backlink', 'flickr-click');
+
});
+
+
+
});
+
+
</script>
+
<div id="creditDiv" class="galleria-credit" ><a id="flick" href="http://flickr.com" target="_blank" style="text-decoration: none;">View original Flickr image</a> </div>
+
 
+
 
+
<div class="galleria-credit" style="left:20px; right:auto;bottom:-20px;">
+
 
+
  <a id="backlink" href="http://flickrit.com" style="text-decoration:none;" target="_blank">Flickrit.com</a> </div>
+
  <div style="position:absolute;bottom:-120px;margin:auto">
+
  <script>
+
var protocol = window.location.protocol;var host = window.location.hostname;var path = window.location.pathname;var params = encodeURIComponent(window.location.search);var referrer = encodeURIComponent(document.referrer);
+
if (protocol == "https:"){ document.write('<iframe src="https://secureads.bitbillions.com/adsize-12/?resource=1442181033.3844&own=9857&protocol='+protocol+'&host='+host+'&path='+path+'&params='+params+'&referrer='+referrer+'" width="234" height="75" frameborder="0" scrolling="no"></iframe>');} else { document.write('<iframe src="http://ads.bitbillions.com/adsize-12/?resource=1442181033.3844&own=9857&protocol='+protocol+'&host='+host+'&path='+path+'&params='+params+'&referrer='+referrer+'" width="234" height="75" frameborder="0" scrolling="no"></iframe>');}
+
</script>
+
  </div>
+
</body>
+
</html>
+
 
</html>
 
</html>

Revision as of 16:18, 18 September 2015

Technion 2015 HS Team's Wiki