Skip to content

Commit

Permalink
embedding with style
Browse files Browse the repository at this point in the history
  • Loading branch information
paolini committed Jan 28, 2024
1 parent 46f6989 commit 76b0e09
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
7 changes: 5 additions & 2 deletions embedPage.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
class EmbedPage {
constructor({url,priority,duration}) {
constructor({url,priority,duration,style, delay}) {
this.durationProp = duration
this.priorityProp = priority
this.html = `<iframe src="${url}"></iframe>`
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) {
Expand Down
2 changes: 2 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ body {
}

.embed {
position: absolute;
display: none;
height: 920px;
width: 100%;
}

.embed iframe {
Expand Down
45 changes: 35 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
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,
priority: () => {
// 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,
}),
]

Expand Down

0 comments on commit 76b0e09

Please sign in to comment.