show text info

This commit is contained in:
j 2021-10-11 14:50:19 +01:00
commit f211375bbe
3 changed files with 24 additions and 7 deletions

View file

@ -105,6 +105,19 @@ function timeupdate(event) {
}
}
function formatInfo(config, ascroll) {
var h1 = document.createElement('h1')
h1.innerHTML = config.title
ascroll.appendChild(h1)
var h2 = document.createElement('h2')
h2.innerHTML = config.byline
ascroll.appendChild(h2)
var div = document.createElement('div')
div.classList.add('intro')
div.innerHTML = config.body
ascroll.appendChild(div)
}
function loadItem(config) {
pandoraAPI('get', {id: config.item, keys: [
'id', 'title', 'layers', 'hue', 'saturation', 'lightness'
@ -122,10 +135,8 @@ function loadItem(config) {
video.addEventListener('timeupdate', timeupdate)
ascroll.appendChild(video)
var h1 = document.createElement('h1')
var first
h1.innerHTML = response.data.title
ascroll.appendChild(h1)
formatInfo(config, ascroll)
response.data.layers[layer].forEach(annotation => {
if (config.user && annotation.user != config.user) {
@ -168,10 +179,8 @@ function loadEdit(config) {
video.addEventListener('timeupdate', timeupdate)
ascroll.appendChild(video)
var h1 = document.createElement('h1')
var first
h1.innerHTML = response.data.name
ascroll.appendChild(h1)
formatInfo(config, ascroll)
response.data.clips.forEach(clip => {
clip.layers[layer].forEach(annotation => {