diff --git a/.gitignore b/.gitignore index e15e010..694a471 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ random Images-dd514b88-Results node_modules -.kanbn \ No newline at end of file +.kanbn +.random +.original \ No newline at end of file diff --git a/.vscode/mklink.md b/.vscode/mklink.md new file mode 100644 index 0000000..d273d69 --- /dev/null +++ b/.vscode/mklink.md @@ -0,0 +1,14 @@ +--- +type: "note" +--- + +# mklink + +```bash +``` + +```bash +mklink /J "L:\Git\www\.kanbn" "D:\5-Other-Small\Kanban\www" +mklink /J "L:\Git\www\.random" "D:\1-Images-A\Images-7007a9df-Results\F)Random\7007a9df\[]" +mklink /J "L:\Git\www\.original" "D:\1-Images-A\Images-7007a9df-Results\C)Resize\7007a9df\Original\()" +``` diff --git a/index.html b/index.html index 5f43fb5..6c42679 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,9 @@
-

Slideshow

-

Slideshow (No Sleep)

+

Slideshow

+

Slideshow (Time)

+

Slideshow (No Sleep)

diff --git a/slideshow/index.html b/slideshow/index.html index 8081d15..ef1e7a4 100644 --- a/slideshow/index.html +++ b/slideshow/index.html @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/slideshow/index.json b/slideshow/index.json index 0afdc2b..2e1e529 100644 --- a/slideshow/index.json +++ b/slideshow/index.json @@ -2,6 +2,8 @@ "ImageInterval": 9123, "JsonInterval": 59000, "ImageZero": "images/1x1_00000000.png", - "DataDirectory": "../Images-dd514b88-Results/F)Random/dd514b88/[]", - "Root": "../Images-dd514b88-Results/C)Resize/dd514b88/1376 x 768/()/_ _ _" + "DataDirectoryX": "../.random", + "DataDirectory": "../Images-7007a9df-Results/F)Random/7007a9df/[]", + "RootX": "../.original", + "Root": "../Images-7007a9df-Results/C)Resize/7007a9df/Original/()" } \ No newline at end of file diff --git a/slideshow/scripts/index.js b/slideshow/scripts/index.js index b18b7ee..995da0a 100644 --- a/slideshow/scripts/index.js +++ b/slideshow/scripts/index.js @@ -8,7 +8,6 @@ var _Root; var _RootAlt; var _ImageZero; - var _JsonTimer; var _ImageTimer; var _DataDirectory; @@ -20,17 +19,23 @@ var _OpaqueIndex = 0; var _DeviceReadyDiv = $("#deviceReady div"); + var time = document.createElement('time'); + time.setAttribute('style', 'position: fixed;'); + + // Create the root video element + var video = document.createElement('video'); + video.setAttribute('loop', ''); + // Add some styles if needed + video.setAttribute('style', 'position: fixed;'); + $(document).ready(function () { 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); - var url = '../slideshow/index.json'; + var url = '../slideshow/index.json?nocache=2024-01-28-20-23'; console.log(url); var _ = $.getJSON(url, function (data) { console.log(url + " downloaded successfully"); @@ -44,33 +49,13 @@ }) .done(function () { loadData(); - - _JsonTimer = setInterval(onTickJSON, _JsonInterval); + _ = setInterval(onTickJSON, _JsonInterval); _ImageTimer = setInterval(onTickImage, _ImageInterval); }) - .fail(function (er) { - console.log("error", er); - _ImageInterval = 5000; - _JsonInterval = 59000; - _Root = "../pictures"; - _DataDirectory = "../random"; - // _ImageZero = "images/img_tree.gif"; - // _ImageZero = "images/output-onlinepngtools.png"; - _ImageZero = "images/1x1_00000000.png"; // https://shoonia.github.io/1x1/#00000000 - }) - .always(function () { - console.log("complete"); - }); + .fail(function (er) { console.log("error", er); }) + .always(function () { console.log("complete"); }); }); - 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) { @@ -172,25 +157,21 @@ var currentDate = new Date(); var mm = (new Date().getMonth() + 1).toString().padStart(2, '0'); var dd = currentDate.getDate().toString().padStart(2, '0'); - var url = _DataDirectory + '/' + mm + '-' + dd + '.json'; + if (window.location.href.indexOf('time') > 0) { + time.innerText = mm + '-' + dd + '.json'; + } + var url = _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2024-01-28-20-23'; console.log(url); - var _ = $.getJSON(url, function (data) { + $.getJSON(url, function (data) { console.log("success", data.length); _Images = []; - $.each(data, function (index, value) { + $.each(data, function (_, value) { _Images.push(value.replaceAll("\\", "/")); }); }) - .done(function () { - console.log("second success"); - }) - .fail(function (er) { - console.log("error", er); - _Images = [_ImageZero]; - }) - .always(function () { - console.log("complete"); - }); + .done(function () { console.log("second success"); }) + .fail(function (er) { console.log("error", er); }) + .always(function () { console.log("complete"); }); } function onTickJSON() { @@ -245,16 +226,15 @@ var backgroundImage = GetBackgroundImage(); _DeviceReadyDiv.eq(loadIndex).attr('style', backgroundImage); _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]; + } } } } - // Create the root video element - var video = document.createElement('video'); - video.setAttribute('loop', ''); - // Add some styles if needed - video.setAttribute('style', 'position: fixed;'); - // A helper to add sources to video function addSourceToVideo(element, type, dataURI) { var source = document.createElement('source'); @@ -285,4 +265,8 @@ document.body.addEventListener('touchend', playFn); } + if (window.location.href.indexOf('time') > 0) { + document.body.appendChild(time); + } + })(); \ No newline at end of file