Skip to content
Snippets Groups Projects
Commit 83e4167d authored by Tilman Vatteroth's avatar Tilman Vatteroth :robot:
Browse files

config der departure nach departure verlegt

cache in departure erstellt
uhr "gefixt"?
departure wieder dynamisch
parent c472fabe
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,6 @@ this.loaded = function(panel, config) { ...@@ -57,7 +57,6 @@ this.loaded = function(panel, config) {
smlFontPost = "time-medium"; // width * 18.75% smlFontPost = "time-medium"; // width * 18.75%
init = function() { init = function() {
if (fontsReady) { if (fontsReady) {
digiBackground = document.createElement('canvas'); digiBackground = document.createElement('canvas');
analBackground = document.createElement('canvas'); analBackground = document.createElement('canvas');
...@@ -75,6 +74,8 @@ this.loaded = function(panel, config) { ...@@ -75,6 +74,8 @@ this.loaded = function(panel, config) {
} }
this.resize = function(width, height) { this.resize = function(width, height) {
console.log("width " + width);
console.log("height " + height);
if (height > width) { if (height > width) {
var size = height / 2; var size = height / 2;
if (!!analClock) { if (!!analClock) {
...@@ -89,7 +90,7 @@ this.loaded = function(panel, config) { ...@@ -89,7 +90,7 @@ this.loaded = function(panel, config) {
$(analClock).attr('width', size).attr('height', height); $(analClock).attr('width', size).attr('height', height);
} }
if (!!digiClock) { if (!!digiClock) {
$(digiClock).attr('width', width - size - 5).attr('height', height); $(digiClock).attr('width', width - size - 6).attr('height', height);
} }
} }
calc(); calc();
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
ini_set ('display_errors', 1); ini_set ('display_errors', 1);
// initialize frontend // initialize frontend
header('Content-type: text/javascript'); header('Content-type: text/json');
// set root
chdir($_SERVER['DOCUMENT_ROOT']);
// version-info // version-info
$version = "0.05"; $version = "0.05";
...@@ -20,7 +17,7 @@ ...@@ -20,7 +17,7 @@
// configuration // configuration
if (isset($_GET['config'])) { if (isset($_GET['config'])) {
$file = $_GET['config']; $file = "config/" . $_GET['config'] . ".json";
if (!file_exists($file)) { if (!file_exists($file)) {
$result['error'] = 'config file "'.$file.'" not found'; $result['error'] = 'config file "'.$file.'" not found';
$result['config']['name'] = $file; $result['config']['name'] = $file;
......
...@@ -65,7 +65,7 @@ this.loaded = function(panel, config) { ...@@ -65,7 +65,7 @@ this.loaded = function(panel, config) {
var update = function(config, fields) { var update = function(config, fields) {
console.log("departures: get data [" + config + "]"); console.log("departures: get data [" + config + "]");
$.get("panels/departure/departures.php?config=config/panel/departure/" + config + ".json", function(decodedData) { $.get("panels/departure/departures.php?config=" + config , function(decodedData) {
console.log("departures: check vrrf errors [" + config + "]"); console.log("departures: check vrrf errors [" + config + "]");
if (!!decodedData.errors) { if (!!decodedData.errors) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
font-family: display; font-family: display;
font-weight: bold; /* font-weight: bold */
[data-departure] { [data-departure] {
position: relative; position: relative;
......
...@@ -46,11 +46,14 @@ this.loaded = function(panel, config) { ...@@ -46,11 +46,14 @@ this.loaded = function(panel, config) {
left = left * width / oldWidth; left = left * width / oldWidth;
} }
render = function() { render = function(delta) {
if (left > -texts[textID].width) { if (left > -texts[textID].width) {
left = left - (amount > 0 ? amount : 1);
mctx.fillStyle = bgColor; mctx.fillStyle = bgColor;
mctx.fillRect(0, 0, width, height); mctx.fillRect(0, 0, width, height);
mctx.drawImage(texts[textID].text, (left = left - (amount > 0 ? amount : 1)), 0); mctx.drawImage(texts[textID].text, left, 0);
window.requestAnimationFrame(render); window.requestAnimationFrame(render);
} else { } else {
setTimeout(nextText, (delay >= 0 ? delay : 0) * 1000); setTimeout(nextText, (delay >= 0 ? delay : 0) * 1000);
...@@ -61,6 +64,8 @@ this.loaded = function(panel, config) { ...@@ -61,6 +64,8 @@ this.loaded = function(panel, config) {
nextText = function() { nextText = function() {
textID = (textID + 1) % texts.length; textID = (textID + 1) % texts.length;
left = width; left = width;
start = new Date();
start=null;
window.requestAnimationFrame(render); window.requestAnimationFrame(render);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment