play single contribution

main
km0 2 years ago
parent f4f2e01a30
commit ae9f20acce

@ -50,6 +50,31 @@ function createSection(contribution) {
section.querySelector(".author").innerHTML = contribution.author; section.querySelector(".author").innerHTML = contribution.author;
section.querySelector(".description").innerHTML = contribution.description; section.querySelector(".description").innerHTML = contribution.description;
section.querySelector(".content").innerHTML = contribution.content_html; section.querySelector(".content").innerHTML = contribution.content_html;
if ((contribution.audio && contribution.audio.length == 1) || contribution.original) {
let audio = new Audio(
`https://hub.xpub.nl/soupboat/SI18/03/${contribution.folder}/${
contribution.original || contribution.audio[0]
}`
);
audio.addEventListener("canplaythrough", (event) => {
/* the audio is now playable; play it if permissions allow */
section.querySelector(".filename").innerHTML = `${~~(audio.duration / 60)}:${~~(
audio.duration % 60
)}`;
let player = section.querySelector(".player");
player.innerHTML = "Play";
player.addEventListener("click", () => {
if (audio.paused) {
audio.play();
player.innerHTML = "Pause";
} else {
audio.pause();
player.innerHTML = "Play";
}
});
});
} else section.querySelector(".audio").remove();
return section; return section;
} }

@ -317,7 +317,7 @@
</div> </div>
<!-- --------------------- --> <!-- --------------------- -->
</div> </div>
<div class="libretto" contenteditable="true"> <div class="libretto">
<header class="cover"> <header class="cover">
<div class="release"> <div class="release">
10.05.2022 <br /> 10.05.2022 <br />
@ -367,6 +367,10 @@
</div> </div>
<h2 class="title">Overture Atlas</h2> <h2 class="title">Overture Atlas</h2>
<div class="description">description</div> <div class="description">description</div>
<div class="audio">
<button class="player">Loading</button>
<span class="filename"></span>
</div>
<div class="content"></div> <div class="content"></div>
</section> </section>
</div> </div>

