Compare commits
10 Commits
0ac3c438e6
...
d0aa70d8c3
Author | SHA1 | Date | |
---|---|---|---|
d0aa70d8c3 | |||
8b5507196a | |||
556e14486e | |||
24524a20fe | |||
f7fcf6788c | |||
206fd6ef2f | |||
0c745d758b | |||
fc370b9e61 | |||
a7d2a69f0d | |||
67b8dc9efd |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "tools/url-editor"]
|
||||
path = tools/url-editor
|
||||
url = https://git.reim.ar/Reimar/url-editor
|
6
.well-known/host-meta
Normal file
6
.well-known/host-meta
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
||||
<Link rel="urn:xmpp:alt-connections:xbosh" href="https://reim.ar:5281/http-bind" />
|
||||
<Link rel="urn:xmpp:alt-connections:websocket" href="wss://reim.ar:5281/xmpp-websocket" />
|
||||
</XRD>
|
||||
|
6
.well-known/host-meta.json
Normal file
6
.well-known/host-meta.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"links": [
|
||||
{ "rel": "urn:xmpp:alt-connections:xbosh", "href": "https://reim.ar:5281/http-bind" },
|
||||
{ "rel": "urn:xmpp:alt-connections:websocket", "href": "wss://reim.ar:5281/xmpp-websocket" }
|
||||
]
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<? require "../inc/head.inc" ?>
|
||||
<?php require "../inc/head.inc" ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<? require "../inc/nav.inc" ?>
|
||||
<?php require "../inc/nav.inc" ?>
|
||||
|
||||
<div id="main-and-sidebar" class="inline-block">
|
||||
|
||||
@ -34,7 +34,8 @@
|
||||
<source type="image/svg+xml" srcset="/assets/icons/matrix.svg">
|
||||
<img class="icon" src="/assets/icons/matrix.png" alt="">
|
||||
</picture>
|
||||
<span>Matrix: @reimar:reim.ar</span>
|
||||
<span>Matrix: </span>
|
||||
<a href="https://matrix.to/#/@reimar:reim.ar" target="_blank">@reimar:reim.ar</a>
|
||||
<br><br>
|
||||
|
||||
<h1>Donate</h1>
|
||||
@ -72,11 +73,11 @@
|
||||
</div>
|
||||
</div><!--
|
||||
|
||||
--><? require "../inc/sidebar.inc" ?>
|
||||
--><?php require "../inc/sidebar.inc" ?>
|
||||
|
||||
</div>
|
||||
|
||||
<? require "../inc/background.inc" ?>
|
||||
<?php require "../inc/background.inc" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
BIN
assets/bin/mcstatus
Normal file
BIN
assets/bin/mcstatus
Normal file
Binary file not shown.
@ -4,5 +4,5 @@
|
||||
<rect x="0" y="0" width="50" height="100" fill="white" />
|
||||
</mask>
|
||||
<circle cx="50" cy="50" r="50" fill="black" mask="url(#mask)" />
|
||||
<circle cx="50" cy="50" r="45" fill-opacity="0" stroke="black" stroke-width="10" />
|
||||
<circle cx="50" cy="50" r="45" fill-opacity="0" stroke="currentColor" stroke-width="10" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 373 B |
Binary file not shown.
@ -1,3 +1,5 @@
|
||||
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0
|
||||
|
||||
if (!document.getElementsByClassName) {
|
||||
document.getElementsByClassName = function(className) {
|
||||
|
||||
@ -81,4 +83,6 @@ if(window.opera && Object.defineProperty) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// @license-end
|
||||
|
@ -1,3 +1,5 @@
|
||||
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
|
||||
// Get list of inline code elements
|
||||
@ -89,3 +91,5 @@ function inputDeselect(input) {
|
||||
if (input.blur) input.blur();
|
||||
else input.setSelectionRange(0, 0);
|
||||
}
|
||||
|
||||
// @license-end
|
||||
|
@ -1,3 +1,5 @@
|
||||
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0
|
||||
|
||||
window.addEventListener("load", makeLinksDynamic, false);
|
||||
|
||||
function makeLinksDynamic() {
|
||||
@ -61,4 +63,6 @@ function loadUrl(href, callback) {
|
||||
xhr.open("GET", href);
|
||||
xhr.send();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// @license-end
|
||||
|
@ -1,3 +1,5 @@
|
||||
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0
|
||||
|
||||
// Enable transitions between themes without reloading page
|
||||
|
||||
var Themes = {
|
||||
@ -6,8 +8,6 @@ var Themes = {
|
||||
DARK: "dark"
|
||||
};
|
||||
|
||||
var jsTheme;
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
|
||||
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
@ -15,24 +15,24 @@ window.addEventListener("load", function() {
|
||||
// Add trees
|
||||
if (!document.querySelector(".tree")) {
|
||||
for (var x = 0; x < width; x += 240) {
|
||||
var left = x + Math.floor(Math.random() * 240 / 2);
|
||||
var bottom = Math.floor(Math.random() * 150);
|
||||
var img = document.createElement("img");
|
||||
img.className = "tree";
|
||||
img.height = 300;
|
||||
img.alt = "";
|
||||
img.style.position = "fixed";
|
||||
img.style.left = left + "px";
|
||||
img.style.bottom = bottom + "px";
|
||||
document.body.appendChild(img);
|
||||
var left = x + Math.floor(Math.random() * 240 / 2);
|
||||
var bottom = Math.floor(Math.random() * 150);
|
||||
|
||||
for (var i = 0; i < 2; i++) {
|
||||
var theme = ["light", "dark"][i];
|
||||
var img = document.createElement("img");
|
||||
img.src = "/assets/img/tree_" + theme + (window.SVGElement ? ".svg" : ".png");
|
||||
img.className = theme + " tree";
|
||||
img.height = 300;
|
||||
img.alt = "";
|
||||
img.style.position = "fixed";
|
||||
img.style.left = left + "px";
|
||||
img.style.bottom = bottom + "px";
|
||||
document.body.appendChild(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply current theme
|
||||
var themeCookie = document.cookie.match(/theme=([a-z]+)/i);
|
||||
if (themeCookie) applyTheme(themeCookie[1], true);
|
||||
else applyPreferredTheme(true);
|
||||
|
||||
// Add click listener to theme buttons
|
||||
var themeBtns = document.getElementsByClassName("theme-btn");
|
||||
for (var i = 0; i < themeBtns.length; i++) {
|
||||
@ -53,15 +53,16 @@ window.addEventListener("load", function() {
|
||||
// Apply theme changes
|
||||
if (theme === Themes.AUTO) {
|
||||
document.cookie = "theme=; expires=Tue, 19 Jan 2038 03:14:08 GMT";
|
||||
applyPreferredTheme(false);
|
||||
} else {
|
||||
document.cookie = "theme=" + theme + "; expires=Tue, 19 Jan 2038 03:14:08 GMT"
|
||||
applyTheme(theme, false);
|
||||
}
|
||||
|
||||
// Set new selected button
|
||||
deselectThemeButton(document.querySelector(".theme-btn.selected"));
|
||||
selectThemeButton(target);
|
||||
// Enable / disable the right stylesheets
|
||||
var themeStyles = document.getElementsByClassName("theme-style");
|
||||
for (var i = 0; i < themeStyles.length; i++) {
|
||||
themeStyles[i].disabled = true;
|
||||
if (themeStyles[i].getAttribute("data-theme") === theme) themeStyles[i].disabled = false;
|
||||
}
|
||||
|
||||
// Force redrawing of containers because of a bug in IE8
|
||||
var containers = document.getElementsByClassName("container");
|
||||
@ -70,57 +71,6 @@ window.addEventListener("load", function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Automatically computes the preferred theme and calls applyTheme() with it
|
||||
function applyPreferredTheme(firstTime) {
|
||||
var preferredTheme = ("matchMedia" in window && matchMedia("(prefers-color-scheme: dark)").matches) ? Themes.DARK : Themes.LIGHT;
|
||||
applyTheme(preferredTheme, firstTime);
|
||||
}
|
||||
}, false);
|
||||
|
||||
function applyTheme(theme, firstTime) {
|
||||
|
||||
if (jsTheme && jsTheme.href.match(theme)) return;
|
||||
|
||||
// Set trees
|
||||
var trees = document.getElementsByClassName("tree");
|
||||
for (var i = 0; i < trees.length; i++) {
|
||||
trees[i].src = "/assets/img/tree_" + theme + (window.SVGElement ? ".svg" : ".png");
|
||||
}
|
||||
|
||||
if (!firstTime) {
|
||||
|
||||
if (jsTheme) document.head.removeChild(jsTheme);
|
||||
jsTheme = document.createElement("link");
|
||||
jsTheme.rel = "stylesheet";
|
||||
jsTheme.href = "/assets/style/" + theme + "-mode.css";
|
||||
document.head.appendChild(jsTheme);
|
||||
|
||||
if (window.linkOnloadSupported) {
|
||||
document.body.className += " loading";
|
||||
jsTheme.onload = function () {
|
||||
document.body.className = document.body.className.replace(/\s*loading/g, "");
|
||||
var themeStyles = document.getElementsByClassName("theme-style");
|
||||
for (var i = 0; i < themeStyles.length; i++) {
|
||||
document.head.removeChild(themeStyles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Functions to select/deselect a theme button
|
||||
|
||||
function selectThemeButton(themeBtn) {
|
||||
if (themeBtn.textContent) themeBtn.textContent += " ✓";
|
||||
else themeBtn.innerText += " ✓";
|
||||
themeBtn.className += "selected";
|
||||
}
|
||||
|
||||
function deselectThemeButton(themeBtn) {
|
||||
if (themeBtn.textContent) themeBtn.textContent = themeBtn.textContent.replace(" ✓", "");
|
||||
else themeBtn.innerText = themeBtn.innerText.replace(" ✓", "");
|
||||
themeBtn.className = themeBtn.className.replace("selected", "");
|
||||
}
|
||||
|
||||
}, false);
|
||||
// @license-end
|
||||
|
@ -20,6 +20,15 @@ body {
|
||||
color: #212121;
|
||||
}
|
||||
|
||||
/* Theme buttons */
|
||||
#dark-theme .theme-check {
|
||||
display: inline;
|
||||
}
|
||||
#dark-theme .theme-btn {
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Background */
|
||||
#grass {
|
||||
background-color: #265728;
|
||||
@ -66,4 +75,5 @@ body {
|
||||
}
|
||||
.light {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,4 +3,27 @@
|
||||
Dark mode can be forced by importing the CSS file below in the HTML
|
||||
Light mode can be forced by not loading this file at all
|
||||
*/
|
||||
@import "/assets/style/light-mode.css";
|
||||
@import "/assets/style/dark-mode.css" (prefers-color-scheme: dark);
|
||||
|
||||
/* Theme buttons */
|
||||
/* Shouldn't be overriden by the detected theme */
|
||||
.theme-btn {
|
||||
padding-left: 3px !important;
|
||||
text-decoration: underline !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
.theme-btn:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.theme-check {
|
||||
display: none !important;
|
||||
}
|
||||
#auto-theme .theme-check {
|
||||
display: inline !important;
|
||||
}
|
||||
#auto-theme .theme-btn {
|
||||
text-decoration: none !important;
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,15 @@ body {
|
||||
color: #EEE;
|
||||
}
|
||||
|
||||
/* Theme buttons */
|
||||
#light-theme .theme-check {
|
||||
display: inline;
|
||||
}
|
||||
#light-theme .theme-btn {
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Background */
|
||||
#grass {
|
||||
background-color: #4CAF50;
|
||||
@ -66,4 +75,5 @@ body {
|
||||
}
|
||||
.dark {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,13 +92,20 @@ a:hover {
|
||||
text-align: left;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Theme buttons */
|
||||
.theme-btn {
|
||||
padding-left: 3px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.theme-btn.selected {
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
.theme-btn:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.theme-check {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Main section */
|
||||
#main-and-sidebar {
|
||||
@ -207,6 +214,14 @@ h1, h2 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.light, .dark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.icon-wrapper {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
}
|
||||
.icon {
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
display: inline-block;
|
||||
@ -249,4 +264,4 @@ object {
|
||||
}
|
||||
img {
|
||||
border: none; /* Fix ico images on internet explorer */
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<? require "../inc/head.inc" ?>
|
||||
<?php require "../inc/head.inc" ?>
|
||||
</head>
|
||||
<body>
|
||||
<? require "../inc/background.inc" ?>
|
||||
<?php require "../inc/background.inc" ?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
11
inc/head.inc
11
inc/head.inc
@ -7,14 +7,9 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<title>Reimar</title>
|
||||
<link rel="stylesheet" href="/assets/style/main.css" onload="linkOnloadSupported = true">
|
||||
<? if ($_COOKIE["theme"] == "dark") : ?>
|
||||
<link class="theme-style" rel="stylesheet" href="/assets/style/dark-mode.css">
|
||||
<? else : ?>
|
||||
<link class="theme-style" rel="stylesheet" href="/assets/style/light-mode.css">
|
||||
<? endif ?>
|
||||
<? if (!$_COOKIE["theme"]) : ?>
|
||||
<style>@import "/assets/style/dark-mode.css" (prefers-color-scheme: dark)</style>
|
||||
<? endif ?>
|
||||
<link class="theme-style" rel="<?= $_COOKIE["theme"] ? "alternate " : "" ?>stylesheet" href="assets/style/detect-dark-mode.css" data-theme="auto" title="Auto">
|
||||
<link class="theme-style" rel="<?= $_COOKIE["theme"] != "light" ? "alternate " : "" ?>stylesheet" href="/assets/style/light-mode.css" data-theme="light" title="Light">
|
||||
<link class="theme-style" rel="<?= $_COOKIE["theme"] != "dark" ? "alternate " : "" ?>stylesheet" href="/assets/style/dark-mode.css" data-theme="dark" title="Dark">
|
||||
<!--[if lt IE 6]><style>.container { box-shadow: none !important; }</style><![endif]-->
|
||||
<!--[if lte IE 9]>
|
||||
<script src="/assets/script/compatibility.js"></script>
|
||||
|
@ -3,29 +3,26 @@
|
||||
<aside>
|
||||
<div class="section container" style="font-size: 14px;">
|
||||
<h2>Theme</h2>
|
||||
<?php
|
||||
// List of themes and a condition to test if it's deselected (!)
|
||||
$themes = [
|
||||
"auto" => $_COOKIE["theme"],
|
||||
"light" => $_COOKIE["theme"] != "light",
|
||||
"dark" => $_COOKIE["theme"] != "dark"
|
||||
];
|
||||
?>
|
||||
<?php foreach ($themes as $name=>$condition): ?>
|
||||
<picture class="light">
|
||||
<source type="image/svg+xml" srcset="/assets/icons/light-mode/theme-<?= $name ?>.svg">
|
||||
<img class="icon" src="/assets/icons/light-mode/theme-<?= $name ?>.png" alt="">
|
||||
</picture>
|
||||
<picture class="dark">
|
||||
<source type="image/svg+xml" srcset="/assets/icons/dark-mode/theme-<?= $name ?>.svg">
|
||||
<img class="icon" src="/assets/icons/dark-mode/theme-<?= $name ?>.png" alt="">
|
||||
</picture>
|
||||
<a class="theme-btn <?= $condition ? "" : "selected" ?>" data-theme="<?= $name ?>" href="/api/set_theme/<?= $name ?>.php">
|
||||
<?= ucwords($name) . ($condition ? "" : " ✓") ?>
|
||||
</a>
|
||||
<?php foreach (["auto", "light", "dark"] as $theme): ?>
|
||||
<div class="icon-wrapper">
|
||||
<picture class="light">
|
||||
<source type="image/svg+xml" srcset="/assets/icons/light-mode/theme-<?= $theme ?>.svg">
|
||||
<img class="icon" src="/assets/icons/light-mode/theme-<?= $theme ?>.png" alt="">
|
||||
</picture>
|
||||
<picture class="dark">
|
||||
<source type="image/svg+xml" srcset="/assets/icons/dark-mode/theme-<?= $theme ?>.svg">
|
||||
<img class="icon" src="/assets/icons/dark-mode/theme-<?= $theme ?>.png" alt="">
|
||||
</picture>
|
||||
</div>
|
||||
<span id="<?= $theme ?>-theme">
|
||||
<a class="theme-btn" data-theme="<?= $theme ?>" href="/api/set_theme/<?= $name ?>.php">
|
||||
<?= ucwords($theme) ?>
|
||||
</a>
|
||||
<span class="theme-check">✓</span>
|
||||
</span>
|
||||
<br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
10
index.php
10
index.php
@ -4,11 +4,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<? require "inc/head.inc" ?>
|
||||
<?php require "inc/head.inc" ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<? require "inc/nav.inc" ?>
|
||||
<?php require "inc/nav.inc" ?>
|
||||
|
||||
<div id="main-and-sidebar" dir="rtl" class="inline-block">
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<br>
|
||||
<span>Have a timer or stopwatch in the corner of your screen, directly from within your browser</span>
|
||||
<br>
|
||||
<i><a href="https://popup-timer.reimarpb.com" target="_blank">Open in browser</a></i>
|
||||
<i><a href="https://popup-timer.reim.ar" target="_blank">Open in browser</a></i>
|
||||
|
||||
<hr>
|
||||
|
||||
@ -80,11 +80,11 @@
|
||||
</div>
|
||||
</div><!--
|
||||
|
||||
--><? require "inc/sidebar.inc" ?>
|
||||
--><?php require "inc/sidebar.inc" ?>
|
||||
|
||||
</div>
|
||||
|
||||
<? require "inc/background.inc" ?>
|
||||
<?php require "inc/background.inc" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
9
opener/iframe.html
Normal file
9
opener/iframe.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Opener</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="index.php" width="500" height="800"></iframe>
|
||||
</body>
|
||||
</html>
|
@ -18,19 +18,26 @@
|
||||
<script>
|
||||
window.onload = function() {
|
||||
|
||||
if (window.opener) {
|
||||
document.getElementById("opener").innerText = window.opener;
|
||||
document.getElementById("opener").className = "green";
|
||||
} else {
|
||||
document.getElementById("opener").innerText = "Null";
|
||||
}
|
||||
if (window.opener) {
|
||||
document.getElementById("opener").innerText = window.opener.location || window.opener;
|
||||
document.getElementById("opener").className = "green";
|
||||
} else {
|
||||
document.getElementById("opener").innerText = "Null";
|
||||
}
|
||||
|
||||
if (window.name) {
|
||||
document.getElementById("name").innerText = window.name;
|
||||
document.getElementById("name").className = "green";
|
||||
} else {
|
||||
document.getElementById("name").innerText = "Empty String";
|
||||
}
|
||||
if (window.name) {
|
||||
document.getElementById("name").innerText = window.name;
|
||||
document.getElementById("name").className = "green";
|
||||
} else {
|
||||
document.getElementById("name").innerText = "Empty String";
|
||||
}
|
||||
|
||||
if (document.referrer) {
|
||||
document.getElementById("referrer").innerText = document.referrer;
|
||||
document.getElementById("referrer").className = "green";
|
||||
} else {
|
||||
document.getElementById("referrer").innerText = "Empty string";
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -41,6 +48,14 @@
|
||||
<h2>JavaScript</h2>
|
||||
 window.opener: <span id="opener" class="grey">Enable JavaScript</span>
|
||||
<br><br>
|
||||
 document.referrer: <span id="referrer" class="grey">Enable JavaScript</span>
|
||||
<br><br>
|
||||
 window.name: <span id="name" class="grey">Enable JavaScript</span>
|
||||
<h2>Test yourself</h2>
|
||||
 <a href="#" onclick="window.open(location.href)">window.open()</a>
|
||||
<br><br>
|
||||
 <a href="/opener"><a></a>
|
||||
<br><br>
|
||||
 <a href="/opener/iframe.html"><iframe></a>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
1
tools/url-editor
Submodule
1
tools/url-editor
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 7327876db294ffe2febee1f9ef3ba76e92bfe895
|
Loading…
Reference in New Issue
Block a user