Skip to content

Commit 1520989

Browse files
committed
dark stuff
1 parent cd89106 commit 1520989

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

examples/slideshow.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<!DOCTYPE HTML>
2-
<html>
2+
<html class=dark>
33
<head>
44
<title>smartcrop.js slideshow</title>
55
<link rel=stylesheet href=style.css>
6+
<meta property="og:image" content="http://29a.ch/sandbox/2014/smartcrop/examples/images/slideshow/0.jpg">
67
</head>
78

89
<body>
@@ -13,6 +14,7 @@ <h1>smartcrop.js slideshow</h1>
1314

1415
<div id=prev-slide></div>
1516
<div id=slide>loading, this can take a little while...</div>
17+
<p>All the images are my own, you can find them and their license on my <a href="https://www.flickr.com/photos/80225884@N06/">flickr stream</a>.</p>
1618
<script src=jquery.js></script>
1719
<script src=underscore.js></script>
1820
<script src="../smartcrop.js"></script>

examples/slideshow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function slideShow(images){
2626
.each(function(i){
2727
i.img = new Image();
2828
i.img.onload = function(){
29-
var options = {width: width*0.1, height: height*0.1};
29+
var options = {width: width*0.1, height: height*0.1, ruleOfThirds: false};
3030
SmartCrop.crop(i.img, _.extend({maxScale: 0.8, minScale: 0.7}, options), function(from){
3131
i.from = from;
3232
if(++analysed==images.length*2) next();
@@ -58,7 +58,7 @@ function showSlide(image, done){
5858
}
5959

6060
// zooming out usually works better, but some change is good too
61-
if(image.from.topCrop.score.total*3.9 > image.to.topCrop.score.total) {
61+
if((image.from.topCrop.score.total+0.1)*1.002 > (image.to.topCrop.score.total+0.1)) {
6262
from = image.from;
6363
to = image.to;
6464
}

examples/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ body {
55
padding: 8px;
66
margin: auto;
77
}
8+
.dark {
9+
background: #111;
10+
color: #888;
11+
}
12+
.dark a {
13+
color: #8af;
14+
}
15+
16+
h1 {
17+
font-weight: normal;
18+
}
19+
820
p {
921
max-width: 900px;
1022
}

0 commit comments

Comments
 (0)