-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
208 lines (188 loc) · 8.52 KB
/
index.html
File metadata and controls
208 lines (188 loc) · 8.52 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Daily Bible verses with beautiful, shareable images. Free to use on social media, websites, and newsletters.">
<meta name="keywords" content="bible verse, daily verse, scripture, christian, bible images, shareable verses">
<meta name="author" content="ChurchApps">
<meta name="robots" content="index, follow">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Verse of the Day">
<meta property="og:url" content="https://churchapps.github.io/VotdContent/">
<meta property="og:title" content="Verse of the Day - Daily Bible Verses">
<meta property="og:description" content="Daily Bible verses with beautiful, shareable images. Free to use on social media, websites, and newsletters.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Verse of the Day - Daily Bible Verses">
<meta name="twitter:description" content="Daily Bible verses with beautiful, shareable images. Free to use on social media, websites, and newsletters.">
<title>Verse of the Day - Daily Bible Verses</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
<link rel="stylesheet" href="css/all.css" />
<link rel="canonical" href="https://churchapps.github.io/VotdContent/" />
</head>
<body>
<nav id="navbar" class="fixed-top">
<div class="container">
<div class="row align-items-center h-100">
<div class="col-6 col-lg-2-5">
<a class="navbar-brand d-flex align-items-center" href="/">
<img src="images/logo.png" alt="Verse of the Day" class="logo">
</a>
</div>
<div class="col-6 col-lg-9-5 text-end">
<a href="preview.html" class="btn btn-outline-primary">View All Days</a>
</div>
</div>
</div>
</nav>
<div id="navSpacer"></div>
<main>
<div class="homeSection">
<div class="container">
<div class="row">
<div class="col">
<div class="row">
<div class="col-xl-8 offset-xl-2">
<div id="currentDay"></div>
</div>
<div class="col-12">
<hr class="my-4">
<div class="row" id="variants"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="homeSection alt">
<div class="container">
<div class="row">
<div class="col-xl-8 offset-xl-2 text-center">
<h2 class="mb-4">About the Verse of the Day</h2>
<p class="lead mb-4">This is a free service by <a href="https://churchapps.org">ChurchApps</a>. All verse images on this site are original creations and available for use on social media, websites, newsletters, and elsewhere absolutely free of charge, and without citation required.</p>
<div class="d-flex justify-content-center gap-3">
<a href="preview.html" class="btn btn-outline-light">View All Days</a>
<a href="https://github.com/ChurchApps/votdcontent" class="btn btn-outline-light">
<i class="bi bi-github"></i> Source Data
</a>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
const getDateFromDay = (year, day) => {
var date = new Date(year, 0);
return new Date(date.setDate(day));
}
const getDayOfYear = () => {
let params = new URLSearchParams(window.location.search);
if (params.has("day")) return parseInt(params.get("day"));
else {
var now = new Date();
var start = new Date(now.getFullYear(), 0, 0);
var diff = now - start;
var oneDay = 1000 * 60 * 60 * 24;
var day = Math.floor(diff / oneDay);
return day;
}
}
const fetchData = () => {
const day = getDayOfYear();
fetch("https://churchapps.github.io/VotdContent/v1/verses.json")
.then(resp => resp.json())
.then(data => populate(data, day));
}
const populateCurrentDay = (verse) => {
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
const day = getDateFromDay(new Date().getFullYear(), verse.day);
var displayDay = day.toLocaleDateString("en-US", options);
const shareUrl = `https://churchapps.github.io/VotdContent/index.html?day=${verse.day}`;
const shareTitle = `${verse.reference} - Verse of the Day`;
let result = `
<div class="d-flex justify-content-between align-items-start mb-4">
<h1>Verse of the Day - <span>${displayDay}</span></h1>
<div class="share-buttons">
<a href="https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}"
target="_blank" class="btn btn-outline-primary me-2">
<i class="bi bi-facebook"></i> Share
</a>
</div>
</div>
<h3>${verse.reference} - <span>${verse.text}</span></h3>
<div class="verse-image mt-4">
<img src="v1/${verse.day}/720p/16x9.jpg" alt="${verse.reference}" class="img-fluid" />
</div>
`;
document.getElementById('currentDay').innerHTML = result;
}
const populateVariants = (verse) => {
let sizes = ["16x9", "1x1", "9x16"]
let result = [];
sizes.forEach(s => {
result.push(`
<div class="col-md-4">
<div class="variant-card">
<h4 class="variant-title">${s}</h4>
<div class="variant-links mb-3">
<a href="v1/${verse.day}/720p/${s}.jpg" class="btn btn-sm btn-outline-primary me-2">
<i class="bi bi-download"></i> High Res
</a>
<a href="v1/${verse.day}/${s}.jpg" class="btn btn-sm btn-outline-secondary">
<i class="bi bi-download"></i> Max Res
</a>
</div>
<img src="v1/${verse.day}/thumbs/${s}.jpg" alt="${s}" class="img-fluid" />
</div>
</div>
`);
});
document.getElementById('variants').innerHTML = result.join("");
}
const populateMeta = (verse) => {
const shareUrl = `https://churchapps.github.io/VotdContent/index.html?day=${verse.day}`;
const shareTitle = `${verse.reference} - Verse of the Day`;
const shareDescription = `${verse.reference} - ${verse.text}`;
// Update meta tags
document.title = shareTitle;
document.querySelector('meta[name="description"]').setAttribute('content', shareDescription);
document.querySelector('meta[property="og:title"]').setAttribute('content', shareTitle);
document.querySelector('meta[property="og:description"]').setAttribute('content', shareDescription);
document.querySelector('meta[property="og:url"]').setAttribute('content', shareUrl);
document.querySelector('meta[property="og:image"]').setAttribute('content', `v1/${verse.day}/720p/16x9.jpg`);
document.querySelector('meta[name="twitter:title"]').setAttribute('content', shareTitle);
document.querySelector('meta[name="twitter:description"]').setAttribute('content', shareDescription);
document.querySelector('meta[name="twitter:image"]').setAttribute('content', `v1/${verse.day}/720p/16x9.jpg`);
// Add structured data
const structuredData = {
"@context": "https://schema.org",
"@type": "Article",
"headline": shareTitle,
"description": shareDescription,
"image": `v1/${verse.day}/720p/16x9.jpg`,
"datePublished": new Date().toISOString(),
"publisher": {
"@type": "Organization",
"name": "ChurchApps",
"url": "https://livecs.org"
}
};
const script = document.createElement('script');
script.type = 'application/ld+json';
script.text = JSON.stringify(structuredData);
document.head.appendChild(script);
}
const populate = (data, day) => {
const verse = data.verses[day - 1]
populateCurrentDay(verse, day);
populateVariants(verse)
populateMeta(verse)
}
fetchData();
</script>
</body>
</html>