diff --git a/static/mobile/css/style.css b/static/mobile/css/style.css index 811b250c..a65bb02a 100644 --- a/static/mobile/css/style.css +++ b/static/mobile/css/style.css @@ -1,16 +1,29 @@ +:root { + --bg: rgb(16, 16, 16); + --fg: #CCCCCC; + --title: rgb(240, 240, 240); +} + body { margin: 0; - //background: rgb(240, 240, 240); - //background: rgb(144, 144, 144); - //color: rgb(0, 0, 0); - background: rgb(16, 16, 16); - color: rgb(240, 240, 240); + background: var(--bg); + color: var(--fg); font-family: "Noto Sans", "Lucida Grande", "Segoe UI", "DejaVu Sans", "Lucida Sans Unicode", Helvetica, Arial, sans-serif; line-height: normal; } +*, *::after, *::before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +*:focus { + outline: none; +} + a { - color: rgb(128, 128, 255) + color: var(--fg) } iframe { max-width: 100%; @@ -28,12 +41,19 @@ video, .poster { min-height: 100vh; max-width: 1000px; margin: auto; + padding-top: 16px; +} +.item-title { + color: var(--title); + text-decoration: underline; + padding-bottom: 0; + font-size: 16px; + text-wrap: balance; } .title { - padding-top: 16px; padding-bottom: 0; margin-bottom: 4px; - font-size: 14pt; + font-size: 18px; font-weight: bold; border-bottom: 1px solid pink; text-wrap: balance; @@ -48,6 +68,7 @@ video, .poster { padding-bottom: 0px; } @media(max-width:768px) { + .item-title, .title, .byline { padding-left: 4px; @@ -78,7 +99,14 @@ video, .poster { padding-top: 16px; padding-bottom: 16px; text-align: center; - font-size: 16pt; + font-size: 14px; +} +.more a { + color: rgb(144, 144, 144); +} +.more nav { + margin-top: 24px; + margin-bottom: 24px; } .layer.active { padding-top: 8px; diff --git a/static/mobile/js/VideoPlayer.js b/static/mobile/js/VideoPlayer.js index 829fc02f..93e4a2f2 100644 --- a/static/mobile/js/VideoPlayer.js +++ b/static/mobile/js/VideoPlayer.js @@ -71,8 +71,8 @@ window.VideoPlayer = function(options) { height: 64px; } .mx-controls .toggle .loading svg { - width: 32px; - height: 32px; + width: 64px; + height: 64px; } .mx-controls .controls .volume svg, .mx-controls .controls .fullscreen-btn svg { diff --git a/static/mobile/js/edits.js b/static/mobile/js/edits.js index f23766ef..25fa0027 100644 --- a/static/mobile/js/edits.js +++ b/static/mobile/js/edits.js @@ -175,7 +175,6 @@ async function loadEdit(id, args) { position += duration }) Object.keys(clip.layers).forEach(layer => { - data.layers[layer] = data.layers[layer] || [] clip.layers[layer].forEach(annotation => { if (args.users && !args.users.includes(annotation.user)) { return @@ -193,6 +192,7 @@ async function loadEdit(id, args) { clip['position'] + clip['duration'], a.out - clip['in'] + clip['position'] ); + data.layers[layer] = data.layers[layer] || [] data.layers[layer].push(a) }) }) diff --git a/static/mobile/js/icons.js b/static/mobile/js/icons.js index 295a12fe..50116108 100644 --- a/static/mobile/js/icons.js +++ b/static/mobile/js/icons.js @@ -123,6 +123,15 @@ icon.pause = ` ` icon.loading = ` + + + + + + +` + +icon.loading_w = ` @@ -180,3 +189,12 @@ icon.down = ` ` + +icon.publishComment = ` + + + + + + +` diff --git a/static/mobile/js/item.js b/static/mobile/js/item.js index 61463aa5..3a57bcba 100644 --- a/static/mobile/js/item.js +++ b/static/mobile/js/item.js @@ -10,6 +10,7 @@ async function loadData(id, args) { "id", "title", "director", + "source", "summary", "streams", "duration", @@ -39,7 +40,11 @@ async function loadData(id, args) { if (id.split('/').length == 1 || id.split('/')[1] == 'info') { data.view = 'info' data.title = data.item.title - data.byline = data.item.director ? data.item.director.join(', ') : '' + if (data.item.source) { + data.byline = data.item.source + } else { + data.byline = data.item.director ? data.item.director.join(', ') : '' + } data.link = `${pandora.proto}://${data.site}/${data.item.id}/info` let poster = pandora.site.user.ui.icons == 'posters' ? 'poster' : 'icon' data.icon = `${pandora.proto}://${data.site}/${data.item.id}/${poster}.jpg` @@ -109,6 +114,13 @@ async function loadData(id, args) { ${layerData.title} `) data.layers[layer].forEach(annotation => { + if (pandora.url) { + annotation.value = annotation.value.replace( + /src="\//g, `src="${pandora.url.origin}/` + ).replace( + /href="\//g, `href="${pandora.url.origin}/` + ) + } html.push(`
${annotation.value} @@ -120,7 +132,11 @@ async function loadData(id, args) { data.value = value.join('\n') data.title = data.item.title - data.byline = data.item.director ? data.item.director.join(', ') : '' + if (data.item.source) { + data.byline = data.item.source + } else { + data.byline = data.item.director ? data.item.director.join(', ') : '' + } data.link = `${pandora.proto}://${data.site}/${data.item.id}/${data["in"]},${data.out}` data.poster = `${pandora.proto}://${data.site}/${data.item.id}/480p${data["in"]}.jpg` data.aspectratio = data.item.videoRatio diff --git a/static/mobile/js/main.js b/static/mobile/js/main.js index a9b368bd..6cd27ef0 100644 --- a/static/mobile/js/main.js +++ b/static/mobile/js/main.js @@ -86,8 +86,8 @@ function render() { var loadingScreen = `
${icon.loading}
diff --git a/static/mobile/js/render.js b/static/mobile/js/render.js index d9724da7..307c5d2f 100644 --- a/static/mobile/js/render.js +++ b/static/mobile/js/render.js @@ -3,7 +3,8 @@ function renderItemInfo(data) { div = document.createElement('div') div.className = "content" div.innerHTML = ` -
${data.title}
+

${item.title}

+

${data.title}

${data.byline}
@@ -12,10 +13,14 @@ function renderItemInfo(data) { Open on ${data.site}
` + if (!item.title) { + div.querySelector('item-title').remove() + } document.querySelector(".content").replaceWith(div) } function renderItem(data) { + window.item = window.item || {} if (data.error) { return renderError(data) } @@ -25,17 +30,23 @@ function renderItem(data) { div = document.createElement('div') div.className = "content" div.innerHTML = ` -
${data.title}
+

${item.title}

+

${data.title}

${data.byline}
-
${data.value}
-
+
+ ${data.value} +
+
Open on ${data.site}
` + if (!item.title) { + div.querySelector('.item-title').remove() + } var comments = div.querySelector('.comments') if (window.renderComments) { @@ -98,6 +109,28 @@ function renderItem(data) { }) }) + if (item.next || item.previous) { + var nav = document.createElement('nav') + nav.classList.add('items') + if (item.previous) { + var a = document.createElement('a') + a.href = item.previous + a.innerText = '<< previous' + nav.appendChild(a) + } + if (item.previous && item.next) { + var e = document.createElement('span') + e.innerText = ' | ' + nav.appendChild(e) + } + if (item.next) { + var a = document.createElement('a') + a.href = item.next + a.innerText = 'next >>' + nav.appendChild(a) + } + div.appendChild(nav) + } document.querySelector(".content").replaceWith(div) } diff --git a/static/mobile/js/utils.js b/static/mobile/js/utils.js index d77024f1..cbaec6a6 100644 --- a/static/mobile/js/utils.js +++ b/static/mobile/js/utils.js @@ -155,6 +155,9 @@ const getVideoURL = function(id, resolution, part, track, streamId) { .replace('{resolution}', resolution) .replace('{uid}', uid) .replace('{uid42}', uid % 42); + if (!prefix) { + prefix = pandoraURL + } return prefix + '/' + getVideoURLName(id, resolution, part, track, streamId); };