diff --git a/bionic-reading.php b/bionic-reading.php index 19b6b29..71d7a28 100644 --- a/bionic-reading.php +++ b/bionic-reading.php @@ -14,6 +14,27 @@ if ($_SERVER['HTTP_HOST'] == 'localhost') { $main_url = "https://tilde.team/~grizzly"; } +if(!isset($_COOKIE['settings'])) { + $init = json_encode(array("fontSize" => 18, "lineHeight" => 2, "wordSpacing" => 2)); + setcookie('settings', $init, time() + (86400 * 30 * 30), "/"); + $fontSize = 18; + $lineHeight = 2; + $wordSpacing = 2; +} else { + $settings = json_decode($_COOKIE['settings']); + $fontSize = $settings->fontSize; + $lineHeight = $settings->lineHeight; + $wordSpacing = $settings->wordSpacing; +} + +if(isset($_POST['settings'])) { + $update = json_encode(array("fontSize" => (int)$_POST['fontsize'], "lineHeight" => (int)$_POST['lineheight'], "wordSpacing" => (int)$_POST['wordspacing'])); + setcookie('settings', $update, time() + (86400 * 30 * 30), "/"); + $fontSize = (int)$_POST['fontsize']; + $lineHeight = (int)$_POST['lineheight']; + $wordSpacing = (int)$_POST['wordspacing']; +} + if(!isset($_COOKIE['theme'])) { setcookie('theme', 'dark', time() + (86400 * 30 * 30), "/"); $theme = 'dark'; @@ -81,7 +102,7 @@ $output = array_map(function($word) {
~team - security does not exist, no system is save + security does not exist, no system is safe <- back to tilde.team
@@ -95,27 +116,70 @@ $output = array_map(function($word) {
-

- + ".join($output, " ")."

"; + } else { ?>

did you know that your brain reads faster than your eye? - my implementation according to german patent for quick text reading + my implementation according to german patent for fast text reading

- -

+ + + +
+ settings +
+ + + + + + + + + + + + + + + + + + +
+
+ +
more info: https://patents.google.com/patent/DE102017112916A1/en
diff --git a/components/css/dark.css b/components/css/dark.css index cb338d5..ed5d634 100644 --- a/components/css/dark.css +++ b/components/css/dark.css @@ -33,7 +33,8 @@ footer { } input, -textarea { +textarea +/* [type="submit"] */ { background-color: #2c2c2c; border: 1px solid #444; border-radius: 0.2em; diff --git a/components/css/style.css b/components/css/style.css index 43f3dac..640116d 100644 --- a/components/css/style.css +++ b/components/css/style.css @@ -208,6 +208,17 @@ footer p { display: block; } +.settings { + margin-top: 20px; +} +.settings span { + display: inline-block; + margin: 10px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 1rem; +} + button:hover, .button:hover, [type="submit"]:hover, diff --git a/index.php b/index.php index 75e0ee7..da313e0 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ if (@$_GET['theme'] == 'light') {
~team - security does not exist, no system is save + security does not exist, no system is safe <- back to tilde.team