Skip to content

Commit 795796a

Browse files
committed
Move demo videos to demo folders, add preview.png support for when there's no video
1 parent e092981 commit 795796a

20 files changed

+24
-14
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

demos/homepage/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en" class="demos">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Personal Homepage &bull; Mavo Demos</title>
5+
<title>Editable Homepage &bull; Mavo Demos</title>
66
<link rel="stylesheet" href="https://get.mavo.io/mavo.css" />
77
<link rel="stylesheet" href="../../css/style.css" />
88
<link rel="icon" href="/favicon.ico">
@@ -34,7 +34,7 @@ <h1 class="logo">
3434
<h2>Demos</h2>
3535

3636
<section>
37-
<h1>Personal Homepage</h1>
37+
<h1>Editable Homepage</h1>
3838

3939

4040
<main mv-app="homepage" mv-storage="https://github.com/mavoweb/mavo.io/demos/homepage" mv-plugins="tinymce">

demos/homepage/index.tpl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@@include('_head-demo.html', {
2-
"name": "Personal Homepage"
2+
"name": "Editable Homepage"
33
})
44

55
<main mv-app="homepage" mv-storage="https://github.com/mavoweb/mavo.io/demos/homepage" mv-plugins="tinymce">

demos/homepage/style.css

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/homepage/style.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/homepage/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ main {
44
max-width: 90vw;
55
margin: auto;
66
text-align: center;
7+
box-shadow: none;
78

89
h1 {
910
font-weight: normal;

demos/homepage/video.mp4

4.2 MB
Binary file not shown.

demos/index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2>Demos</h2>
4040
<div>
4141
<article property="demo" mv-multiple mv-if="!tagFilter or count(tag = tagFilter) > 0">
4242
<a href="/demos/[id]">
43-
<video src="/videos/[id].mp4" preload="metadata" loop tabindex="0"></video>
43+
<video src="/demos/[id]/video.mp4" preload="metadata" loop tabindex="0"></video>
4444
<h1 property="name"></h1>
4545
</a>
4646
<a href="?tag=[tag]" property="tag" mv-attribute="null" mv-multiple></a>
@@ -72,6 +72,12 @@ <h1>Mavo in the wild</h1>
7272
}
7373
}
7474
}, true);
75+
76+
document.body.addEventListener("error", function(evt) {
77+
if (!evt.target.hasAttribute("poster")) {
78+
evt.target.setAttribute("poster", evt.target.src.replace("video.mp4", "preview.png"));
79+
}
80+
}, true)
7581
</script>
7682

7783
<footer>

demos/index.tpl.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2>Demos</h2>
1212
<div>
1313
<article property="demo" mv-multiple mv-if="!tagFilter or count(tag = tagFilter) > 0">
1414
<a href="/demos/[id]">
15-
<video src="/videos/[id].mp4" preload="metadata" loop tabindex="0"></video>
15+
<video src="/demos/[id]/video.mp4" preload="metadata" loop tabindex="0"></video>
1616
<h1 property="name"></h1>
1717
</a>
1818
<a href="?tag=[tag]" property="tag" mv-attribute="null" mv-multiple></a>
@@ -44,6 +44,12 @@ <h1>Mavo in the wild</h1>
4444
}
4545
}
4646
}, true);
47+
48+
document.body.addEventListener("error", function(evt) {
49+
if (!evt.target.hasAttribute("poster")) {
50+
evt.target.setAttribute("poster", evt.target.src.replace("video.mp4", "preview.png"));
51+
}
52+
}, true)
4753
</script>
4854

4955
@@include('_footer.html')
File renamed without changes.
File renamed without changes.
File renamed without changes.

demos/style.css

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/style.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/style.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ article[property="demo"] {
2828
display: block;
2929
max-width: 100%;
3030
height: 12.5rem;
31-
background: hsl(220, 10%, 90%) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 160 100" opacity=".5">
32-
<text x="50" y="60" font-size="350%">📽</text>
33-
<text x="20" y="80" font-size="75%" font-weight="bold" font-family="sans-serif">Preview coming soon</text>
34-
</svg>') center no-repeat;
31+
background: hsl(220, 10%, 90%);
3532
}
3633
}
3734

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)