Compare commits

...

3 commits

Author SHA1 Message Date
j
4cd8560312 revert annotation max height calculation 2022-09-26 22:08:29 +01:00
j
405cb1029d fix italic urls 2022-09-26 22:04:10 +01:00
j
0746a2ab6c update height on display 2022-09-26 22:04:10 +01:00
2 changed files with 7 additions and 31 deletions

View file

@ -39,15 +39,15 @@
}
@font-face {
font-family: 'noto_sans';
src: url('noto-sans-bold-italic-webfont.woff2') format('woff2'),
url('noto-sans-bold-italic-webfont.woff') format('woff');
src: url('../../static/fonts/noto-sans/noto-sans-bold-italic-webfont.woff2') format('woff2'),
url('../../static/fonts/noto-sans/noto-sans-bold-italic-webfont.woff') format('woff');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'noto_sans';
src: url('noto-sans-bold-italic-webfont.woff2') format('woff2'),
url('noto-sans-bold-italic-webfont.woff') format('woff');
src: url('../../static/fonts/noto-sans/noto-sans-bold-italic-webfont.woff2') format('woff2'),
url('../../static/fonts/noto-sans/noto-sans-bold-italic-webfont.woff') format('woff');
font-weight: 700;
font-style: bold italic;
}

View file

@ -71,18 +71,10 @@ function timeupdate(event) {
var ain = parseFloat(annot.dataset.in)
var aout = parseFloat(annot.dataset.out)
if (ain <= currentTime && aout > currentTime) {
if (annot.classList.contains('single')) {
annot.style.opacity = '1'
} else {
annot.style.display = ''
}
} else {
if (annot.classList.contains('single')) {
annot.style.opacity = '0'
} else {
annot.style.display = 'none'
}
}
})
}
@ -417,7 +409,6 @@ function renderSingleMode(config) {
config.root.appendChild(div)
var frame = div.querySelector('.frame')
var text = div.querySelector('.text')
text.style.position = 'relative'
var first = config.annotations[0]
if (text && first) {
var color1 = `hsl(${first.color1.hue}, 60%, 15%)`
@ -436,28 +427,13 @@ function renderSingleMode(config) {
values = values.join('<br><br>')
var annot = document.createElement('div')
annot.classList.add('annotation')
annot.classList.add('single')
annot.innerHTML = values
//console.log(clip)
annot.dataset['in'] = clip.annotations[0]['in']
annot.dataset['out'] = clip.annotations[0]['out']
annot.style.opacity = '0'
annot.style.position = 'absolute'
annot.style.display = 'none'
text.appendChild(annot)
})
if (config.annotations.length) {
text.style.height = '72px';
}
setTimeout(() => {
var height = 0
text.querySelectorAll('.annotation.single').forEach(annotation => {
var rect = annotation.getBoundingClientRect()
if (rect.height > height) {
height = rect.height
}
})
text.style.height = height + 'px';
}, 50)
if (frame) {
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
}