-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
277 lines (269 loc) · 9.23 KB
/
index.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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Ibarra+Real+Nova&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<style>
[v-cloak] { display: none; }
.chapter { padding: 4em 12% 6em 12%; }
.chapter p { font-size: 1.16rem; margin: 1.4em auto; }
.chapter h1 { font-size: 1.5rem; margin-bottom: 2em; }
.seraph p,
.seraph h1 { font-family: 'Ibarra Real Nova', serif; }
.indented p { text-indent: 4em; }
.ex-space p { margin: 2em auto; }
.darkened p { opacity: 0.82; }
.mini-txt { padding: 3em 1em; }
.mini-txt p { font-size: 1rem; }
hr {
border: none; height: 1px; margin: 2.5em 0;
background: linear-gradient(
to right,
transparent 12%,
#00000066 20%, 80%,
transparent 88%
);
}
.pink--text hr {
background: linear-gradient(
to right,
transparent 12%,
#F48FB177 20%, 80%,
transparent 88%
);
}
.ex-space hr { margin: 4em; }
</style>
<title>Revamp</title>
</head>
<body>
<div id="app" v-cloak>
<v-app :style="{background: $vuetify.theme.themes[theme].background}">
<v-app-bar app hide-on-scroll class="d-lg-none" dark color="accent">
<v-app-bar-nav-icon @click.stop="nav = !nav"></v-app-bar-nav-icon>
<v-toolbar-title>Revamp</v-toolbar-title>
</v-app-bar>
<v-navigation-drawer
app
v-model="nav"
class="pb-12 pb-sm-0"
:expand-on-hover="$vuetify.breakpoint.lg"
:src="`nav_${theme}.jpg`"
:floating="$vuetify.theme.dark"
mini-variant-width="64"
>
<v-list>
<v-list-item-group v-model="chapterIndex" mandatory>
<v-list-item>Cover</v-list-item>
<v-list-item v-for="chap of chapters" :key="chap.number">
<v-list-item-avatar color="accent">
<v-img v-if="chap.icon" src="icon.png"></v-img>
<span v-else class="white--text">{{ chap.number }}</span>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title>
{{ chap.number }}. {{ chap.title }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</v-list>
<template v-slot:append>
<v-list-item @click="showOptions = true">
<v-list-item-icon>
<v-icon color="accent">mdi-settings</v-icon>
</v-list-item-icon>
<v-list-item-title>
Options
</v-list-item-title>
</v-list-item>
</template>
</v-navigation-drawer>
<v-content>
<v-container fluid style="padding-bottom:10em">
<v-row align="center" justify="center">
<v-sheet elevation="6" width="1000" color="paper">
<div :class="themeText" class="chapter">
<div v-if="chapterIndex">
<h1 class="text-center">
{{ chapter.number }}. {{ chapter.title }}
</h1>
<div v-for="line of chapter.content" v-html="line">
</div>
</div>
<div v-else>
<h1 class="text-center">Revamp</h1>
<p><i>[Cover coming someday]</i></p>
<p>Vampires? In <em>my</em> JIDA? It's more likely than you think.</p>
</div>
</div>
</v-sheet>
</v-row>
</v-container>
<v-dialog v-model="showOptions" width="600px">
<v-card>
<v-toolbar dark color="accent">
<v-toolbar-title>Options</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn icon dark @click="showOptions = !showOptions">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-toolbar-items>
</v-toolbar>
<v-list>
<v-list-item>
<v-switch v-model="$vuetify.theme.dark" label="Dark Theme"></v-switch>
</v-list-item>
<v-list-item>
<v-switch v-model="options.seraph" label="Serif Font"></v-switch>
</v-list-item>
<v-list-item>
<v-switch v-model="options.indent" label="Paragraph Indent"></v-switch>
</v-list-item>
<v-list-item>
<v-switch v-model="options.spaced" label="Increased Margin"></v-switch>
</v-list-item>
</v-list>
</v-card>
</v-dialog>
</v-content>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.js"></script>
<script>
var revamp = new Vue({
el: '#app',
vuetify: new Vuetify({
theme: {
dark: false,
themes: {
light: {
background: '#fff4e5',
paper: '#ffffff',
accent: "#633b32"
},
dark: {
background: '#3f2727',
paper: '#231111',
accent: "#ec407a"
}
}
}
}),
data: {
chapterIndex: 0,
chapters: [],
showOptions: false,
nav: null,
options: {
dark: false,
seraph: true,
indent: false,
spaced: false
}
},
computed: {
chapter() {
window.scroll(0, 0)
return this.chapters[this.chapterIndex - 1];
},
theme() {
return this.$vuetify.theme.dark ? 'dark' : 'light';
},
themeText() {
return {
'mini-txt': this.$vuetify.breakpoint.xsOnly,
'pink--text text--lighten-3 darkened': this.$vuetify.theme.dark,
'seraph': this.options.seraph,
'indented': this.options.indent,
'ex-space': this.options.spaced
}
}
},
watch: {
showOptions() {
this.options.dark = this.$vuetify.theme.dark;
localStorage.setItem('options', JSON.stringify(this.options))
},
chapterIndex() {
localStorage.setItem('chapter', this.chapterIndex)
document.title = this.chapterIndex
? `Revamp - ${this.chapter.number}. ${this.chapter.title}`
: 'Revamp';
}
},
methods: {
async preprocessChapters() {
// chapter list
let chapters = [
{ title: "Revamp", number: -2, privacy: 2, file: "outline.txt"},
{ title: "Notes", number: -1, privacy: 2, file: "notes.txt" },
{
title: "Heuristic",
number: 1, privacy: 1, file: "1_Heuristic.txt"
},
{
title: "Food, Housing, and Arukanu Stationery",
number: 2, privacy: 2, file: "2_Food.txt"
},
{
title: "The Glass Break Alarm, Reprise",
number: 4, privacy: 2, file: "4_Glass_Break.txt"
}
];
// filter content based on privacy level
_privacy = 0
if (window.location.hash == '#mika') _privacy = 1;
if (window.location.hash == '#milk') _privacy = 2;
chapters = chapters.filter(c => c.privacy <= _privacy);
// read text files
for (let chapter of chapters) {
let response = await fetch(`./${chapter.file}`)
let text = await response.text()
this.addChapterContent(chapter.title, chapter.number, text);
}
this.selectLastChapter();
},
addChapterContent(title, number, text) {
this.chapters.push({
title: title,
number: number,
content: text.split('\n\n').map(line => {
if (line == '-') {
return '<hr>';
} else if (line[0] == '#') {
return '';
} else {
return (`<p>${line}</p>`).replace(/\[.*?\]/g, (match) =>
`<span style="color: #00bbbb">${match.slice(1, -1)}</span>`
)
}
}),
});
},
selectLastChapter() {
let _chapter = localStorage.getItem('chapter');
this.$nextTick(() => {
if (_chapter) this.chapterIndex = parseInt(_chapter, 10);
if (this.chapterIndex > this.chapters.length) {
this.chapterIndex = this.chapters.length;
}
});
},
},
mounted() {
let _options = localStorage.getItem('options');
if (_options) this.options = JSON.parse(_options);
this.$vuetify.theme.dark = this.options.dark;
this.preprocessChapters();
}
})
</script>
</body>
</html>