Compare commits
14 Commits
19bb4e1308
...
11-23
Author | SHA1 | Date | |
---|---|---|---|
1033df0303 | |||
766bc77e25 | |||
c9585eaa88 | |||
3c8311d6d4 | |||
c8a96c2d4c | |||
a4bd327ca3 | |||
111a504f84 | |||
db60b21476 | |||
b597a856e0 | |||
e77d8dd658 | |||
4cb1819a49 | |||
8ea66dcbd7 | |||
c15f56739a | |||
8a808d24b1 |
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
random
|
||||||
|
Images-dd514b88-Results
|
||||||
|
node_modules
|
||||||
|
.kanbn
|
||||||
|
.random
|
||||||
|
.original
|
||||||
|
|
||||||
|
Images-c9dbce3b-Results
|
||||||
|
Results
|
||||||
|
slideshow/random-results
|
||||||
|
|
||||||
|
sync.ffs_db
|
||||||
|
|
||||||
|
NGINdeX.io
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Current Opened File",
|
||||||
|
"program": "${file}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
23
.vscode/mklink.md
vendored
Normal file
23
.vscode/mklink.md
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
type: "note"
|
||||||
|
---
|
||||||
|
|
||||||
|
# mklink
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mklink /J "L:\Git\www\.kanbn" "D:\5-Other-Small\Kanban\www"
|
||||||
|
mklink /J "L:\Git\www\.random" "D:\1-Images-A\Images-c9dbce3b-Results\F)Random\c9dbce3b\[]"
|
||||||
|
mklink /J "L:\Git\www\.original" "D:\1-Images-A\Images-c9dbce3b-Results\C)Resize\c9dbce3b\Original\()"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ln -s /var/log/nginx /var/www/html/log-nginx
|
||||||
|
# ln -s /home/syncthing/Immich/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593 /var/www/html/Images-c9dbce3b-Results/thumbs
|
||||||
|
cp -R /home/syncthing/Immich/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/ /var/www/html/Images-c9dbce3b-Results/thumbs
|
||||||
|
ls -la /var/www/html/Images-c9dbce3b-Results
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mklink /J "L:\Git\www\NGINdeX.io" "L:\Git\NGINdeX.io"
|
||||||
|
mklink /J "L:\Git\www\Images-c9dbce3b-Results\thumbs" "D:\7-Question\Images-c9dbce3b-Results\thumbs"
|
||||||
|
```
|
21
.vscode/settings.json
vendored
Normal file
21
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"Immich",
|
||||||
|
"onlinepngtools"
|
||||||
|
],
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"cSpell.enabled": true,
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.git": false,
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"coverage-gutters.coverageBaseDir": "./.vscode/ReportGenerator/Cobertura/*",
|
||||||
|
"extensions.ignoreRecommendations": true,
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.wordWrap": "off"
|
||||||
|
},
|
||||||
|
"kanbn.showBurndownButton": false,
|
||||||
|
"kanbn.showSprintButton": false
|
||||||
|
}
|
23
.vscode/tasks.json
vendored
Normal file
23
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Kanbn Console",
|
||||||
|
"type": "npm",
|
||||||
|
"script": "kanbn.board",
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Kanbn Write Boad",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "& kanbn board -j | L:/Git/kanbn2md/kanbn2md.exe >.kanbn/board.md",
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Kanbn Write json",
|
||||||
|
"type": "npm",
|
||||||
|
"script": "kanbn.board.json",
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
21
index.html
Normal file
21
index.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||||
|
<meta name="msapplication-tap-highlight" content="no">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
|
||||||
|
<title>www</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="deviceReady">
|
||||||
|
<p><a href='slideshow/index.html?b=2024-11-23-22-25'>Slideshow</a></p>
|
||||||
|
<p><a href='slideshow/index.html?a=last&b=2024-11-23-22-25'>Slideshow (Last)</a></p>
|
||||||
|
<p><a href='slideshow/index.html?a=time&b=2024-11-23-22-25'>Slideshow (Time)</a></p>
|
||||||
|
<p><a href='slideshow/index.html?a=noSleep&b=2024-11-23-22-25'>Slideshow (No Sleep)</a></p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
52
index.lighttpd.html
Normal file
52
index.lighttpd.html
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>Welcome page</title>
|
||||||
|
<style type="text/css" media="screen">
|
||||||
|
body { background: #e7e7e7; font-family: Verdana, sans-serif; font-size: 11pt; }
|
||||||
|
#page { background: #ffffff; margin: 50px; border: 2px solid #c0c0c0; padding: 10px; }
|
||||||
|
#header { background: #4b6983; border: 2px solid #7590ae; text-align: center; padding: 10px; color: #ffffff; }
|
||||||
|
#header h1 { color: #ffffff; }
|
||||||
|
#body { padding: 10px; }
|
||||||
|
span.tt { font-family: monospace; }
|
||||||
|
span.bold { font-weight: bold; }
|
||||||
|
a:link { text-decoration: none; font-weight: bold; color: #C00; background: #ffc; }
|
||||||
|
a:visited { text-decoration: none; font-weight: bold; color: #999; background: #ffc; }
|
||||||
|
a:active { text-decoration: none; font-weight: bold; color: #F00; background: #FC0; }
|
||||||
|
a:hover { text-decoration: none; color: #C00; background: #FC0; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="page">
|
||||||
|
<div id="header">
|
||||||
|
<h1> Placeholder page </h1>
|
||||||
|
The owner of this web site has not put up any web pages yet. Please come back later.
|
||||||
|
</div>
|
||||||
|
<div id="body">
|
||||||
|
<h2>You should replace this page with your own web pages as soon as possible.</h2>
|
||||||
|
Unless you changed its configuration, your new server is configured as follows:
|
||||||
|
<ul>
|
||||||
|
<li>Configuration files can be found in <span class="tt">/etc/lighttpd</span>. Please read <span class="tt">/etc/lighttpd/conf-available/README</span> file.</li>
|
||||||
|
<li>The DocumentRoot, which is the directory under which all your HTML files should exist, is set to <span class="tt">/var/www/html</span>.</li>
|
||||||
|
<li>CGI scripts are looked for in <span class="tt">/usr/lib/cgi-bin</span>, which is where Ubuntu packages will place their scripts. You can enable cgi module by using command <span class="bold tt">"lighty-enable-mod cgi"</span>.</li>
|
||||||
|
<li>Log files are placed in <span class="tt">/var/log/lighttpd</span>, and will be rotated weekly. The frequency of rotation can be easily changed by editing <span class="tt">/etc/logrotate.d/lighttpd</span>.</li>
|
||||||
|
<li>The default directory index is <span class="tt">index.html</span>, meaning that requests for a directory <span class="tt">/foo/bar/</span> will give the contents of the file /var/www/html/foo/bar/index.html if it exists (assuming that <span class="tt">/var/www/html</span> is your DocumentRoot).</li>
|
||||||
|
<li>You can enable user directories by using command <span class="bold tt">"lighty-enable-mod userdir"</span></li>
|
||||||
|
</ul>
|
||||||
|
<h2>About this page</h2>
|
||||||
|
<p>
|
||||||
|
This is a placeholder page installed by the Ubuntu release of the <a href="http://packages.ubuntu.com/lighttpd">Lighttpd server package.</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
This computer has installed the Ubuntu operating system, but it has nothing to do with the Ubuntu Project. Please do not contact the Ubuntu Project about it.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you find a bug in this Lighttpd package, or in Lighttpd itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the
|
||||||
|
<a href="https://bugs.launchpad.net/ubuntu/+source/lighttpd">Ubuntu Bug Tracking System.</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- s:853e9a42efca88ae0dd1a83aeb215047 -->
|
||||||
|
</body>
|
||||||
|
</html>
|
23
index.nginx-debian.html
Normal file
23
index.nginx-debian.html
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Welcome to nginx!</title>
|
||||||
|
<style>
|
||||||
|
html { color-scheme: light dark; }
|
||||||
|
body { width: 35em; margin: 0 auto;
|
||||||
|
font-family: Tahoma, Verdana, Arial, sans-serif; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Welcome to nginx!</h1>
|
||||||
|
<p>If you see this page, the nginx web server is successfully installed and
|
||||||
|
working. Further configuration is required.</p>
|
||||||
|
|
||||||
|
<p>For online documentation and support please refer to
|
||||||
|
<a href="http://nginx.org/">nginx.org</a>.<br/>
|
||||||
|
Commercial support is available at
|
||||||
|
<a href="http://nginx.com/">nginx.com</a>.</p>
|
||||||
|
|
||||||
|
<p><em>Thank you for using nginx.</em></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
27
package-lock.json
generated
Normal file
27
package-lock.json
generated
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "www",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin/prettier.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"prettier.check": "prettier . --check",
|
||||||
|
"prettier.write": "prettier . --write",
|
||||||
|
"kanbn.board": "kanbn board",
|
||||||
|
"kanbn.board.json": "kanbn board -j > .kanbn/board.json",
|
||||||
|
"garbage-collect": "git gc"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
[
|
|
||||||
"/../slideshow/images/Turtle.jpg",
|
|
||||||
"/../slideshow/images/Windows Logo.jpg"
|
|
||||||
]
|
|
BIN
slideshow/favicon.ico
Normal file
BIN
slideshow/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
@ -1,14 +1,17 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||||
<meta name="msapplication-tap-highlight" content="no">
|
<meta name="msapplication-tap-highlight" content="no">
|
||||||
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
|
<meta name="viewport"
|
||||||
|
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
|
||||||
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen">
|
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen">
|
||||||
<link rel="stylesheet" href="css/bootswatch/slate/bootstrap.min.css">
|
<link rel="stylesheet" href="css/bootswatch/slate/bootstrap.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="css/index.css">
|
<link rel="stylesheet" type="text/css" href="css/index.css">
|
||||||
<title>Slideshow</title>
|
<title>Slideshow</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="deviceReady">
|
<div id="deviceReady">
|
||||||
<div class="opaque"></div>
|
<div class="opaque"></div>
|
||||||
@ -18,6 +21,7 @@
|
|||||||
<script src="scripts/jquery-1.9.1.min.js"></script>
|
<script src="scripts/jquery-1.9.1.min.js"></script>
|
||||||
<script src="scripts/bootstrap.min.js"></script>
|
<script src="scripts/bootstrap.min.js"></script>
|
||||||
<script src="scripts/jquery.bgswitcher.js"></script>
|
<script src="scripts/jquery.bgswitcher.js"></script>
|
||||||
<script type="text/javascript" src="scripts/index.js?nocache=2022_02_12_03_31_PM"></script>
|
<script type="text/javascript" src="scripts/index.js?nocache=2024-11-23-22-25"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
17
slideshow/index.json
Normal file
17
slideshow/index.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"ImageIntervalX": 9123,
|
||||||
|
"ImageIntervalXX": 21234,
|
||||||
|
"ImageInterval": 15123,
|
||||||
|
"JsonInterval": 59000,
|
||||||
|
"ImageZero": "images/1x1_00000000.png",
|
||||||
|
"DataDirectoryX": "../.random",
|
||||||
|
"DataDirectoryXX": "../Images-c9dbce3b-Results/F)Random/c9dbce3b/[]",
|
||||||
|
"DataDirectory": "random-results",
|
||||||
|
"ImmichUrlX": "http://192.168.11.2:3001/api/assets/",
|
||||||
|
"ImmichUrlXX": "https://immich.phares.duckdns.org/api/assets/",
|
||||||
|
"RandomPathsUrlX": "http://192.168.11.2:5009/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/random-paths/",
|
||||||
|
"RandomPathsUrlXX": "https://immichtoslideshow.phares.duckdns.org/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/random-paths/",
|
||||||
|
"RootX": "../.original",
|
||||||
|
"RootXX": "../Images-c9dbce3b-Results/thumbs",
|
||||||
|
"Root": "5f0b1052-466d-44de-a554-226d7256850d/"
|
||||||
|
}
|
@ -1,180 +1,49 @@
|
|||||||
// For an introduction to the Blank template, see the following documentation:
|
(function () {
|
||||||
// http://go.microsoft.com/fwlink/?LinkID=397704
|
|
||||||
// To debug code on page load in cordova-simulate or on Android devices/emulators: launch your app, set breakpoints,
|
|
||||||
// and then run "window.location.reload()" in the JavaScript Console.
|
|
||||||
(function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var _Root;
|
var _Root;
|
||||||
var _RootAlt;
|
var _RootAlt;
|
||||||
var _JsonTimer;
|
var _ImageZero;
|
||||||
var _ImageTimer;
|
var _DataDirectory;
|
||||||
|
var _RandomPathsUrl;
|
||||||
|
|
||||||
var _Pause = 0;
|
var _Pause = 0;
|
||||||
var _Images = [];
|
var _Images = [];
|
||||||
|
var _JsonInterval;
|
||||||
|
var _ImageInterval;
|
||||||
var _ImageIndex = 0;
|
var _ImageIndex = 0;
|
||||||
var _OpaqueIndex = 0;
|
var _OpaqueIndex = 0;
|
||||||
var _JsonInterval = 59000;
|
var _DeviceReadyDiv = $('#deviceReady div');
|
||||||
var _ImageInterval = 5000;
|
|
||||||
var _DeviceReadyDiv = $("#deviceReady div");
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
var time = document.createElement('time');
|
||||||
|
time.setAttribute('style', 'position: fixed;');
|
||||||
console.log("onDeviceReady");
|
|
||||||
|
|
||||||
// Handle the Cordova pause and resume events
|
|
||||||
document.addEventListener('pause', onPause.bind(this), false);
|
|
||||||
document.addEventListener('resume', onResume.bind(this), false);
|
|
||||||
|
|
||||||
document.addEventListener('keyup', getInput, false);
|
|
||||||
|
|
||||||
loadDevice();
|
|
||||||
loadData();
|
|
||||||
|
|
||||||
_JsonTimer = setInterval(onTickJSON, _JsonInterval);
|
|
||||||
_ImageTimer = setInterval(onTickImage, _ImageInterval);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function onPause() {
|
|
||||||
// TODO: This application has been suspended. Save application state here.
|
|
||||||
}
|
|
||||||
|
|
||||||
function onResume() {
|
|
||||||
// TODO: This application has been reactivated. Restore application state here.
|
|
||||||
}
|
|
||||||
|
|
||||||
function goBack() {
|
|
||||||
_Pause = 1;
|
|
||||||
if (_Pause === 0) {
|
|
||||||
_ImageIndex -= 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_ImageIndex -= 2;
|
|
||||||
}
|
|
||||||
if (_ImageIndex === 0) {
|
|
||||||
_ImageIndex = _Images.length - 1;
|
|
||||||
}
|
|
||||||
var backgroundImage = GetBackgroundImage();
|
|
||||||
_DeviceReadyDiv.attr('style', backgroundImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
function goForward() {
|
|
||||||
_Pause = 1;
|
|
||||||
_ImageIndex += 1;
|
|
||||||
if (_ImageIndex >= _Images.length) {
|
|
||||||
_ImageIndex = 0;
|
|
||||||
}
|
|
||||||
var backgroundImage = GetBackgroundImage();
|
|
||||||
_DeviceReadyDiv.attr('style', backgroundImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeImageTimer(imageInterval) {
|
|
||||||
_ImageInterval = imageInterval;
|
|
||||||
clearTimeout(_ImageTimer);
|
|
||||||
_ImageTimer = setInterval(onTickImage, _ImageInterval);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getInput(e) {
|
|
||||||
var which = e.which;
|
|
||||||
switch (which) {
|
|
||||||
case 13: //Okay
|
|
||||||
if (_Pause === 0) {
|
|
||||||
_Pause = 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_Pause = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 37: //Left
|
|
||||||
goBack();
|
|
||||||
break;
|
|
||||||
case 38: //Up
|
|
||||||
goForward();
|
|
||||||
break;
|
|
||||||
case 39: //Right
|
|
||||||
goForward();
|
|
||||||
break;
|
|
||||||
case 40: //Down
|
|
||||||
goBack();
|
|
||||||
break;
|
|
||||||
case 173: //Fast Forward
|
|
||||||
goForward();
|
|
||||||
break;
|
|
||||||
case 177: //Rewind
|
|
||||||
goBack();
|
|
||||||
break;
|
|
||||||
case 8: //Delete
|
|
||||||
console.log('Delete key was pressed!');
|
|
||||||
break;
|
|
||||||
case 48: //0
|
|
||||||
changeImageTimer(10000);
|
|
||||||
break;
|
|
||||||
case 49: //1
|
|
||||||
changeImageTimer(1000);
|
|
||||||
break;
|
|
||||||
case 50: //2
|
|
||||||
changeImageTimer(2000);
|
|
||||||
break;
|
|
||||||
case 51: //3
|
|
||||||
changeImageTimer(3000);
|
|
||||||
break;
|
|
||||||
case 52: //4
|
|
||||||
changeImageTimer(4000);
|
|
||||||
break;
|
|
||||||
case 53: //5
|
|
||||||
changeImageTimer(5000);
|
|
||||||
break;
|
|
||||||
case 54: //6
|
|
||||||
changeImageTimer(6000);
|
|
||||||
break;
|
|
||||||
case 55: //7
|
|
||||||
changeImageTimer(7000);
|
|
||||||
break;
|
|
||||||
case 56: //8
|
|
||||||
changeImageTimer(8000);
|
|
||||||
break;
|
|
||||||
case 57: //9
|
|
||||||
changeImageTimer(9000);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadDevice() {
|
|
||||||
_Root = '../pictures';
|
|
||||||
_RootAlt = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadData() {
|
function loadData() {
|
||||||
var isoString = new Date().toISOString();
|
var currentDate = new Date();
|
||||||
var url = '../random/' + isoString.substring(5, isoString.indexOf("T")) + '.json';
|
var mm = (new Date().getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
var dd = currentDate.getDate().toString().padStart(2, '0');
|
||||||
|
if (window.location.href.indexOf('time') > 0) {
|
||||||
|
time.innerText = mm + '-' + dd + '.json';
|
||||||
|
}
|
||||||
|
var url = _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2024-11-23-22-25';
|
||||||
console.log(url);
|
console.log(url);
|
||||||
var _ = $.getJSON(url, function (data) {
|
$.getJSON(url, function (data) {
|
||||||
console.log("success", data.length);
|
console.log('success', data.length);
|
||||||
_Images = [];
|
_Images = [];
|
||||||
$.each(data, function (index, value) {
|
$.each(data, function (_, value) {
|
||||||
_Images.push(value.replaceAll("\\", "/"));
|
// _Images.push(value.replaceAll("\\", "/"));
|
||||||
|
_Images.push(value);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.done(function () {
|
.done(function () { console.log('second success'); })
|
||||||
console.log("second success");
|
.fail(function (er) { console.log('error', er); })
|
||||||
})
|
.always(function () { console.log('complete'); });
|
||||||
.fail(function (er) {
|
|
||||||
console.log("error", er);
|
|
||||||
//_Images = ['images/img_tree.gif'];
|
|
||||||
//_Images = ['images/output-onlinepngtools.png'];
|
|
||||||
_Images = ['images/1x1_00000000.png']; // https://shoonia.github.io/1x1/#00000000
|
|
||||||
})
|
|
||||||
.always(function () {
|
|
||||||
console.log("complete");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTickJSON() {
|
function onTickJSON() {
|
||||||
var currentDate = new Date();
|
var currentDate = new Date();
|
||||||
var currentHours = currentDate.getHours();
|
var currentHours = currentDate.getHours();
|
||||||
if (currentHours === 21) {
|
if (currentHours === 0) {
|
||||||
var currentMinutes = currentDate.getMinutes();
|
var currentMinutes = currentDate.getMinutes();
|
||||||
if (currentMinutes === 0) {
|
if (currentMinutes === 0) {
|
||||||
loadData();
|
loadData();
|
||||||
@ -183,13 +52,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GetBackgroundImage() {
|
function GetBackgroundImage() {
|
||||||
var result = "background-image: url('" + _Root + _Images[_ImageIndex] + "'), url('";
|
var result = "background-image: url('" + _Root + _Images[_ImageIndex] + '?index=' + _ImageIndex + "'), url('";
|
||||||
if (_RootAlt !== null) {
|
if (_RootAlt !== null) {
|
||||||
result = result + _RootAlt + _Images[_ImageIndex] + "'), url('";
|
result = result + _RootAlt + _Images[_ImageIndex] + '?index=' + _ImageIndex + "'), url('";
|
||||||
}
|
}
|
||||||
//result = result + "images/img_tree.gif');";
|
result = result + _ImageZero + "');";
|
||||||
//result = result + "images/output-onlinepngtools.png');";
|
|
||||||
result = result + "images/1x1_00000000.png');"; // https://shoonia.github.io/1x1/#00000000
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,11 +64,11 @@
|
|||||||
if (_Images.length > 0 && _Pause === 0) {
|
if (_Images.length > 0 && _Pause === 0) {
|
||||||
var currentDate = new Date();
|
var currentDate = new Date();
|
||||||
var currentHours = currentDate.getHours();
|
var currentHours = currentDate.getHours();
|
||||||
if (currentHours >= 22 || currentHours <= 6) {
|
if (currentHours >= 23 || currentHours <= 6) {
|
||||||
_DeviceReadyDiv.attr('style', 'background-color: #191717;');
|
_DeviceReadyDiv.attr('style', 'background-color: #191717;');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_DeviceReadyDiv.eq(_OpaqueIndex).removeClass("opaque");
|
_DeviceReadyDiv.eq(_OpaqueIndex).removeClass('opaque');
|
||||||
_ImageIndex += 1;
|
_ImageIndex += 1;
|
||||||
if (_ImageIndex >= _Images.length) {
|
if (_ImageIndex >= _Images.length) {
|
||||||
_ImageIndex = 0;
|
_ImageIndex = 0;
|
||||||
@ -224,9 +91,132 @@
|
|||||||
}
|
}
|
||||||
var backgroundImage = GetBackgroundImage();
|
var backgroundImage = GetBackgroundImage();
|
||||||
_DeviceReadyDiv.eq(loadIndex).attr('style', backgroundImage);
|
_DeviceReadyDiv.eq(loadIndex).attr('style', backgroundImage);
|
||||||
_DeviceReadyDiv.eq(_OpaqueIndex).addClass("opaque");
|
_DeviceReadyDiv.eq(_OpaqueIndex).addClass('opaque');
|
||||||
|
if (window.location.href.indexOf('time') > 0) {
|
||||||
|
var mm = (new Date().getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
var dd = currentDate.getDate().toString().padStart(2, '0');
|
||||||
|
time.innerText = mm + '-' + dd + '.json' + ' ' + _Images[_ImageIndex];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pause() {
|
||||||
|
_Pause = 1;
|
||||||
|
$('#deviceReady').innerHTML = '<div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
if (_Pause === 0) {
|
||||||
|
pause();
|
||||||
|
}
|
||||||
|
_ImageIndex -= 1;
|
||||||
|
if (_ImageIndex === 0) {
|
||||||
|
_ImageIndex = _Images.length - 1;
|
||||||
|
}
|
||||||
|
var backgroundImage = GetBackgroundImage();
|
||||||
|
_DeviceReadyDiv.attr('style', backgroundImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
function goForward() {
|
||||||
|
if (_Pause === 0) {
|
||||||
|
pause();
|
||||||
|
}
|
||||||
|
_ImageIndex += 1;
|
||||||
|
if (_ImageIndex >= _Images.length) {
|
||||||
|
_ImageIndex = 0;
|
||||||
|
}
|
||||||
|
var backgroundImage = GetBackgroundImage();
|
||||||
|
_DeviceReadyDiv.attr('style', backgroundImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getInput(e) {
|
||||||
|
var which = e.which;
|
||||||
|
switch (which) {
|
||||||
|
case 13: //Okay
|
||||||
|
if (_Pause === 0) {
|
||||||
|
_Pause = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_Pause = 0;
|
||||||
|
$('#deviceReady').innerHTML = '<div class="opaque"></div><div></div><div></div>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 37: //Left
|
||||||
|
goBack();
|
||||||
|
break;
|
||||||
|
case 38: //Up
|
||||||
|
goForward();
|
||||||
|
break;
|
||||||
|
case 39: //Right
|
||||||
|
goForward();
|
||||||
|
break;
|
||||||
|
case 40: //Down
|
||||||
|
goBack();
|
||||||
|
break;
|
||||||
|
case 173: //Fast Forward
|
||||||
|
goForward();
|
||||||
|
break;
|
||||||
|
case 177: //Rewind
|
||||||
|
goBack();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.location.href.indexOf('time') > 0) {
|
||||||
|
document.body.appendChild(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.location.href.indexOf('last') > 0) {
|
||||||
|
var url = '../log-nginx/access.log?nocache=2024-11-23-22-25';
|
||||||
|
$.get(url, function (data) {
|
||||||
|
var arrayOfUrl = [];
|
||||||
|
var arrayOfIndex = [];
|
||||||
|
var arrayOfLines = data.match(/[^\r\n]+/g);
|
||||||
|
for (var i = arrayOfLines.length - 1; i >= 0; i--) {
|
||||||
|
arrayOfUrl = arrayOfLines[i].split('?index=');
|
||||||
|
if (arrayOfUrl.length !== 2)
|
||||||
|
continue;
|
||||||
|
arrayOfIndex = arrayOfUrl[1].split(' ');
|
||||||
|
if (arrayOfIndex.length < 2)
|
||||||
|
continue;
|
||||||
|
var index = parseInt(arrayOfIndex[0]);
|
||||||
|
console.log('index', index);
|
||||||
|
_ImageIndex = index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.fail(function (err) {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
console.log('onDeviceReady');
|
||||||
|
|
||||||
|
document.addEventListener('keyup', getInput, false);
|
||||||
|
|
||||||
|
var url = '../slideshow/index.json?nocache=2024-11-23-22-25';
|
||||||
|
console.log(url);
|
||||||
|
var _ = $.getJSON(url, function (data) {
|
||||||
|
console.log(url + ' downloaded successfully');
|
||||||
|
_RootAlt = null;
|
||||||
|
_Root = data.Root;
|
||||||
|
_ImageZero = data.ImageZero;
|
||||||
|
_JsonInterval = data.JsonInterval;
|
||||||
|
_ImageInterval = data.ImageInterval;
|
||||||
|
_DataDirectory = data.DataDirectory;
|
||||||
|
console.log(url + ' used successfully');
|
||||||
|
})
|
||||||
|
.done(function () {
|
||||||
|
loadData();
|
||||||
|
_ = setInterval(onTickJSON, _JsonInterval);
|
||||||
|
_ = setInterval(onTickImage, _ImageInterval);
|
||||||
|
})
|
||||||
|
.fail(function (er) { console.log('error', er); })
|
||||||
|
.always(function () { console.log('complete'); });
|
||||||
|
});
|
||||||
|
|
||||||
})();
|
})();
|
Reference in New Issue
Block a user