Browse Source

css change, and now handles a slide being removed better

master
mort 8 years ago
parent
commit
a1865d0aaf
2 changed files with 15 additions and 2 deletions
  1. 4
    1
      index.html
  2. 11
    1
      server.js

+ 4
- 1
index.html View File

@@ -39,7 +39,7 @@

._content .fullscreen {
position: absolute;
width: auto;
width: 100%;
height: 100%;
top: 0px;
left: 50%;
@@ -48,6 +48,9 @@
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
._content img.fullscreen {
width: auto;
}

#_overlay {
transition: opacity {{transition_time}}s;

+ 11
- 1
server.js View File

@@ -83,6 +83,15 @@ function Slide(dir) {
sendfile(res, pathlib.join(dir, name));
}

self.dirExists = function() {
try {
fs.accessSync(dir, fs.F_OK);
return true;
} catch (err) {
return false;
}
}

return self;
}

@@ -163,7 +172,8 @@ function Slideshow(dir, changeInterval) {
slideIndex += 1;

// Go to the next slide, or restart
if (slideIndex >= slides.length) {
if ((slideIndex >= slides.length)
|| (!slides[slideIndex].dirExists())) {
clearInterval(interval);
init();
} else {

Loading…
Cancel
Save