-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
157 lines (150 loc) · 4.18 KB
/
index.php
File metadata and controls
157 lines (150 loc) · 4.18 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
<?php
const PREFERRED_LANG = 'de';
const STARFLEET_LOGO = 'starfleet.svg';
const FAVICON = STARFLEET_LOGO;
const APPLE_TOUCH_ICON = 'apple-touch-icon.png';
const STYLESHEET = 'style.css?date=2022-10-12T13:13Z';
const SCRIPT = 'script.js';
$files = scandir('series');
$json = file_get_contents('series/series.jsonld');
$franchise = json_decode($json, TRUE);
$json = file_get_contents('presentations/presentations.jsonld');
$presentations = json_decode($json, TRUE);
?>
<!DOCTYPE html>
<html
id="index"
lang="<?= htmlSpecialChars($franchise['inLanguage']) ?>"
typeof="<?= htmlSpecialChars($franchise['@type']) ?>"
vocab="<?= htmlSpecialChars($franchise['@context']['@vocab'] ?? $franchise['@context']) ?>"
>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title><?= $franchise['name'] ?></title>
<link rel="icon" href="<?= htmlSpecialChars(FAVICON) ?>"/>
<link rel="mask-icon" href="<?= htmlSpecialChars(FAVICON) ?>"/>
<link rel="apple-touch-icon" href="<?= htmlSpecialChars(APPLE_TOUCH_ICON) ?>"/>
<link rel="stylesheet" href="<?= htmlSpecialChars(STYLESHEET) ?>"/>
<style>
main > ul > li {
display: flex;
margin: 4em 0;
}
main > ul > li > a {
min-width: 6em;
}
main > ul > li > :is(ul, ol) {
display: flex;
flex-wrap: wrap;
gap: 1em 2em;
padding-inline: 0;
max-width: 70em;
}
#presentation-list img {
width: 12em;
height: auto;
}
</style>
</head>
<body>
<header>
<div aria-hidden="true">
<?php readfile(STARFLEET_LOGO); ?>
</div>
</header>
<main>
<h1 property="name"><?= htmlSpecialChars($franchise['name']) ?></h1>
<ul>
<li>
<a href="series">Series</a>
<ol id="series-list">
<?php foreach ($franchise['hasPart'] as $series): ?>
<li property="hasPart" typeof="<?= htmlSpecialChars($series['@type']) ?>">
<a
<?php if (in_array(mb_strtolower($series['identifier']) . '.jsonld', $files)): ?>
href="series/<?= htmlSpecialChars(mb_strtolower($series['identifier'])) ?>"
<?php endif; ?>
>
<?php if ($series['image']): ?>
<img
property="image"
src="<?= htmlSpecialChars($series['image']) ?>"
alt="<?= htmlSpecialChars($series['name']) ?>"
/>
<?php else: ?>
<?= htmlSpecialChars($series['name']) ?>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ol>
</li>
<li><a href="movies">Movies</a></li>
<li><a href="books">Books</a></li>
<li><a href="timelines">Timelines</a></li>
<li>
<a>Music</a>
<ul>
<li>
<a href="music/tng-collection">TNG Collection</a>
</li>
<li>
<a href="music/ds9-main-title">DS9 main title</a>
</li>
<li>
<a href="music/vic-fontaine">Vic Fontaine</a>
</li>
<li>
<a href="music/ent-themes">Enterprise Themes</a>
</li>
<li>
<a href="music/dsc-ost">Discovery OST</a>
</li>
<li>
<a href="music/subspace-rhapsody">Subspace Rhapsody</a>
</li>
</ul>
</li>
<li>
<a>Artwork</a>
<ul>
<li>
<a href="artwork/all-intros">all intros</a>
</li>
<li>
<a href="artwork/discovery-opening-titles">Discovery seasons opening titles</a>
</li>
<li>
<a href="artwork/dsc-universes-opening-titles">Discovery universes opening titles</a>
</li>
<li>
<a href="artwork/snw-real-flat-opening-titles">Strange New Worlds real/flat opening titles</a>
</li>
<li>
<a href="artwork/ld-films">Lower Decks and film posters</a>
</li>
</ul>
</li>
<li>
<a>Presentations</a>
<ol id="presentation-list">
<?php foreach ($presentations as $presentation): ?>
<li>
<a href="<?= htmlSpecialChars($presentation['url']) ?>">
<img
src="<?= htmlSpecialChars($presentation['image']) ?>"
alt="<?= htmlSpecialChars($presentation['name']) ?>"
/>
</a>
</li>
<?php endforeach; ?>
</ol>
</li>
</ul>
</main>
<script>
<?php readfile(SCRIPT); ?>
</script>
</body>
</html>