1
0
Fork 0

Initial commit of website contents

This commit is contained in:
will 2023-01-10 01:08:45 -07:00
parent b46d5cc25d
commit 9f7392ccf1
6 changed files with 447 additions and 0 deletions

15
.gitignore vendored Normal file
View file

@ -0,0 +1,15 @@
*.ttf
*.png
*.jpg
*.jxl
*.webp
*.avif
*.gif
*.mp4
*.mkv
*.webm
*.mp3
*.wav
*.flac
*.ogg
*.ico

75
index.php Normal file
View file

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link href="style.css" rel="stylesheet" type="text/css" media="all"/>
<title>deep twisty gaming</title>
<?php
include("lib.php");
$theday = (int)floor((time() / 3600) / 24);
srand($theday);
$bgs = glob("*/bg/*.png");
shuffle($bgs);
$bg = $bgs[array_rand($bgs)];
echo "<style type='text/css'>body{background-image:url('$bg');}</style>";
?>
<style>
#about, #servers {
display: none;
}
input#abouttoggle:checked + #about {
display: initial;
}
input#abouttoggle:checked + label[for=abouttoggle] {
font-weight: bold;
}
input#serverstoggle:checked + #servers {
display: initial;
}
input#serverstoggle:checked + label[for=serverstoggle] {
font-weight: bold;
}
</style>
</head>
<body>
<main>
<h1><span class="blue">deep</span> <span class="green">twi</span><span class="yellow">sty</span> gaming</h1>
<nav>
<label for="serverstoggle">Servers</label>
<label for="abouttoggle">About</label>
</nav>
<input type="radio" name="toggles" id="abouttoggle">
<div id="about">
<p>Hey there! I'm Will, and this is the companion website to my game servers. By my estimation, odds are you came here from one of them. Here you'll find information about each, such as IPs, rules, relevant downloads, and the like. I try to keep these things running as much as possible, but given they run on a laptop in my house, I make no guarantees as to uptime or connection quality.</p>
<p>Generally, you should be able to connect to a server by just pointing your client to this domain, as the game's default port will typically be used. If this isn't the case, the IP and port you need instead will be listed here.</p>
<p>Server-specific rules are listed under the servers themselves. In general (unless specified otherwise):
<ol>
<li>Be nice</li>
<li>No hate speech</li>
<li>Avoid discussion of sensitive topics</li>
<li>Respect other peoples' things<ul><li>Don't steal, grief or infringe on someone's space without permission</li></ul></li>
<li title="By &quot;cosmetic or QOL&quot; I mean things like minimap mods, the item physics mod, OptiFine, etc. Texture packs are obviously fine. Generally, if it doesn't affect the server itself or other players, it's not my business.">Don't cheat<ul><li>Client-side cosmetic or QOL mods are generally allowed, but things like hacks and x-ray are off the table.</li></ul></li>
</ol>
</p>
<p>If you need to contact me for any reason, I'm available at <a href="mailto:willem@deeptwisty.com">willem@deeptwisty.com</a> or willem#3223 on Discord.</p>
</div>
<input type="radio" name="toggles" id="serverstoggle" checked>
<div id="servers">
<a href="lasagna/" class="server">
<h2><?php
$lasagnastats = json_decode(file_get_contents("lasagna/status.txt"));
if($lasagnastats->online) {
echo "<span title='The server is online with " . $lasagnastats->player_count . "/" . $lasagnastats->player_max . " players as of " . roundtime(time() - filemtime("lasagna/status.txt")) . " ago.'>🟢</span>";
} else {
echo "<span title='The server is offline as of " . roundtime(time() - filemtime("lasagna/status.txt")) . " ago.'>🔴</span>";
}
?> Lasagna <span class="game">Minecraft<?php if($lasagnastats->online) { echo " " . $lasagnastats->version; } ?></span></h2>
<p>A private Minecraft survival server for me and some friends, affectionately termed "Lasagna" by some of them for reasons.</p>
</a>
</div>
</main>
<script src="link.js"></script>
<?php //include('chromealert.php'); ?>
</body>
</html>

