Skip to content

Commit

Permalink
added image prefetching to get smoother animations
Browse files Browse the repository at this point in the history
  • Loading branch information
wolpi committed Sep 4, 2016
1 parent d5d9e65 commit 1d9839f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function handleFile($path, $fileName, $thumbnail_cache_dir) {
createThumb($originalFullPath, $thumbFileFullPath);
}
printImgFile($originalFullPath, $thumbFileFullPath);
printImgPrefetch($originalFullPath);
}
}
}
Expand All @@ -108,6 +109,10 @@ function printImgFile($originalFullPath, $thumbFullPath) {
echo "</a>";
}

function printImgPrefetch($originalFullPath) {
echo "<link rel=\"prefetch\" href=\"$originalFullPath\" />";
}

function printDir($path, $name) {
#echo "<li class=\"dir\"><a href=\"?p=$path\">$name</a></li>";
echo "<div class=\"dir\"><a href=\"?p=$path\">$name</a></div>";
Expand Down

0 comments on commit 1d9839f

Please sign in to comment.