From 76b0e09e198eb626755c406bf52d1e3265375c9d Mon Sep 17 00:00:00 2001 From: Emanuele Paolini Date: Sun, 28 Jan 2024 17:08:55 +0100 Subject: [PATCH] embedding with style --- embedPage.js | 7 +++++-- index.css | 2 ++ index.js | 45 +++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/embedPage.js b/embedPage.js index 8e71a51..4aaf518 100644 --- a/embedPage.js +++ b/embedPage.js @@ -1,17 +1,20 @@ class EmbedPage { - constructor({url,priority,duration}) { + constructor({url,priority,duration,style, delay}) { this.durationProp = duration this.priorityProp = priority this.html = `` + this.style = style + this.delay = delay } start() { if (this.div) throw Error(`reentrant call`) this.div = document.createElement('div') this.div.className = 'embed' + this.div.style = this.style || "" this.div.innerHTML = this.html document.body.appendChild(this.div) - $(this.div).fadeIn(500) + $(this.div).fadeIn(this.delay || 500) } stop(callback) { diff --git a/index.css b/index.css index 9fe1aa0..7c94446 100644 --- a/index.css +++ b/index.css @@ -155,8 +155,10 @@ body { } .embed { + position: absolute; display: none; height: 920px; + width: 100%; } .embed iframe { diff --git a/index.js b/index.js index f07f85b..abfef47 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,16 @@ const pages = [ - new FullScreenImagePage({ - imageUrl: "images/colloquium_gray.png?d=20231213x", - start: "2024-01-27 06:00", - end: "2024-01-27 18:44" - }), + // new FullScreenImagePage({ + // imageUrl: "images/colloquium_gray.png?d=20231213x", + // start: "2024-01-27 06:00", + // end: "2024-01-27 18:44" + // }), + new EventsAndVisitorsPage(), + new FractalXmasPage(), - new LaureePage(), + + // new LaureePage(), + new EmbedPage({ url: "https://lab.phc.dm.unipi.it/problemi/jumbotron", duration: 60000, @@ -14,14 +18,35 @@ const pages = [ // show with high priority // between 7pm and 7am const date = moment().tz("Europe/Rome").format('HH-mm') - if (date >= '19-00' || date <= '07-00') return 1 - return 0 + if (date >= '19-00' || date <= '07-00') return 2 + else return 0 } }), + new EmbedPage({ url: "https://montblanc.panomax.com/", - duration: 10000, - priority: 1, + duration: 60000, + priority: () => { + // show only in minute 14 + const date = moment().tz("Europe/Rome").format('mm') + if (date === '42') return 3 + else return 0 + }, + style: "margin-top: -150px; margin-bottom: -100px; z-index: -1; zoom: 1.2", + delay: 10000, + }), + + new EmbedPage({ + url: "https://zoncolan.panomax.com/", + duration: 60000, + priority: () => { + // show only in minute 19 + const date = moment().tz("Europe/Rome").format('mm') + if (date === '19') return 3 + else return 0 + }, + style: "margin-top: -150px; margin-bottom: -100px; z-index: -1; zoom: 1.2", + delay: 10000, }), ]