196
lasagna/index.php Normal file
View file

@ -0,0 +1,196 @@
<?php
include("../lib.php");
$stats = json_decode(file_get_contents("status.txt"));
if($_GET["update"] === "") {
if(time() - filemtime("status.txt") > 10) {
shell_exec("mcstatus 172.16.0.2:25565 json > /var/www/dtmc/lasagna/status.txt");
}
header("Location: ./");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link href="../style.css" rel="stylesheet" type="text/css" media="all"/>
<title>deep twisty gaming</title>
<?php
$theday = (int)floor((time() / 3600) / 24);
srand($theday);
$bgs = glob("bg/*.png");
$bg = $bgs[array_rand($bgs)];
echo "<style type='text/css'>body{background-image:url('$bg');}</style>";
?>
<style>
#about, #gamerules, #credits {
display: none;
}
input#abouttoggle:checked + #about {
display: initial;
}
input#abouttoggle:checked + label[for=abouttoggle] {
font-weight: bold;
}
input#gamerulestoggle:checked + #gamerules {
display: initial;
}
input#gamerulestoggle:checked + label[for=gamerulestoggle] {
font-weight: bold;
}
input#creditstoggle:checked + #credits {
display: initial;
}
input#creditstoggle:checked + label[for=creditstoggle] {
font-weight: bold;
}
</style>
</head>
<body>
<main>
<a id="home" href="../">home</a>
<h1>Lasagna</h1>
<h3 class="info"><span>Game:</span> <span>Minecraft<?php if($stats->online) { echo " " . $stats->version; } ?></span><span>IP:</span> <span class="default">gaming.deeptwisty.com</span><span>Port:</span> <span class="default">25565</span></h3>
<h3 class="info"><span>Online:</span> <?php if($stats->online) {
echo "<span style='color: #00ee00;'>Yes</span><span>Players:</span><span> " . $stats->player_count . "/" . $stats->player_max . "</span>";
} else {
echo "<span style='color: red;'>No</span>";
}?><span>Last checked:</span> <span title="Click here to ping the Minecraft server to check if it's online. As a preventative anti-spam measure, there is a ten-second cooldown on doing this."><?php
$ago = time() - filemtime("status.txt");
$hago = roundtime($ago) . " ago";
if($ago > 10) {
echo "<a href='?update' style='text-decoration: none;'>$hago</a> <a href='?update'><svg xmlns='http://www.w3.org/2000/svg' viewBox='-1.5 -2.5 24 24' width='1em' fill='currentColor'><path d='M17.83 4.194l.42-1.377a1 1 0 1 1 1.913.585l-1.17 3.825a1 1 0 0 1-1.248.664l-3.825-1.17a1 1 0 1 1 .585-1.912l1.672.511A7.381 7.381 0 0 0 3.185 6.584l-.26.633a1 1 0 1 1-1.85-.758l.26-.633A9.381 9.381 0 0 1 17.83 4.194zM2.308 14.807l-.327 1.311a1 1 0 1 1-1.94-.484l.967-3.88a1 1 0 0 1 1.265-.716l3.828.954a1 1 0 0 1-.484 1.941l-1.786-.445a7.384 7.384 0 0 0 13.216-1.792 1 1 0 1 1 1.906.608 9.381 9.381 0 0 1-5.38 5.831 9.386 9.386 0 0 1-11.265-3.328z'></path></svg></a>";
} else {
echo $hago;
}
?></span></h3>
<nav>
<label for="abouttoggle">About</label>
<label for="gamerulestoggle">Gamerules/Datapacks</label>
<label for="creditstoggle">Credits</label>
</nav>
<input type="radio" name="toggles" id="abouttoggle" checked>
<div id="about">
<h2>About</h2>
<p>A private Minecraft survival server for me and some friends, affectionately termed "Lasagna" by some of them for reasons. Vanilla, but stuffed to brimming with datapacks and custom resources. We do little a lore, as a treat.</p>
</div>
<input type="radio" name="toggles" id="gamerulestoggle">
<div id="gamerules">
<h2>Gamerules</h2>
<ul>
<li><b>doFireTick</b>: false</li>
<li><b>keepInventory</b>: true</li>
</ul>
<h2>Datapacks</h2>
<h3>Crafting:</h3>
<ul>
<li>Dispensers can be crafted by combining a dropper with a bow or adding a dropper to the bow crafting recipe</li>
<li>Rotten flesh smelts into leather</li>
<li>Coal and charcoal can be crafted into black dye</li>
<li>Sandstone can be dyed red</li>
<li>Dyed blocks like terracotta and glass can be re-dyed</li>
<li>"Straight line" recipes like shulker boxes and bread are shapeless for easy 2x2 crafting</li>
<li>Blackstone is a universal drop-in replacement for cobblestone</li>
<li>The bark recipe makes 4 bark blocks instead of 3</li>
<li>Name tags and horse armor are craftable</li>
<li>Wool and nether wart blocks can be de-crafted</li>
<li>Sticky pistons can be crafted using honey instead of slime</li>
<li>Invisible item frames can be crafted with 8 sticks and a glass pane</li>
<li>Concrete can be mass hardened by throwing a stack of it into a cauldron full of water</li>
<li>Drop an elytra and a chesplate on an anvil to merge them, drop it onto a grindstone to reverse it. Enchantments are preserved.</li>
</ul>
<h3>Quality of life:</h3>
<ul>
<li title="This is here instead of simply disabling the mobGriefing gamerule because the gamerule also stops piglins from picking up gold from the ground.">Creepers, ghasts and endermen cannot grief.</li>
<li>Accelerated leaf decay</li>
<li>Nether portals can be any shape and can include crying obsidian</li>
<li>Mobs can be silenced by naming them "Silence me", "silence me" or "silence_me"</li>
<li>Shulker shell drop rates increased significantly</li>
<li>Teleportation commands:
<ul>
<li>/trigger back - Sends you to your previous location</li>
<li>/trigger spawn - Sends you to world spawn</li>
<li>/trigger tpa set &lt;PID&gt; - Sends a teleport request to player &lt;PID&gt;. The PID of a player can be viewed next to their name in the tab menu.</li>
<li>/trigger home OR /trigger home set &lt;ID&gt; - Sends you to a home point you've set.</li>
<li>/trigger sethome OR /trigger sethome set &lt;ID&gt; - Sets a home point. Current limit on homes is 10.</li>
</ul>
</li>
<li>Silk touch works on spawners</li>
<li>Drop a nether star on a lodestone to make a Chunk Loader. Try to use this one sparingly!</li>
</ul>
<h3>Fun:</h3>
<ul>
<li>Players and some mobs can drop heads when killed by players</li>
<li>/trigger sit lets you sit</li>
<li>There's a music disc in the end now! I had to delete Mellohi to do this.</li>
<li>Creepers explode into confetti!</li>
</ul>
<h3>Other:</h3>
<ul>
<li>Names of AFK players are greyed out</li>
<li>Pre-1.16 fishing loot table</li>
<li>Elevators can be created by dropping an ender pearl onto a wool block. Jump or sneak on the elevator to warp directly up or down respectively to the next elevator of the same color.</li>
</ul>
</div>
<input type="radio" name="toggles" id="creditstoggle">
<div id="credits">
<h2>Credits</h2>
<h3>Optifine CIT resources:</h3>
<ul>
<li><a href="https://celianascended.tumblr.com">CelianAscended</a>:
<ul>
<li>Celian's and SadFlowerBoy's Elytra</li>
<li>sord</li>
<li>Danny Devito</li>
<li>"sand"</li>
<li>moths</li>
<li>crab</li>
<li>snails</li>
<li>worm on a string</li>
<li>marketable plushies</li>
<li>"The", "Pumpkin Man :)", and "The Animal" framed pictures</li>
</ul>
</li>
<li><a href="https://www.planetminecraft.com/texture-pack/colored-axolotl-buckets-with-babies/">Colored axolotl buckets</a></li>
<li><a href="https://vanillatweaks.net/">Vanilla Tweaks</a>:
<ul>
<li>Golden helmet crown</li>
<li>Vex, dragon, and phantom custom elytra</li>
</ul>
</li>
<li>Me:
<ul>
<li>"Night's Edge" and "A very sharp dildo" custom swords</li>
<li>diamond i swear</li>
</ul>
</li>
</ul>
<h3>Vanilla resources:</h3>
<ul>
<li><a href="https://vanillatweaks.net/">Vanilla Tweaks</a>:
<ul>
<li>Banner shield fix</li>
<li>Horizontal world border</li>
<li>Visually distinguishable pumpkin/melon stems</li>
<li>Hunger preview in food names</li>
<li>Noteblock indicators</li>
<li>Taller saplings</li>
</ul>
</li>
<li><a href="https://deeptwisty.com/">Me</a>:
<ul>
<li>Bridges in place of 11</li>
<li>Cumulonimbus in place of 13</li>
<li>Extradimensional in place of Mellohi</li>
</ul>
</li>
</ul>
</div>
</main>
<script src="../link.js"></script>
<?php //include('chromealert.php'); ?>
</body>
</html>

