diff --git a/frontend/elements/ken-burns.html b/frontend/elements/ken-burns.html new file mode 100755 index 0000000..d23d27b --- /dev/null +++ b/frontend/elements/ken-burns.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html index 9e4726c..78a37ba 100755 --- a/frontend/src/ketr-photos/ketr-photos.html +++ b/frontend/src/ketr-photos/ketr-photos.html @@ -37,6 +37,7 @@ + @@ -334,11 +335,14 @@ + S
+
+
Holidays
+
+
[[slideshowInfo]]
+
[[holidayTitle]]
(next upcoming Holiday!!)
@@ -435,6 +442,7 @@
~ Loading ~
+
@@ -1225,8 +1233,30 @@ this.async(this.processItems.bind(this)); console.log("Total pending: " + this.pendingPhotos.length); + + if (this.mode == "slideshow" && !this.slideshowTimeout) { + this.slideshowNext(); + } }, + slideshowNext: function() { + if (this.mode != "slideshow") { + window.cancelTimeout(this.slideshowTimeout); + delete this.slideshowTimeout; + return; + } + this.slideshowTimeout = window.setTimeout(this.slideshowNext.bind(this), 24 * 1000); + if (!this.thumbnails.length) { + return; + } + var photo = this.thumbnails[Math.floor(this.thumbnails.length * Math.random())]; + this.$.kenBurns.item = photo.item; + this.$.kenBurns.src = this.base + photo.item.path + "thumbs/scaled/" + photo.item.filename; + var datetime = (photo.taken || photo.modified || photo.added).replace(/T.*/, ""); + this.slideshowInfo = "In the year of " + datetime.replace(/(....).*/, "$1"); + }, + + /* Asynchronously load items into the DOM */ processItems: function() { if (this.processing) { @@ -1761,7 +1791,7 @@ path = mode; if (mode == "time") { path = ""; - } else if (mode == "memories") { + } else if (mode == "memories" || mode == "slideshow") { path = "memories/" + (this.date.replace(this.year + "-", "") || ""); } else if (mode == "holiday") { path = "holiday/" + this.holiday; @@ -1780,7 +1810,7 @@ (mode != this.mode) || ((mode == "albums") && (path != (this.path || ""))) || ((mode == "holiday") && (path != ("holiday/" + this.holiday))) || - ((mode == "memories") && (path != ("memories/" + (this.date.replace(this.year + "-", "") || ""))))) { + ((mode == "memories" || mode == "slideshow") && (path != ("memories/" + (this.date.replace(this.year + "-", "") || ""))))) { console.log("Skipping results for old query. Triggering re-fetch of photos for new path or mode."); this._loadPhotos(); return;