Browse Source

added config option to change the transition time

master
mort 8 years ago
parent
commit
f6ebdb53ce
3 changed files with 7 additions and 2 deletions
  1. 1
    0
      conf.json.example
  2. 4
    1
      index.html
  3. 2
    1
      server.js

+ 1
- 0
conf.json.example View File

@@ -1,5 +1,6 @@
{
"slides": "exampleSlides",
"transition_time": 1,
"interval": 5000,
"port": 8080
}

+ 4
- 1
index.html View File

@@ -50,7 +50,7 @@
}

#_overlay {
transition: opacity 1s;
transition: opacity {{transition_time}}s;
opacity: 1;
}
#_overlay.hidden {
@@ -62,6 +62,9 @@
<div id="_main" class="_content"></div>
<div id="_overlay" class="_content"></div>

<!-- Fetch polyfill -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js"></script>

<script>
var overlay = () => document.querySelector("#_overlay");
var main = () => document.querySelector("#_main");

+ 2
- 1
server.js View File

@@ -4,8 +4,9 @@ var crypto = require("crypto");
var pathlib = require("path");
var urllib = require("url");

var index = fs.readFileSync("index.html");
var conf = JSON.parse(fs.readFileSync("conf.json"));
var index = fs.readFileSync("index.html", "utf-8")
.replace("{{transition_time}}", conf.transition_time);

function error(res, err) {
console.trace(err);

Loading…
Cancel
Save