3 changed files with 403 additions and 287 deletions
@ -1,124 +1,195 @@ |
|||||||
* { |
* { |
||||||
margin: 0; |
margin: 0; |
||||||
padding: 0; |
padding: 0; |
||||||
} |
} |
||||||
|
|
||||||
html { |
html { |
||||||
background: #222 url("bg.png") repeat; |
background: #222 url("bg.png") repeat; |
||||||
} |
} |
||||||
|
|
||||||
body { |
body { |
||||||
-webkit-font-smoothing: antialiased; |
|
||||||
font: 14px/20px Helvetica, Arial, sans-serif; |
|
||||||
text-shadow: 0 -2px 1px #000; |
|
||||||
color: #888; |
|
||||||
text-align: center; |
|
||||||
_width: 70%; |
_width: 70%; |
||||||
max-width: 800px; |
color: #888; |
||||||
|
font: 14px/20px Helvetica, Arial, sans-serif; |
||||||
margin: 20px auto 0; |
margin: 20px auto 0; |
||||||
} |
max-width: 800px; |
||||||
|
text-align: center; |
||||||
|
text-shadow: 0 -2px 1px #000; |
||||||
|
-webkit-font-smoothing: antialiased; |
||||||
|
} |
||||||
|
|
||||||
#wrapper { |
#wrapper { |
||||||
padding: 20px; |
padding: 20px; |
||||||
} |
} |
||||||
|
|
||||||
.rslides1 { |
.slides { |
||||||
-webkit-box-shadow: 0 0 20px #000; |
|
||||||
-moz-box-shadow: 0 0 20px #000; |
|
||||||
box-shadow: 0 0 20px #000; |
box-shadow: 0 0 20px #000; |
||||||
margin-bottom: 40px; |
-moz-box-shadow: 0 0 20px #000; |
||||||
} |
-webkit-box-shadow: 0 0 20px #000; |
||||||
|
margin: 0 auto 40px !important; |
||||||
|
} |
||||||
|
|
||||||
.rslides2 { |
|
||||||
margin: 0 auto; |
|
||||||
} |
|
||||||
|
/* moved these from js file to here */ |
||||||
|
.slides { |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
width: 100%; |
||||||
|
list-style: none; |
||||||
|
padding: 0; |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
.slides li { |
||||||
|
height: inherit; |
||||||
|
left: 0; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
.slides img { |
||||||
|
display: block; |
||||||
|
width: 100%; |
||||||
|
height: auto; |
||||||
|
} |
||||||
|
/* moving ends */ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.pagination { |
||||||
|
margin-bottom: 0 !important; |
||||||
|
} |
||||||
|
|
||||||
p { |
p { |
||||||
text-align: left; |
|
||||||
max-width: 500px; |
|
||||||
margin: 0 auto 20px; |
margin: 0 auto 20px; |
||||||
} |
max-width: 500px; |
||||||
|
text-align: left; |
||||||
|
} |
||||||
|
|
||||||
h1 { |
h1 { |
||||||
font: 36px/50px "Helvetica Neue", Helvetica, Arial, sans-serif; |
|
||||||
color: #fff; |
color: #fff; |
||||||
|
font: 36px/50px "Helvetica Neue", Helvetica, Arial, sans-serif; |
||||||
font-weight: 200; |
font-weight: 200; |
||||||
} |
} |
||||||
|
|
||||||
h2 { |
h2 { |
||||||
font: 16px/20px "Helvetica Neue", Helvetica, Arial, sans-serif; |
font: 16px/20px "Helvetica Neue", Helvetica, Arial, sans-serif; |
||||||
margin-bottom: 40px; |
margin-bottom: 40px; |
||||||
} |
} |
||||||
|
|
||||||
a { |
a { |
||||||
text-decoration: none; |
|
||||||
color: #fff; |
color: #fff; |
||||||
} |
text-decoration: none; |
||||||
|
} |
||||||
|
|
||||||
|
a img { |
||||||
|
border: none; |
||||||
|
} |
||||||
|
|
||||||
.rslides_tabs { |
.rslides3_tabs { |
||||||
|
background: rgba(0,0,0,.25); |
||||||
|
box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
|
-moz-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
|
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
font-size: 18px; |
font-size: 18px; |
||||||
margin: 0 auto 50px; |
|
||||||
padding: 10px 0; |
|
||||||
list-style: none; |
list-style: none; |
||||||
width: 100%; |
margin: 0 auto 50px; |
||||||
max-width: 540px; |
max-width: 540px; |
||||||
|
padding: 10px 0; |
||||||
text-align: center; |
text-align: center; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.rslides3_tabs li { |
||||||
|
display: inline; |
||||||
|
} |
||||||
|
|
||||||
|
.rslides3_tabs li:first-child { |
||||||
|
margin-left: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.rslides3_tabs a { |
||||||
|
color: #666; |
||||||
|
padding: 8px 20px; |
||||||
|
-webkit-tap-highlight-color: rgba(0,0,0,.01); |
||||||
|
} |
||||||
|
|
||||||
|
.rslides3_tabs .rslides3_here a { |
||||||
|
background: rgba(255,255,255,.1); |
||||||
|
color: #fff; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
.rslides4_tabs { |
||||||
background: rgba(0,0,0,.25); |
background: rgba(0,0,0,.25); |
||||||
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
|
||||||
-moz-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
|
||||||
box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
} |
-moz-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
|
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.3), inset 0 0 5px rgba(0,0,0,1.0); |
||||||
|
font-size: 18px; |
||||||
|
list-style: none; |
||||||
|
margin: 0 auto 50px; |
||||||
|
max-width: 540px; |
||||||
|
padding: 10px 0; |
||||||
|
text-align: center; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
.rslides_tabs li { |
.rslides4_tabs li { |
||||||
display: inline; |
display: inline; |
||||||
} |
} |
||||||
|
|
||||||
.rslides_tabs li:first-child { |
.rslides4_tabs li:first-child { |
||||||
margin-left: 0; |
margin-left: 0; |
||||||
} |
} |
||||||
|
|
||||||
.rslides_tabs a { |
.rslides4_tabs a { |
||||||
-webkit-tap-highlight-color: rgba(0,0,0,.01); |
|
||||||
padding: 8px 20px; |
|
||||||
color: #666; |
color: #666; |
||||||
} |
padding: 8px 20px; |
||||||
|
-webkit-tap-highlight-color: rgba(0,0,0,.01); |
||||||
|
} |
||||||
|
|
||||||
.rslides_tabs .rslides_here a { |
.rslides4_tabs a:focus, |
||||||
color: #fff; |
.rslides4_tabs a:active { |
||||||
|
outline: none; |
||||||
|
-webkit-tap-highlight-color: rgba(0,0,0,.01); |
||||||
|
} |
||||||
|
|
||||||
|
.rslides4_tabs .rslides4_here a { |
||||||
background: rgba(255,255,255,.1); |
background: rgba(255,255,255,.1); |
||||||
|
color: #fff; |
||||||
font-weight: bold; |
font-weight: bold; |
||||||
} |
} |
||||||
|
|
||||||
#download { |
#download { |
||||||
-webkit-box-shadow: 0 0 10px #000; |
|
||||||
-moz-box-shadow: 0 0 10px #000; |
|
||||||
box-shadow: 0 0 10px #000; |
|
||||||
background: #333; |
background: #333; |
||||||
background: rgba(255,255,255,.1); |
background: rgba(255,255,255,.1); |
||||||
border: 1px solid rgba(255,255,255,.1); |
border: 1px solid rgba(255,255,255,.1); |
||||||
-webkit-border-radius: 5px; |
|
||||||
-moz-border-radius: 5px; |
|
||||||
border-radius: 5px; |
border-radius: 5px; |
||||||
|
-moz-border-radius: 5px; |
||||||
|
-webkit-border-radius: 5px; |
||||||
|
box-shadow: 0 0 10px #000; |
||||||
|
-moz-box-shadow: 0 0 10px #000; |
||||||
|
-webkit-box-shadow: 0 0 10px #000; |
||||||
|
display: block; |
||||||
font-size: 20px; |
font-size: 20px; |
||||||
font-weight: bold; |
font-weight: bold; |
||||||
margin: 60px auto; |
margin: 60px auto; |
||||||
display: block; |
|
||||||
max-width: 500px; |
max-width: 500px; |
||||||
padding: 20px; |
padding: 20px; |
||||||
} |
} |
||||||
|
|
||||||
#download:hover { |
#download:hover { |
||||||
background: rgba(255,255,255,.15); |
background: rgba(255,255,255,.15); |
||||||
} |
} |
||||||
|
|
||||||
.footer { |
.footer { |
||||||
font-size: 11px; |
font-size: 11px; |
||||||
} |
} |
||||||
|
|
||||||
@media screen and (max-width: 600px) { |
@media screen and (max-width: 600px) { |
||||||
|
|
||||||
h1 { |
h1 { |
||||||
font: 30px/50px "Helvetica Neue", Helvetica, Arial, sans-serif; |
font: 30px/50px "Helvetica Neue", Helvetica, Arial, sans-serif; |
||||||
} |
} |
||||||
|
} |
||||||
} |
|
@ -1,140 +1,157 @@ |
|||||||
/*! ResponsiveSlides.js v1.06. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ |
/*! ResponsiveSlides.js v1.07. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ |
||||||
(function ($, window, i) { |
(function($, window, i) { |
||||||
$.fn.responsiveSlides = function (options) { |
|
||||||
// Settings
|
$.fn.responsiveSlides = function( options ) { |
||||||
|
|
||||||
|
// Merge default settings with optional arguments
|
||||||
var settings = $.extend({ |
var settings = $.extend({ |
||||||
'speed' : 4000, |
"auto": true, |
||||||
'fade' : 1000, |
"fade": 1000, |
||||||
'auto' : true, |
"maxwidth": "none", |
||||||
'maxwidth' : 'none' |
"speed": 4000 |
||||||
}, options); |
}, options); |
||||||
|
|
||||||
return this.each(function () { |
return this.each( function () { |
||||||
|
|
||||||
|
// increment i, which is used for namespacing
|
||||||
i++; |
i++; |
||||||
var $this = $(this); |
|
||||||
|
|
||||||
var slideshow = function () { |
|
||||||
var $slide = $this.find('img'), |
|
||||||
hasTouch = 'ontouchstart' in window, |
|
||||||
startEvent = hasTouch ? 'touchstart' : 'mousedown', |
|
||||||
namespace = 'rslides', |
|
||||||
namespace_i = namespace + i, |
|
||||||
namespace_i_class = namespace + ' ' + namespace_i, |
|
||||||
active_class = namespace + '_here', |
|
||||||
visible_class = namespace_i + '_on', |
|
||||||
slide_class_prefix = namespace_i + '_s', |
|
||||||
tabs_class = namespace_i + '_tabs', |
|
||||||
fadetime = parseFloat(settings.fade), |
|
||||||
$pagination = $('<ul class="' + namespace + '_tabs ' + tabs_class + '" />'), |
|
||||||
visible = { 'position': 'relative', 'float': 'left' }, |
|
||||||
hidden = { 'position': 'absolute', 'float': 'none' }; |
|
||||||
|
|
||||||
// Only run if there's more than one slide
|
// save handle for the slideshow
|
||||||
if ($this.find($slide).length > 1) { |
var $this = $( this ); |
||||||
|
|
||||||
|
var $slide = $this.children(), |
||||||
|
$img = $( "img", this ), |
||||||
|
|
||||||
|
namespace = "rslides" + i, |
||||||
|
|
||||||
|
activeClass = namespace + "_here", |
||||||
|
slideClassPrefix = namespace + "_s", |
||||||
|
|
||||||
|
tabsClass = namespace + "_tabs", |
||||||
|
$pagination = $( "<ul class=\"" + tabsClass + "\" />" ), |
||||||
|
|
||||||
|
visible = {"float": "left", "position": "relative"}, |
||||||
|
hidden = {"float": "none", "position": "absolute"}, |
||||||
|
|
||||||
|
// start index and number of slides
|
||||||
|
index = 0, |
||||||
|
length = $slide.size(); |
||||||
|
|
||||||
|
// animations
|
||||||
|
var slideTo = function( idx ) { |
||||||
|
|
||||||
$slide.each(function (i) { |
$slide |
||||||
this.id = slide_class_prefix + i; |
.stop() |
||||||
|
.fadeOut( settings.fade, function() { |
||||||
|
$( this ).css( hidden ); |
||||||
|
}) |
||||||
|
.eq( idx ) |
||||||
|
.fadeIn( settings.fade, function() { |
||||||
|
$( this ).css( visible ); |
||||||
|
index = idx; |
||||||
}); |
}); |
||||||
|
}; |
||||||
|
|
||||||
|
// Only run if there's more than one slide
|
||||||
|
if ( $slide.size() > 1 ) { |
||||||
|
|
||||||
$slide.css({ |
// add ids to each slide
|
||||||
'top': 0, |
$slide.each( function ( i ) { |
||||||
'left': 0, |
this.id = slideClassPrefix + i; |
||||||
'width': '100%', |
|
||||||
'height': 'inherit', |
|
||||||
'position': 'absolute' |
|
||||||
}); |
}); |
||||||
|
|
||||||
|
// add css to the slideshow
|
||||||
$this.css({ |
$this.css({ |
||||||
'max-width': parseFloat(settings.maxwidth), |
"max-width": settings.maxwidth |
||||||
'width': '100%', |
}); |
||||||
'overflow': 'hidden', |
|
||||||
'position': 'relative' |
// hide all slides, then show first one
|
||||||
}) |
$slide |
||||||
.addClass(namespace_i_class) |
.hide() |
||||||
.find(':first-child').css(visible).end() |
.eq( 0 ) |
||||||
.find($slide + ':gt(0)').hide(); |
.css( visible ) |
||||||
|
.show(); |
||||||
|
|
||||||
// Auto: true
|
// Auto: true
|
||||||
if (settings.auto === true) { |
if ( settings.auto === true ) { |
||||||
setInterval(function () { |
|
||||||
$this.find(':first-child').fadeOut(fadetime, function () { |
// rotate slides automatically
|
||||||
$(this).css(hidden); |
setInterval( function () { |
||||||
}).next($slide).fadeIn(fadetime, function () { |
var idx = index + 1 < length ? index + 1 : 0; |
||||||
$(this).css(visible); |
slideTo( idx ); |
||||||
}).end().appendTo($this); |
}, settings.speed ); |
||||||
}, parseFloat(settings.speed)); |
|
||||||
|
|
||||||
|
} |
||||||
// Auto: false
|
// Auto: false
|
||||||
} else { |
else { |
||||||
var t = ''; |
|
||||||
$slide.each(function (i) { |
|
||||||
var n = i + 1; |
|
||||||
t += |
|
||||||
'<li>' + |
|
||||||
'<a href="#" class="' + slide_class_prefix + n + '">' + n + '</a>' + |
|
||||||
'</li>'; |
|
||||||
}); |
|
||||||
$pagination.append(t); |
|
||||||
|
|
||||||
$this.after($pagination).find(':first-child').addClass(visible_class); |
// build pagination
|
||||||
$('.' + slide_class_prefix + '1').parent().addClass(active_class); |
var tabMarkup = []; |
||||||
|
$slide.each( function( i ) { |
||||||
|
var n = i + 1; |
||||||
|
|
||||||
$('.' + tabs_class + ' a').each(function (i) { |
tabMarkup.push( "<li>" ); |
||||||
|
tabMarkup.push( "<a href=\"#" + slideClassPrefix + n + "\" " ); |
||||||
|
tabMarkup.push( "class=\"" + slideClassPrefix + n + "\">" + n + "</a>" ); |
||||||
|
tabMarkup.push( "</li>" ); |
||||||
|
}); |
||||||
|
$pagination.append( tabMarkup.join("") ); |
||||||
|
|
||||||
var $el = $(this); |
var $tabs = $pagination.find( "a" ); |
||||||
|
|
||||||
$el.bind('click', function (e) { |
// add click/touch event handler and set first tab active
|
||||||
|
$tabs.on( "ontouchstart" in window ? "touchstart" : "click", function( e ) { |
||||||
e.preventDefault(); |
e.preventDefault(); |
||||||
}); |
|
||||||
|
|
||||||
$el.bind(startEvent, function () { |
// get index of clicked tab
|
||||||
|
var idx = $tabs.index( this ); |
||||||
|
|
||||||
// Prevent clicking if animated
|
// break here if element is already active
|
||||||
if ($('.' + visible_class + ':animated').length) { |
if( index === idx ) { |
||||||
return false; |
return; |
||||||
} |
} |
||||||
|
|
||||||
if (!($el.parent().hasClass(active_class))) { |
// remove active state from old tab and set new one
|
||||||
$('.' + tabs_class + ' li').removeClass(active_class); |
$tabs |
||||||
$('.' + visible_class).stop().fadeOut(fadetime, function () { |
.closest( "li" ) |
||||||
$(this).removeClass(visible_class).css(hidden); |
.removeClass( activeClass ) |
||||||
}).end(); |
.eq( idx ) |
||||||
$('#' + slide_class_prefix + i).stop().fadeIn(fadetime, function () { |
.addClass( activeClass ); |
||||||
$(this).addClass(visible_class).css(visible); |
|
||||||
}).end(); |
// do the animation
|
||||||
$el.parent().addClass(active_class); |
slideTo( idx ); |
||||||
|
}) |
||||||
|
.eq( 0 ) |
||||||
|
.closest( "li" ) |
||||||
|
.addClass( activeClass ); |
||||||
|
|
||||||
|
// inject pagination
|
||||||
|
$this.after( $pagination ); |
||||||
} |
} |
||||||
}); |
|
||||||
}); |
|
||||||
} |
} |
||||||
|
|
||||||
} |
|
||||||
}; |
// only add fallback if maxwidth isn't supported and maxwidth is set
|
||||||
|
if ( typeof document.body.style.maxWidth === "undefined" && options && options.maxwidth ) { |
||||||
|
|
||||||
// Fallback to make IE6 support CSS max-width
|
// Fallback to make IE6 support CSS max-width
|
||||||
var widthSupport = function () { |
var widthSupport = function() { |
||||||
var maxwidth = parseFloat(settings.maxwidth); |
|
||||||
if (options && options.maxwidth) { |
$this.css( "width", "100%" ); |
||||||
if (typeof document.body.style.maxHeight === 'undefined') { |
|
||||||
$this.each(function () { |
if ( $this.width() > settings.maxwidth ) { |
||||||
$this.css('width', '100%'); |
$this.css( "width", settings.maxwidth ); |
||||||
if ($this.width() > maxwidth) { |
|
||||||
$this.css('width', maxwidth); |
|
||||||
} else if ($this.width() < maxwidth) { |
|
||||||
$this.css('width', '100%'); |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
} |
||||||
}; |
}; |
||||||
|
|
||||||
// Call once
|
|
||||||
slideshow(); |
|
||||||
widthSupport(); |
widthSupport(); |
||||||
// Call on resize
|
// bind on window resize
|
||||||
$(window).resize(function () { |
$( window ).on( "resize", function () { |
||||||
widthSupport(); |
widthSupport(); |
||||||
}); |
}); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
}); |
}); |
||||||
}; |
}; |
||||||
|
|
||||||
})(jQuery, this, 0); |
})(jQuery, this, 0); |
Loading…
Reference in new issue