summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-01-20 13:53:17 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-01-20 13:53:17 -0500
commit087e45d9bae8ffaef840e907c38e4a8402fab69b (patch)
tree17316610cbb63f491edbc6f1ae5a642fdc2d35e9
parent8ccc464b0de39e7fc73b3c3e50f80f6c2452c8fe (diff)
downloadhtml5ks-087e45d9bae8ffaef840e907c38e4a8402fab69b.tar.xz
html5ks-087e45d9bae8ffaef840e907c38e4a8402fab69b.zip
Stuff.
-rw-r--r--Makefile23
-rw-r--r--README12
-rw-r--r--nginx.inc.conf12
-rw-r--r--www/warn.html15
-rw-r--r--www/warned.html10
5 files changed, 52 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 5725e9d..3e3506b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
-null :=
-SPACE := $(null) $(null)
+null :=
+SPACE := $(null) $(null)
FFMPEG ?= ffmpeg
-FFMPEG += -v warning $(FFMPEGFLAGS)
+FFMPEG += -v warning -y
OPUSENC ?= opusenc
ZOPFLIPNG ?= zopflipng
-OPTIPNG ?= optipng
-JPEGOPTIM ?= jpegoptim
+TRUEPNG ?= wine TruePNG
+DEFLOPT ?= wine DeflOpt
+DEFLUFF ?= defluff
+PNGQUANT ?= pngquant
CWEBP ?= cwebp
CWEBP += -short -alpha_cleanup
WEBPMUX ?= webpmux
@@ -35,7 +37,7 @@ video: $(CVIDEO)
$(FFMPEG) -i $< -c:v libvpx -crf 15 -b:v 1M -c:a copy $@
%.ogv: %.mkv
- $(FFMPEG) -i $< -c:v libtheora -qscale:v 6 -c:a copy $@
+ $(FFMPEG) -i $< -c:v libtheora -qscale:v 10 -c:a copy $@
# === AUDIO ===
@@ -69,11 +71,15 @@ CTC_ANIM := $(DUMP)/ui/ctc_anim.png $(DUMP)/ui/ctc_anim.webp
images: $(WEBP) $(CTC_ANIM) www/favicon.ico
%.webp: %.png
+ $(PNGQUANT) --force --speed 1 --ext .png $<
$(ZOPFLIPNG) -m -y $< $<
+ $(DEFLOPT) $<
+ $(DEFLUFF) < $< > TMP$<
+ mv TMP$< $<
$(CWEBP) -q 99 -m 6 $< -o $@
%.webp: %.jpg
- $(JPEGOPTIM) --strip-all $<
+ $(JPEGMINI) $<
$(CWEBP) -q 90 -m 6 $< -o $@
www/favicon.ico: $(DUMP)/ui/icon.png
@@ -81,7 +87,8 @@ www/favicon.ico: $(DUMP)/ui/icon.png
$(DUMP)/ui/bt-cf-unchecked.webp $(DUMP)/ui/bt-cf-checked.webp: %.webp: %.png
$(CONVERT) -trim $< $<
- $(OPTIPNG) -o7 $<
+ $(PNGQUANT) --force --speed 1 --ext .png $<
+ $(TRUEPNG) $< /o max
$(ZOPFLIPNG) -m -y $< $<
$(CWEBP) -q 99 -m 6 $< -o $@
diff --git a/README b/README
index 7d54461..f1d79fb 100644
--- a/README
+++ b/README
@@ -6,7 +6,16 @@ This is a WIP HTML5 implementation of the game Katawa Shoujo. [0]
- Bash
- ffmpeg with fdk-aac, libtheora, libvpx, libx264
- opusenc from opus-tools
+- TruePNG
+- DeflOpt
+- defluff
+- pngquant
+- recommended: jpegmini
+- jpegrescan
- cwebp and webpmux from libwebp
+- ImageMagick
+- apngasm
+- uglifyjs
=== Recommended ===
- nginx
@@ -19,7 +28,8 @@ This is a WIP HTML5 implementation of the game Katawa Shoujo. [0]
0. Get Katawa Shoujo.
1. Copy *.rpyc from Katawa Shoujo/game into unrpyc/ directory.
2. Extract files from Katawa Shoujo/game/data.rpa with an rpa extractor, e.g. unrpa. Put files in www/dump.
-3. Run setup.sh. [2]
+3. Install prerequisites, download DeflOpt and defluff and place exes in this directory.
+4. Run setup.sh. [2]
4. Run nginx.sh to start nginx, then navigate to localhost:8080 in your browser.
-- or --
diff --git a/nginx.inc.conf b/nginx.inc.conf
index b795a1c..acab0ef 100644
--- a/nginx.inc.conf
+++ b/nginx.inc.conf
@@ -14,19 +14,19 @@ location ~ ^/(css/font|js/lib)/ {
location / {
set $warned NO;
if ($http_cookie ~ "warned") {
- set $warned YES;
+ set $warned YES;
}
if ($args ~ "warned") {
- set $warned YES;
+ set $warned YES;
}
if ($warned = NO) {
- return 307 /warn.html;
+ return 307 /warn.html;
}
}
-location /setcookie.html {
+location /warned.ngx {
add_header Set-Cookie "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly";
- return 301 /;
+ return 301 "/warned.html?$args&language=$http_accept_language";
}
location /warn.html {
@@ -40,3 +40,5 @@ location /robots.txt {
expires 5s;
add_header Cache-Control public;
add_header X-UA-Compatible "IE=edge";
+
+# vim:ft=nginx:
diff --git a/www/warn.html b/www/warn.html
index 5d41083..5c7c898 100644
--- a/www/warn.html
+++ b/www/warn.html
@@ -6,13 +6,16 @@
<body>
<p>Okay, before we start, we need to go through a few things first.</p>
<p>If you don't know what Katawa Shoujo is, see <a href="http://www.katawa-shoujo.com/">http://www.katawa-shoujo.com/</a>, then come back.</p>
- <p>The full version of Katawa Shoujo contains adult material.<br>
- Promise that you are over <b>18 years</b> old and that you will not make the material available to persons below that age.
- </p>
+ <p>There's like, a little bit of... inappropriate content, so we have to make you promise you're over 18.</p>
+ <p>If you don't want to see any, er, explicit content, hit the appropriate checkbox at the bottom of the page.</p>
<p>Also, please don't bother the original developers on the forums or IRC about bugs in this. This is entirely unofficial and not controlled by them whatsoever.<br>
- This includes typos, graphical misplacement, downtime, and any other glitches of any sort. Bug me instead: <a href="https://bugzilla.happinessforme.com/">https://bugzilla.happinessforme.com/</a>, or use the official distribution until HTML5KS is feature-complete.
+ This includes missing features, typos, downtime, and any other glitches of any sort. Bug me instead: <a href="https://bugzilla.happinessforme.com/">https://bugzilla.happinessforme.com/</a>, or use the official distribution until HTML5KS is feature-complete.
</p>
- <p>FYI, this site sets a single anonymous cookie (warned=1) so that you won't have to keep seeing this page. It also sets localStorage to keep your settings and saves (when that's implemented). This stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.</p>
- <p><a href="setcookie.html">OK? Great.</a></p>
+ <p>FYI, this site sets a single anonymous cookie (warned=1) so that you won't have to keep seeing this page. It also sets localStorage to keep your settings and saves. The latter always stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.</p>
+ <form method="GET" action="warned.ngx">
+ <p><input type="checkbox" name="hdisable"><label for="hdisable">Disable adult content</label>
+ <br>
+ <input type="submit" value="Let's go!">
+ </form>
</body>
</html>
diff --git a/www/warned.html b/www/warned.html
new file mode 100644
index 0000000..5d44d7c
--- /dev/null
+++ b/www/warned.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html><head>
+<script>
+localStorage.persistent = {
+ hdisable: location.search.indexOf("hdisable=on") > -1,
+ language: location.search.search("language=.*[=,]en") > -1 ? "en" : "fr"
+};
+location.replace("./");
+</script>
+</head><body>If you're seeing this, something's gone wrong. Go back and report a bug.</body></html>