28
lib.php Normal file
View file

@ -0,0 +1,28 @@
<?php
function roundtime($sec) {
if($sec > 3600) {
$hours = floor($sec/3600);
if($hours == 1) {
return $hours . " hour";
}
else {
return $hours . " hours";
}
} else if($sec > 60) {
$mins = floor($sec/60);
if($mins == 1) {
return $mins . " minute";
}
else {
return $mins . " minutes";
}
} else if($sec == 1) {
return $sec . " second";
}
else {
return $sec . " seconds";
}
}
?>

6
link.js Normal file
View file

@ -0,0 +1,6 @@
let hash = window.location.hash;
if(hash) {
document.querySelectorAll("[name=toggles]").forEach((tog) => {tog.removeAttribute("checked")});
document.querySelector(`${hash}toggle`).setAttribute("checked", "");
}

127
style.css Normal file
View file

@ -0,0 +1,127 @@
/*@font-face {
font-family: minecraft;
src: url("./Minecraftia-Regular.ttf");
}*/
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
font-family: monospace;
background-color: #222222;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
color: white;
font-size: 1.25em;
}
main {
margin: auto;
width: 100vw;
max-width: 90ch;
min-height: 100%;
background-color: #0009;
box-shadow: 0 0 2rem #0009;
padding: 0 4rem;
padding-bottom: 1rem;
box-sizing: border-box;
}
h1 {
text-align: center;
font-size: 3.5em;
margin-top: 0;
padding-top: 2rem;
}
h2 {
font-size: 1.8em;
}
.blue {
color: blue;
}
.green {
color: #5ff508;
}
.yellow {
color: gold;
}
.server {
display: block;
text-decoration: none;
padding: 1rem 0;
padding-left: 1.5rem;
border-left: 2px solid white;
}
.server:hover {
background-color: #ffffff33;
cursor: pointer;
}
.game {
font-size: .6em;
}
.server > h2 {
margin: 0;
}
.server > *:last-child {
margin-bottom: 0;
}
.info {
margin-top: .3rem;
font-weight: normal;
}
.info > *:nth-child(2n-1) {
font-weight: bold;
}
.info > *:nth-child(2n):not(:last-child) {
margin-right: 2rem;
}
h3.info {
text-align: center;
margin-top: -.8rem;
}
.default {
filter: opacity(.5);
}
summary {
margin: .6rem 0;
}
summary:hover {
cursor: pointer;
}
summary h3 {
display: inline;
}
[title]:hover {
cursor: help;
}
a {
color: white;
text-decoration: underline;
}
#home {
position: absolute; top: 1rem;
}
nav {
list-style: none;
padding: 0;
display: flex;
}
nav > * {
text-align: center;
display: block;
flex-grow: 1;
padding: .5rem 0;
margin: .5em 0;
border-right: 1px solid #ffffff33;
}
nav > *:last-child {
border: none;
}
nav > *:hover {
background-color: #ffffff33;
cursor: pointer;
}
input[type=radio][name=toggles] {
display: none;
}