Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4bfba1a
Merge pull request #16 from danswick/master
danswick Mar 18, 2015
bcfc25f
Update inspiration.md
danswick Mar 18, 2015
3d69a8d
Update inspiration.md
danswick Mar 20, 2015
afb7578
Update inspiration.md
danswick Mar 21, 2015
a42057e
d3 tutorials folder
danswick Mar 30, 2015
a822ae5
rat and neighborhood data
danswick Mar 30, 2015
b079cc9
D3 transitions!
danswick Mar 30, 2015
8641afe
updating mah D3 tuts
danswick Apr 1, 2015
54d142f
finishing the aligned left d3 tuts
danswick Apr 4, 2015
d3fbad3
funishing alignedleft d3 tuts
danswick Apr 4, 2015
e76bf56
more D3 tuts - transitions
danswick Apr 8, 2015
5813ca3
landing page initial commit
danswick Apr 16, 2015
eb98cf4
landing page updates
danswick Apr 17, 2015
368c16a
updates to landing page
danswick Apr 17, 2015
251b583
Delete .editorconfig
danswick Apr 17, 2015
e5b8bea
Delete .gitattributes
danswick Apr 17, 2015
b7ac0c2
Delete .gitignore
danswick Apr 17, 2015
372accd
Delete .htaccess
danswick Apr 17, 2015
9c49445
landing page
danswick Apr 17, 2015
2fb7304
Merge remote-tracking branch 'origin/gh-pages' into gh-pages
danswick Apr 17, 2015
7cd1e86
landing page
danswick Apr 17, 2015
0a43405
testing a different index
danswick Apr 17, 2015
df2fcf5
landing page take 2
danswick Apr 17, 2015
70fab90
duplicate image slider
danswick Apr 17, 2015
e8a0608
cleaning up test files
danswick Apr 17, 2015
a74744e
move landing page to its own repo
danswick Apr 17, 2015
b37bad0
remove old site build
danswick Apr 26, 2015
51133b8
rebuild branch tests
danswick May 2, 2015
cfffd18
add, style header 'logo' for re-build
danswick May 3, 2015
c5b31da
wire everything up, fix internal linking
danswick May 3, 2015
16182e2
remove jekyll's dev _site dir
danswick May 3, 2015
a15e0d1
re-build commit
danswick May 3, 2015
f98c32d
conflict resolution
danswick May 3, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
duplicate image slider
  • Loading branch information
danswick committed Apr 17, 2015
commit 70fab90241f1b0f330d951f1f44d2d09e71dcee0
12 changes: 12 additions & 0 deletions image_slider2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## A little image slider demo.

This little demo compares two images of the same size by way of super fun slidey goodness.

### USAGE

1. Get two (or more) images that you would like to compare.
2. Resize and/or crop them so they are exactly the same size.
3. Swap some values in the code!
- Change the `width` and `height` values in `style.css`.
- Change the choices in the dropdown menu (`#image-select`) in `index.html`.
- Change the filepath and/or file key values in the `imagePaths` object in `main.js`.
Binary file added image_slider2/img/HP-1946.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/HP-2012.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/IBSP-1946.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/IBSP-2012.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/LB-1946.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/LB-2012.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image_slider2/img/Thumbs.db
Binary file not shown.
47 changes: 47 additions & 0 deletions image_slider2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Image Slider">
<title>Image Compare</title>

<link href='http://fonts.googleapis.com/css?family=Raleway:400,500,700' rel='stylesheet' type='text/css'>

<!-- external CSS link -->
<link rel="stylesheet" href="style/style.css">

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<header>
<h1>Shoreline Erosion</h1>
<h2>Comparing archival (1946) and current (2012) aerial photos</h2>
</header>
<content>
<div id="choice">
<div>Select a location:</div>


<!-- ==================================================================
CHAGNGE VALUES HERE
================================================================== -->
<select id="image-select">
<option value="HP">Highland Park</option>
<option value="IBSP">IL Beach State Park</option>
<option value="LB">Lake Bluff</option>
</select>
<!-- END VALUES SECITON -->


</div>
<div id="comparison">
<figure id="base-image">
<div id="divisor"></div>
</figure>
<input type="range" min="0" max="100" value="50" id="slider" oninput="moveDivisor()">
</div>
</content>
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions image_slider2/js/jquery-2.1.3.min.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions image_slider2/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
var divisor = document.getElementById("divisor"),
slider = document.getElementById("slider");
function moveDivisor() {
divisor.style.width = slider.value+"%";
}


/*==================================================================
SWAP IN YOUR IMAGE LOCATIONS BELOW
==================================================================*/
// Note that the key (left value, before the ':') should have a 1
// or a 2 in order for the function below to work. These should
// corresepond to the base and comparrison images you would like to
// visualize.

var iamgePaths = {
HP1: "img/HP-1946.jpg",
HP2: "img/HP-2012.jpg",
IBSP1: "img/IBSP-1946.jpg",
IBSP2: "img/IBSP-2012.jpg",
LB1: "img/LB-1946.jpg",
LB2: "img/LB-2012.jpg"
};


$('#image-select').change(function() {
var userChoice = $('#image-select').val();
var userVariable1 = userChoice.concat('1');
var userVariable2 = userChoice.concat('2');
$('#base-image').css("background-image", "url(" + iamgePaths[userVariable1] + ")");
$('#divisor').css("background-image", "url(" + iamgePaths[userVariable2] + ")");
});
100 changes: 100 additions & 0 deletions image_slider2/style/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
body, html {
height: 1000px;
}

body, #comparison {
margin: 0 auto;
text-align: center;
}

div#comparison {
max-width: 600px;
overflow: hidden;
margin-bottom: 50px; }
div#comparison figure {

/* ==================================================================
A D J U S T I M A G E S I Z E H E R E
================================================================== */
/*** NOTE: your images must be the same size or things will get freaky!*/

width: 600px;
height: 775px;
background-image: url(../img/HP-1946.jpg);
background-size: cover;
position: relative;
font-size: 0;
margin: 0;
}
div#comparison figure > img {
position: relative;
width: 100%;
}
div#comparison figure div {
background-image: url(../img/HP-2012.jpg);
background-size: cover;
position: absolute;
width: 50%;
box-shadow: 0 5px 10px -2px rgba(0,0,0,0.3);
overflow: hidden;
bottom: 0;
height: 100%;
}

input[type=range]{
-webkit-appearance:none;
-moz-appearance:none;
position: relative;
top: -2rem; left: -2%;
background-color: rgba(255,255,255,0.1);
width: 102%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:active {
outline: none;
}

input[type=range]::-moz-range-track {
-moz-appearance:none;
height:15px;
width: 98%;
background-color: rgba(255,255,255,0.1);
position: relative;
outline: none;
}
input[type=range]::active {
border: none;
outline: none;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance:none;
width: 20px; height: 15px;
background: #fff;
border-radius: 0;
}
input[type=range]::-moz-range-thumb {
-moz-appearance: none;
width: 20px;
height: 15px;
background: #fff;
border-radius: 0;
}
input[type=range]:focus::-webkit-slider-thumb {
background: rgba(255,255,255,0.5);
}
input[type=range]:focus::-moz-range-thumb {
background: rgba(255,255,255,0.5);
}

select, #choice div {
margin: 20px 10px 0px 10px;
font-size: 20px;
font-weight: bold;
font-family: sans-serif;
}

#divisor {
border: 1px dashed #fff;
}