From 8bd9d1519eee62660c395333a764a5d7443b85e2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 6 May 2011 22:48:09 -0400 Subject: LIl things. --- web/css/000-controls.css | 38 +++++++++++++++++++++++++++++++++++++- web/index.html | 16 +++++++++++++--- web/js/010-control.js | 20 ++++++++++++++++++-- web/redirect.php | 8 ++++++-- 4 files changed, 74 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/css/000-controls.css b/web/css/000-controls.css index 30ae0a1..3c3d986 100644 --- a/web/css/000-controls.css +++ b/web/css/000-controls.css @@ -17,7 +17,7 @@ a:hover { top: 0; padding: 0.4em; font-weight: bold; - font-size: 1.2em; + font-size: 1.15em; } #loading { display: none; @@ -82,6 +82,33 @@ a:hover { right: 0; text-align: center; } +#photo-box { + display: inline; +} +#photo-links { + background-color: #000000; + font-weight: bold; + height: 10px; + font-size: 10px; + line-height: 7px; + padding-top: 3px; + padding-bottom: 3px; + padding-right: 10px; + padding-left: 10px; + display: none; + border-top-right-radius: 5px; + border-top-left-radius: 5px; + -moz-border-top-right-radius: 5px; + -moz-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -webkit-border-top-left-radius: 5px; +} +#photo-bar { + position: absolute; + bottom: 0; + width: 100%; + text-align: center; +} .photo-view-container { position: absolute; height: 150px; @@ -94,3 +121,12 @@ a:hover { padding: 0 !important; text-align: center; } + +#error { + display: none; + text-align: center; + padding-top: 20%; + font-size: 4em; + font-weight: bold; + font-style: italic; +} diff --git a/web/index.html b/web/index.html index c96bfaa..4326185 100644 --- a/web/index.html +++ b/web/index.html @@ -3,12 +3,12 @@ - JasonDonenfeld.com – Colors + JasonDonenfeld.com – Photos -
Colors
+
Photos
Loading...
@@ -16,10 +16,20 @@
- +
+ + +
+
+
Forgot my camera...
+ diff --git a/web/js/010-control.js b/web/js/010-control.js index ab3a410..d41d41d 100644 --- a/web/js/010-control.js +++ b/web/js/010-control.js @@ -10,6 +10,8 @@ $(document).ready(function() { .replace(/\(/g, "") .replace(/\)/g, "") .replace(/#/g, "") + .replace(/&/g, "") + .replace(/,/g, "") .replace(/\[/g, "") .replace(/\]/g, "") .replace(/"/g, "") @@ -42,7 +44,7 @@ $(document).ready(function() { $.ajax({ type: "GET", url: "cache/" + current_album_cache + ".json", - error: function() { $(document.body).html("Couldn't fetch it."); }, + error: die, success: albumLoaded }); } @@ -147,6 +149,8 @@ $(document).ready(function() { $("#back").attr("href", "#" + current_album_cache + "/" + cachePath(current_album.photos[ (current_photo_index - 1 < 0) ? (current_album.photos.length - 1) : (current_photo_index - 1) ].name)); + $("#original-link").attr("target", "_blank").attr("href", "albums/" + current_album.path + "/" + current_photo.name); + $("#metadata-link").attr("href", "javascript:alert('Coming soon...')"); $("#album-view").addClass("photo-view-container"); $("#subalbums").hide(); @@ -188,13 +192,19 @@ $(document).ready(function() { $.ajax({ type: "GET", url: "cache/" + album + ".json", - error: function() { $(document.body).html("Couldn't fetch it."); }, + error: die, success: callback }); } function albumThumbFinder(album, callback) { fetchAlbumForThumb(album, function(fetchedAlbum) { albumForThumbIteration(fetchedAlbum, callback); }); } + function die() { + $("#album-view").hide(); + $("#photo-view").hide(); + $("#title").hide(); + $("#error").fadeIn(5000); + } var current_album_cache = null; var current_photo_cache = null; @@ -237,4 +247,10 @@ $(document).ready(function() { } return true; }); + $("#photo-box").mouseenter(function() { + $("#photo-links").stop().fadeTo("slow", 0.50).css("display", "inline"); + }); + $("#photo-box").mouseleave(function() { + $("#photo-links").stop().fadeOut("slow"); + }); }); diff --git a/web/redirect.php b/web/redirect.php index d291fb6..06a2561 100644 --- a/web/redirect.php +++ b/web/redirect.php @@ -4,7 +4,7 @@ function cachePath($path) { $path = substr($path, 1); if ($path[strlen($path) - 1] == '/') $path = substr($path, 0, strlen($path) - 1); - $path = str_replace('_-_', '-', str_replace('/', '-', str_replace(' ', '_', str_replace('(', '', str_replace(')', '', str_replace('#', '', str_replace('[', '', str_replace(']', '', str_replace('"', '', str_replace("'", '', strtolower($path))))))))))); + $path = str_replace('_-_', '-', str_replace('/', '-', str_replace(' ', '_', str_replace('(', '', str_replace(')', '', str_replace('#', '', str_replace('[', '', str_replace(']', '', str_replace('&', '', str_replace(',', '', str_replace('"', '', str_replace("'", '', strtolower($path))))))))))))); while (strpos($path, "--") !== false) $path = str_replace("--", "-", $path); while (strpos($path, "__") !== false) @@ -23,9 +23,13 @@ if (strpos(strtolower($url), ".php") == strlen($url) - 4) { $url = substr($url, 0, strlen($url) - 4); $index = strrpos($url, "/"); $redirect = "/#".cachePath(substr($url, 0, $index))."/".cachePath(substr($url, $index)); +} else if (strpos($url, "/cache/") === 0 || strpos($url, "/albums/") === 0 || strpos($url, "/img/") === 0 || strpos($url, "/img/") === 0 || strpos($url, "/js/") === 0 || strpos($url, "/css/") === 0) { + header("HTTP/1.1 404 Not Found"); + exit(); } else $redirect = "/#".cachePath($url); - + +header("HTTP/1.1 301 Moved Permanently"); header("Location: $redirect"); ?> \ No newline at end of file -- cgit v1.2.3-59-g8ed1b