-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
preview.html
76 lines (64 loc) · 2.55 KB
/
preview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="css/all.css" />
<meta name="viewport" content="width=device-width" />
<title>Verse of the Day Preview</title>
</head>
<body>
<div id="navbar" class="fixed-top">
<div class="container">
<div class="row">
<div class="col-6 col-lg-2-5">
<a class="navbar-brand" href="/"><img src="images/logo-temp.png" alt="logo"
style="max-height: 45px;margin-top:5px;"></a>
</div>
</div>
</div>
</div>
<div id="navSpacer"></div>
<div class="homeSection" style="padding-top:20px">
<div class="container">
<div class="row">
<div class="col">
<h1>Verse of the Day Preview</h1>
</div>
<div class="col" style="text-align: right;padding-top:10px">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary" onclick="updateContents('16x9')">16:9</button>
<button type="button" class="btn btn-primary" onclick="updateContents('1x1')">1:1</button>
<button type="button" class="btn btn-primary" onclick="updateContents('9x16')">9:16</button>
</div>
</div>
</div>
<div class="row" id="verseContent">
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script>
const getDay = (verse, shape) => {
const colSize = (shape === "9x16") ? "col-2" : "col-3"
let result = '<div class="' + colSize + ' verse">'
+ '<a href="./index.html?day=' + verse.day + '">'
+ '<img src="v1/' + verse.day + '/thumbs/' + shape + '.jpg" class="img-fluid" />'
+ '</a>'
+ '<div>Day ' + verse.day + '</div>'
+ '<span>' + verse.reference + '</span>'
+ '</div>';
return result;
}
const updateContents = (shape) => {
fetch("https://churchapps.github.io/VotdContent/v1/verses.json").then(resp => resp.json()).then(d => {
const snippets = [];
d.verses.forEach(v => { snippets.push(getDay(v, shape)) });
document.getElementById("verseContent").innerHTML = snippets.join("");
});
}
updateContents("16x9");
</script>
</body>
</html>