Skip to content

Commit 362a33e

Browse files
authored
Merge pull request #404 from openscript-ch/401-clickable-bubbles-odd-behavior
401-clickable-bubbles-odd-behavior
2 parents 53a486d + 4befcb1 commit 362a33e

File tree

6 files changed

+57
-43
lines changed

6 files changed

+57
-43
lines changed

.changeset/giant-oranges-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@quassel/website": patch
3+
---
4+
5+
Fix bubble and play button odd behaviours, and insert metadata into <html> tags.

apps/website/src/components/Accordion.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ items.forEach((item) => {
196196
</div>
197197

198198
<script>
199-
const items = document.querySelectorAll(".accordion li");
199+
const items = document.querySelectorAll(".accordion .features > ul > li");
200200
const ACTIVE_CLASS = "active";
201201

202202
function setScreenshot(item: Element) {

apps/website/src/components/Head.astro

Lines changed: 0 additions & 34 deletions
This file was deleted.

apps/website/src/layouts/Document.astro

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ import "@fontsource-variable/montserrat";
88
<head>
99
<meta charset="utf-8" />
1010
<meta name="viewport" content="width=device-width" />
11+
<link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="any" />
12+
<link rel="icon" href="/favicon-16x16.png" type="image/png" sizes="16x16" />
13+
<link rel="icon" href="/favicon-32x32.png" type="image/png" sizes="32x32" />
14+
<link rel="icon" href="/favicon-48x48.png" type="image/png" sizes="48x48" />
15+
<link rel="icon" href="/favicon-64x64.png" type="image/png" sizes="64x64" />
16+
<link rel="icon" href="/favicon-96x96.png" type="image/png" sizes="96x96" />
17+
<link rel="icon" href="/android-chrome-192x192.png" type="image/png" sizes="192x192" />
18+
<title>Quassel</title>
19+
<meta property="og:type" content="website" />
20+
<meta
21+
name="description"
22+
content="Quassel is a web-based application designed to aid researchers in collecting and analyzing data on children's language exposure."
23+
/>
24+
<meta property="og:locale" content="en_US" />
25+
<meta property="og:type" content="website" />
26+
<meta property="og:url" content="https://www.quassel.ch/" />
27+
<meta property="og:title" content="Quassel" />
28+
<meta
29+
property="og:description"
30+
content="Quassel (previously Language Exposure Questionnaire) is a web-based application designed to aid researchers in collecting and analyzing data on children's language exposure. "
31+
/>
32+
<meta property="og:image" content="/opengraph.png" />
33+
<meta property="og:image:alt" content="Quassel Application Display" />
34+
<meta
35+
name="keywords"
36+
content="Quassel, children, calendar-like interface, language, langauge exposure, web application, periods of life, data entry personnel, UZH, openscript, open source"
37+
/>
1138
</head>
1239
<body>
1340
<slot />

apps/website/src/pages/index.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
import Head from "../components/Head.astro";
32
import Site from "../layouts/Site.astro";
43
import Header from "../sections/Header.astro";
54
import Footer from "../sections/Footer.astro";
@@ -9,7 +8,6 @@ import Administration from "../sections/Administration.astro";
98
import About from "../sections/About.astro";
109
---
1110

12-
<Head title="Quassel" />
1311
<Site>
1412
<Header />
1513
<main>

apps/website/src/sections/Spotlight.astro

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ import PlayButton from "../assets/videos/play-button.svg";
4444
margin-inline: var(--spacing-xl);
4545
}
4646

47+
.video-not-interactive {
48+
pointer-events: none;
49+
}
50+
4751
video::-webkit-media-controls-panel {
4852
background-image: none;
4953
filter: brightness(0.2);
@@ -57,6 +61,11 @@ import PlayButton from "../assets/videos/play-button.svg";
5761
top: 50%;
5862
left: 50%;
5963
transform: translate(-50%, -50%);
64+
visibility: visible;
65+
}
66+
67+
.playButton-invisible {
68+
visibility: hidden;
6069
}
6170

6271
.playButton :hover {
@@ -96,14 +105,23 @@ import PlayButton from "../assets/videos/play-button.svg";
96105
<script>
97106
document.addEventListener("DOMContentLoaded", () => {
98107
const video = document.querySelector("video") as HTMLVideoElement;
99-
const myButton = document.getElementsByClassName("playButton")[0] as HTMLButtonElement;
108+
const playButton = document.getElementsByClassName("playButton")[0] as HTMLButtonElement;
100109
let isPlaying = false;
101110

102-
myButton.addEventListener("click", () => {
103-
if (!isPlaying) {
104-
video.play();
105-
myButton.style.visibility = "hidden";
106-
isPlaying = true;
111+
video.classList.add("video-not-interactive");
112+
113+
playButton.addEventListener("click", () => {
114+
video.play();
115+
isPlaying = true;
116+
playButton.classList.add("playButton-invisible");
117+
video.classList.remove("video-not-interactive");
118+
});
119+
120+
video.addEventListener("pause", () => {
121+
if (isPlaying) {
122+
isPlaying = false;
123+
playButton.classList.remove("playButton-invisible");
124+
video.classList.add("video-not-interactive");
107125
}
108126
});
109127
});

0 commit comments

Comments
 (0)