219 lines
6.4 KiB
PHP
219 lines
6.4 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Beatrice Vuitton - homo.casa</title>
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
|
<link rel="manifest" href="/site.webmanifest">
|
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ee0000">
|
|
<meta name="msapplication-TileColor" content="#00aba9">
|
|
<meta name="theme-color" content="#ffffff">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
|
|
<style type="text/css">
|
|
/* background */
|
|
body {
|
|
background-image: url(monogram.gif);
|
|
background-color: #463731;
|
|
background-position: center;
|
|
background-repeat: repeat;
|
|
background-size: 132px;
|
|
|
|
color: #fff;
|
|
text-shadow: 1px 1px #000;
|
|
|
|
text-align: center;
|
|
}
|
|
|
|
/* layout */
|
|
header, #luggage, #parties, footer {
|
|
clear: both;
|
|
padding: 0.5em;
|
|
}
|
|
header {
|
|
color: #e9992d;
|
|
}
|
|
.luggage {
|
|
float: left;
|
|
width: 25%;
|
|
}
|
|
h5 {
|
|
text-align: left;
|
|
margin: 0.5em 3em;
|
|
}
|
|
em {
|
|
float: right;
|
|
}
|
|
.party {
|
|
float: left;
|
|
width: 50%;
|
|
}
|
|
#bernkastel {
|
|
color: #849bf3;
|
|
}
|
|
#lambdadelta {
|
|
color: #ffe4f2;
|
|
}
|
|
#virgilia {
|
|
color: #d1d0e3;
|
|
display: inline-block;
|
|
margin: auto;
|
|
text-align: left;
|
|
}
|
|
|
|
/* breakpoints at 850px and 475px */
|
|
@media screen and (max-width: 850px) {
|
|
.luggage {
|
|
width: 50%;
|
|
}
|
|
}
|
|
@media screen and (max-width: 475px) {
|
|
.luggage {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<?php
|
|
error_reporting(0);
|
|
|
|
function getByteString($bytes) {
|
|
$symbol = array('B', 'KB', 'MB', 'GB', 'TB');
|
|
$exp = ($bytes ? floor(log($bytes)/log(1024)) : 0);
|
|
return sprintf(
|
|
'%.2f '.$symbol[$exp],
|
|
($bytes ? $bytes/pow(1024, floor($exp)) : 0)
|
|
);
|
|
}
|
|
function getPercentageUsed($total, $used) {
|
|
return ($total && $used ?
|
|
sprintf('%.4f', (100 * $used / $total))
|
|
: false);
|
|
}
|
|
function getDifference($minuend, $subtrahend) {
|
|
return ($minuend && $subtrahend ?
|
|
$minuend - $subtrahend
|
|
: false);
|
|
}
|
|
|
|
$keepall_total = disk_total_space("/Volumes/Keepall/");
|
|
$keepall_free = disk_free_space("/Volumes/Keepall/");
|
|
$keepall_used = getDifference($keepall_total, $keepall_free);
|
|
$keepall_percent = getPercentageUsed($keepall_total, $keepall_used);
|
|
|
|
$neverfull_total = disk_total_space("/Volumes/Neverfull/");
|
|
$neverfull_free = disk_free_space("/Volumes/Neverfull/");
|
|
$neverfull_used = getDifference($neverfull_total, $neverfull_free);
|
|
$neverfull_percent = getPercentageUsed($neverfull_total, $neverfull_used);
|
|
|
|
$speedy_total = disk_total_space("/Volumes/Speedy/");
|
|
$speedy_free = disk_free_space("/Volumes/Speedy/");
|
|
$speedy_used = getDifference($speedy_total, $speedy_free);
|
|
$speedy_percent = getPercentageUsed($speedy_total, $speedy_used);
|
|
|
|
$pochette_total = disk_total_space("/Volumes/Pochette/");
|
|
$pochette_free = disk_free_space("/Volumes/Pochette/");
|
|
$pochette_used = getDifference($pochette_total, $pochette_free);
|
|
$pochette_percent = getPercentageUsed($pochette_total, $pochette_used);
|
|
?>
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<h1>Beatrice Vuitton</h1>
|
|
</header>
|
|
|
|
<div id="luggage">
|
|
<h2>Luggage</h2>
|
|
<div class="luggage">
|
|
<h3>Keepall</h3>
|
|
<svg height="80%" width="80%" viewBox="0 0 20 20">
|
|
<circle r="10" cx="10" cy="10" fill="#e6ddcc" />
|
|
<circle r="5" cx="10" cy="10" fill="transparent"
|
|
stroke="#312c4c"
|
|
stroke-width="10"
|
|
stroke-dasharray="<?php echo ($keepall_percent ?
|
|
$keepall_percent : 0) * 31.4 / 100;?> 31.4"
|
|
transform="rotate(-90) translate(-20)"
|
|
/>
|
|
</svg>
|
|
<h5>Free Space: <em><?php echo getByteString($keepall_free);?></em></h5>
|
|
<h5>Used Space: <em><?php echo getByteString($keepall_used);?></em></h5>
|
|
</div>
|
|
<div class="luggage">
|
|
<h3>Neverfull</h3>
|
|
<svg height="80%" width="80%" viewBox="0 0 20 20">
|
|
<circle r="10" cx="10" cy="10" fill="#e6ddcc" />
|
|
<circle r="5" cx="10" cy="10" fill="transparent"
|
|
stroke="#312c4c"
|
|
stroke-width="10"
|
|
stroke-dasharray="<?php echo ($neverfull_percent ?
|
|
$neverfull_percent : 0) * 31.4 / 100;?> 31.4"
|
|
transform="rotate(-90) translate(-20)"
|
|
/>
|
|
</svg>
|
|
<h5>Free Space: <em><?php echo getByteString($neverfull_free);?></em></h5>
|
|
<h5>Used Space: <em><?php echo getByteString($neverfull_used);?></em></h5>
|
|
</div>
|
|
<div class="luggage">
|
|
<h3>Speedy</h3>
|
|
<svg height="80%" width="80%" viewBox="0 0 20 20">
|
|
<circle r="10" cx="10" cy="10" fill="#e6ddcc" />
|
|
<circle r="5" cx="10" cy="10" fill="transparent"
|
|
stroke="#312c4c"
|
|
stroke-width="10"
|
|
stroke-dasharray="<?php echo ($speedy_percent ?
|
|
$speedy_percent : 0) * 31.4 / 100;?> 31.4"
|
|
transform="rotate(-90) translate(-20)"
|
|
/>
|
|
</svg>
|
|
<h5>Free Space: <em><?php echo getByteString($speedy_free);?></em></h5>
|
|
<h5>Used Space: <em><?php echo getByteString($speedy_used);?></em></h5>
|
|
</div>
|
|
<div class="luggage">
|
|
<h3>Pochette</h3>
|
|
<svg height="80%" width="80%" viewBox="0 0 20 20">
|
|
<circle r="10" cx="10" cy="10" fill="#e6ddcc" />
|
|
<circle r="5" cx="10" cy="10" fill="transparent"
|
|
stroke="#312c4c"
|
|
stroke-width="10"
|
|
stroke-dasharray="<?php echo ($pochette_percent ?
|
|
$pochette_percent : 0) * 31.4 / 100;?> 31.4"
|
|
transform="rotate(-90) translate(-20)"
|
|
/>
|
|
</svg>
|
|
<h5>Free Space: <em><?php echo getByteString($pochette_free);?></em></h5>
|
|
<h5>Used Space: <em><?php echo getByteString($pochette_used);?></em></h5>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="parties">
|
|
<h2>Witch's Tea Parties</h2>
|
|
<p>note: authentication required for access.</p>
|
|
<a href="https://bernkastel.homo.casa">
|
|
<div class="party" id="bernkastel">
|
|
<h3>Bernkastel</h3>
|
|
<h4>witch of miracles</h4>
|
|
</div>
|
|
</a>
|
|
<a href="https://lambdadelta.homo.casa">
|
|
<div class="party" id="lambdadelta">
|
|
<h3>Lambdadelta</h3>
|
|
<h4>witch of certainty</h4>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<footer>
|
|
<p id="virgilia">
|
|
Real magic is the power to repair, to revive, to call back: <br />
|
|
  happiness that has disappeared<br />
|
|
  love that has gone cold<br />
|
|
  a forgotten smile to a person's face.
|
|
</p>
|
|
</footer>
|
|
|
|
</body>
|
|
</html>
|