add banner ad view counting
This commit is contained in:
@@ -56,8 +56,8 @@ function Viewer(type, viewToken, data) {
|
||||
this.setFile(fileFromSkyNet(data))
|
||||
}
|
||||
|
||||
// this.renderSponsors()
|
||||
// window.addEventListener("resize", e => { this.renderSponsors(e) })
|
||||
this.renderSponsorsSimple()
|
||||
window.addEventListener("resize", e => { this.renderSponsorsSimple() })
|
||||
|
||||
// Register keyboard shortcuts
|
||||
document.addEventListener("keydown", e => { this.keyboardEvent(e) })
|
||||
@@ -138,6 +138,24 @@ Viewer.prototype.setFile = function(file) {
|
||||
}
|
||||
}
|
||||
|
||||
Viewer.prototype.renderSponsorsSimple = function() {
|
||||
let scale = 1
|
||||
let scaleWidth = 1
|
||||
let scaleHeight = 1
|
||||
let minWidth = 768
|
||||
let minHeight = 1000
|
||||
|
||||
if (window.innerWidth < minWidth) {
|
||||
scaleWidth = window.innerWidth/minWidth
|
||||
}
|
||||
if (window.innerHeight < minHeight) {
|
||||
scaleHeight = window.innerHeight/minHeight
|
||||
}
|
||||
scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight
|
||||
|
||||
document.querySelector(".sponsors").style.height = (scale*128)+"px"
|
||||
}
|
||||
|
||||
// Viewer.prototype.renderSponsors = function() {
|
||||
// let scale = 1
|
||||
// let scaleWidth = 1
|
||||
|
BIN
res/static/img/misc/banner_as.png
Normal file
BIN
res/static/img/misc/banner_as.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 KiB |
@@ -105,6 +105,12 @@
|
||||
<div class="center" style="width: 100px; height: 100px;">{{template "spinner.svg" .}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sponsors" class="sponsors">
|
||||
<a href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.embedded-world.de%2Fen%2Fbecome-visitor">
|
||||
<img src="/res/img/misc/banner_as.png" style="display: block; margin: auto; height: 100%;" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template id="tpl_details_popup">
|
||||
|
Reference in New Issue
Block a user