@ -1,274 +1,279 @@
@font-face { @font-face {
font-family: Fengardo; font-family: Fengardo;
src: url("fonts/fengardoneue_regular-webfont.woff"); src: url("fonts/fengardoneue_regular-webfont.woff");
} }
@font-face { @font-face {
font-family: Fengardo; font-family: Fengardo;
src: url("fonts/fengardoneue_black-webfont.woff"); src: url("fonts/fengardoneue_black-webfont.woff");
font-weight: bold; font-weight: bold;
} }
:root { :root {
--text:#111; --text: #111;
--wireframe:#111; --wireframe: #111;
--background:#FF6347; --background: #ff6347;
} }
*{ * {
box-sizing: border-box; box-sizing: border-box;
} }
body,
html {
margin: 0;
padding: 0;
background-color: var(--background);
color: var(--text);
font-family: Fengardo;
font-size: 21px;
line-height: 1.6;
overflow: hidden;
body, html{
margin: 0;
padding: 0;
background-color: var(--background);
color: var(--text);
font-family: Fengardo;
font-size: 21px;
line-height: 1.6;
} }
.container { .container {
display: flex; display: flex;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
} }
.container > * { .container > * {
flex-basis: 50%; flex-basis: 50%;
} }
.atlas { .atlas {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
border-right: solid 1px var(--wireframe); border-right: solid 1px var(--wireframe);
} }
.info { .info {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
height: 100px; height: 100px;
width: 100%; width: 100%;
border-top: solid 1px var(--wireframe); border-top: solid 1px var(--wireframe);
} }
.libretto{ .libretto {
overflow-y: scroll; overflow-y: scroll;
scroll-behavior: smooth; scroll-behavior: smooth;
} }
.libretto > * { .libretto > * {
border-bottom: solid 1px var(--wireframe); border-bottom: solid 1px var(--wireframe);
} }
.atlas svg { .contribution:last-of-type {
padding: 32px; border-bottom: none;
width: 100%; }
overflow: visible;
.atlas svg {
padding: 32px;
width: 100%;
overflow: visible;
} }
.atlas svg #live-path { .atlas svg #live-path {
color: currentColor; color: currentColor;
stroke-dasharray: 18159; stroke-dasharray: 18159;
stroke-dashoffset: 18159; stroke-dashoffset: 18159;
animation: dash 300s linear forwards; animation: dash 300s linear forwards;
} }
@keyframes dash { @keyframes dash {
to{ to {
stroke-dashoffset: 0; stroke-dashoffset: 0;
} }
} }
path[data-link] {
path[data-link]{ pointer-events: all;
pointer-events: all; pointer-events: bounding-box;
pointer-events:bounding-box;
} }
.moment {
.moment{ text-transform: uppercase;
text-transform: uppercase;
} }
.cover{ .cover {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
text-align: center; text-align: center;
min-height: 100vh; min-height: 100vh;
padding: 32px; padding: 32px;
} }
.cover .release { .cover .release {
font-style: italic; font-style: italic;
} }
.cover .title { .cover .title {
font-size: 64px; font-size: 64px;
margin: 64px 0; margin: 64px 0;
} }
.cover .description { .cover .description {
max-width: 50ch; max-width: 50ch;
} }
dl { dl {
margin-top: 128px; margin-top: 128px;
} }
dt { dt {
margin-top: 24px; margin-top: 24px;
font-style: italic; font-style: italic;
} }
dd { dd {
max-width: 60ch; max-width: 60ch;
margin: 0; margin: 0;
} }
.index { .index {
display: none; display: none;
} }
#reference { #reference {
display: none; display: none;
} }
.contribution { .contribution {
padding: 16px; padding: 16px;
padding-bottom: 64px; padding-bottom: 64px;
border-bottom: 1px solid currentColor; border-bottom: 1px solid currentColor;
} }
.contribution .title { .contribution .title {
margin: 0; margin: 0;
margin-top: 0; margin-top: 0;
font-size: 42px; font-size: 42px;
} }
.contribution .meta { .contribution .meta {
/* font-size: 0.8em; */ /* font-size: 0.8em; */
/* font-weight: bold; */ /* font-weight: bold; */
text-transform: uppercase; text-transform: uppercase;
}
.contribution .audio {
margin-bottom: 32px;
} }
ul, ol { .contribution .player {
margin: 16px 0; border: 1px solid currentColor;
outline: none;
background: none;
padding: 4px 8px;
cursor: pointer;
}
ul,
ol {
margin: 16px 0;
} }
.contribution .description { .contribution .description {
font-style: italic; font-style: italic;
padding-bottom: 32px; padding-bottom: 8px;
} }
.contribution .content h3, .contribution .content h3,
.contribution .content h2 { .contribution .content h2 {
font-size: 28px; font-size: 28px;
margin: 16px 0; margin: 16px 0;
} }
.contribution .content ol { .contribution .content ol {
padding-inline-start: 16px; padding-inline-start: 16px;
} }
.contribution img { .contribution img {
width: 100%; width: 100%;
height: auto; height: auto;
object-fit: contain; object-fit: contain;
} }
.content { .content {
white-space: pre-line; white-space: pre-line;
} }
.content p, .content p,
.content h2 { .content h2 {
margin: 0; margin: 0;
} }
.content img { .content img {
width: 100%; width: 100%;
object-fit: contain; object-fit: contain;
height: auto; height: auto;
} }
#btn-print { #btn-print {
display: inline-block; display: inline-block;
color: var(--text); color: var(--text);
margin-top: 32px; margin-top: 32px;
background: none; background: none;
border: 1px solid var(--text); border: 1px solid var(--text);
padding: 4px 8px; padding: 4px 8px;
font-size: 1rem; font-size: 1rem;
} }
#btn-print:hover{ #btn-print:hover {
cursor: pointer; cursor: pointer;
} }
a{ a {
position: relative; position: relative;
color: currentColor; color: currentColor;
pointer-events: all; pointer-events: all;
} }
a:hover{ a:hover {
color: white; color: white;
} }
@namespace svg url(http://www.w3.org/2000/svg); @namespace svg url(http://www.w3.org/2000/svg);
/* Necessary to select only SVG <a> elements, and not also HTML's. /* Necessary to select only SVG <a> elements, and not also HTML's.
See warning below */ See warning below */
svg|a:link, svg|a:link,
svg|a:visited { svg|a:visited {
cursor: pointer; cursor: pointer;
color: currentColor; color: currentColor;
pointer-events: all; pointer-events: all;
} }
svg|g { svg|g {
pointer-events: all; pointer-events: all;
} }
@media (max-width: 991.98px){ @media (max-width: 991.98px) {
.container { .container {
height: auto; height: auto;
width: 100%; width: 100%;
display: block; display: block;
} }
.libretto { .libretto {
overflow: hidden; overflow: hidden;
} }
.atlas svg { .atlas svg {
padding: 16px; padding: 16px;
} }
.info { .info {
display: none; display: none;
} }
} }

Loading…
Cancel
Save