refactor(whitespace): tabs -> 2 spaces

main
steven 2020-12-02 12:32:16 -05:00
parent c8060804b8
commit 45eec9baef
1 changed files with 210 additions and 210 deletions

View File

@ -1,226 +1,226 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>homo.casa</title> <title>homo.casa</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <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="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest"> <link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ee0000"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ee0000">
<meta name="msapplication-TileColor" content="#00aba9"> <meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<?php <?php
function getByteString($bytes) { function getByteString($bytes) {
$symbols = array('B', 'KB', 'MB', 'GB', 'TB'); $symbols = array('B', 'KB', 'MB', 'GB', 'TB');
$exp = ($bytes ? floor(log($bytes)/log(1024)) : 0); $exp = ($bytes ? floor(log($bytes)/log(1024)) : 0);
return sprintf( return sprintf(
'%.2f '.$symbol[$exp], '%.2f '.$symbol[$exp],
($bytes ? $bytes/pow(1024, floor($exp)) : 0) ($bytes ? $bytes/pow(1024, floor($exp)) : 0)
); );
} }
function getPercentageUsed($total, $used) { function getPercentageUsed($total, $used) {
return ($total && $used ? return ($total && $used ?
sprintf('%.4f', (100 * $used / $total)) sprintf('%.4f', (100 * $used / $total))
: false); : false);
} }
function getDifference($minuend, $subtrahend) { function getDifference($minuend, $subtrahend) {
return ($minuend && $subtrahend ? return ($minuend && $subtrahend ?
$minuend - $subtrahend $minuend - $subtrahend
: false); : false);
} }
$hinamizawa_total = disk_total_space(/data/); $hinamizawa_total = disk_total_space(/data/);
$hinamizawa_free = disk_free_space(/data/); $hinamizawa_free = disk_free_space(/data/);
$hinamizawa_used = getDifference($hinamizawa_total, $hinamizawa_free); $hinamizawa_used = getDifference($hinamizawa_total, $hinamizawa_free);
$hinamizawa_percent = $hinamizawa_percent =
getPercentageUsed($hinamizawa_total, $hinamizawa_used); getPercentageUsed($hinamizawa_total, $hinamizawa_used);
$maebara_total = disk_total_space(/data/maebara/); $maebara_total = disk_total_space(/data/maebara/);
$maebara_free = disk_free_space(/data/maebara/); $maebara_free = disk_free_space(/data/maebara/);
$maebara_used = getDifference($maebara_total, $maebara_free); $maebara_used = getDifference($maebara_total, $maebara_free);
$maebara_percent = $maebara_percent =
getPercentageUsed($maebara_total, $maebara_used); getPercentageUsed($maebara_total, $maebara_used);
$houjou_total = disk_total_space(/data/houjou/); $houjou_total = disk_total_space(/data/houjou/);
$houjou_free = disk_free_space(/data/houjou/); $houjou_free = disk_free_space(/data/houjou/);
$houjou_used = getDifference($houjou_total, $houjou_free); $houjou_used = getDifference($houjou_total, $houjou_free);
$houjou_percent = $houjou_percent =
getPercentageUsed($houjou_total, $houjou_used); getPercentageUsed($houjou_total, $houjou_used);
$ryuuguu_total = disk_total_space(/data/ryuuguu/); $ryuuguu_total = disk_total_space(/data/ryuuguu/);
$ryuuguu_free = disk_free_space(/data/ryuuguu/); $ryuuguu_free = disk_free_space(/data/ryuuguu/);
$ryuuguu_used = getDifference($ryuuguu_total, $ryuuguu_free); $ryuuguu_used = getDifference($ryuuguu_total, $ryuuguu_free);
$ryuuguu_percent = $ryuuguu_percent =
getPercentageUsed($ryuuguu_total, $ryuuguu_used); getPercentageUsed($ryuuguu_total, $ryuuguu_used);
$sonozaki_total = disk_total_space(/data/sonozaki/); $sonozaki_total = disk_total_space(/data/sonozaki/);
$sonozaki_free = disk_free_space(/data/sonozaki/); $sonozaki_free = disk_free_space(/data/sonozaki/);
$sonozaki_used = getDifference($sonozaki_total, $sonozaki_free); $sonozaki_used = getDifference($sonozaki_total, $sonozaki_free);
$sonozaki_percent = $sonozaki_percent =
getPercentageUsed($sonozaki_total, $sonozaki_used); getPercentageUsed($sonozaki_total, $sonozaki_used);
?> ?>
<style type="text/css"> <style type="text/css">
.pie { .pie {
background: #bbb; background: #bbb;
border-radius: 100%; border-radius: 100%;
height: calc(var(--size, 200) * 1px); height: calc(var(--size, 200) * 1px);
width: calc(var(--size, 200) * 1px); width: calc(var(--size, 200) * 1px);
position: relative; position: relative;
} }
.slice { .slice {
height: 100%; height: 100%;
width: 100%; width: 100%;
position: absolute; position: absolute;
transform: transform:
translate(0, -50%) translate(0, -50%)
rotate(90deg); rotate(90deg);
transform-origin: 50% 100%; transform-origin: 50% 100%;
} }
.slice:after, .slice:after,
.slice:before { .slice:before {
background: var(--bg, #fff); background: var(--bg, #fff);
content: ''; content: '';
height: 100%; height: 100%;
width: 100%; width: 100%;
position: absolute; position: absolute;
} }
.slice:before { .slice:before {
--degrees: calc((var(--value, 45) / 100) * 360); --degrees: calc((var(--value, 45) / 100) * 360);
transform: transform:
translate(0, 100%) translate(0, 100%)
rotate(calc(var(--degrees) * 1deg)) rotate(calc(var(--degrees) * 1deg))
; ;
transform-origin: 50% 0; transform-origin: 50% 0;
} }
.slice:after { .slice:after {
opacity: var(--over50, 0); opacity: var(--over50, 0);
} }
.hinamizawa { .hinamizawa {
--bg: #637bc0; --bg: #637bc0;
background: var(--bg, #637bc0); background: var(--bg, #637bc0);
} }
.maebara { .maebara {
--bg: #835e4c; --bg: #835e4c;
background: var(--bg, #835e4c); background: var(--bg, #835e4c);
} }
.houjou { .houjou {
--bg: #ebd076; --bg: #ebd076;
background: var(--bg, #ebd076); background: var(--bg, #ebd076);
} }
.ryuuguu { .ryuuguu {
--bg: #faaa66; --bg: #faaa66;
background: var(--bg, #faaa66); background: var(--bg, #faaa66);
} }
.sonozaki { .sonozaki {
--bg: #86c9a8; --bg: #86c9a8;
background: var(--bg, #86c9a8); background: var(--bg, #86c9a8);
} }
#hinamizawa-used { #hinamizawa-used {
--value: <?php echo ($hinamizawa_percent ? $hinamizawa_percent : 0); ?>; --value: <?php echo ($hinamizawa_percent ? $hinamizawa_percent : 0); ?>;
--over50: <?php echo ($hinamizawa_percent > 50 ? '1' : '0'); ?> --over50: <?php echo ($hinamizawa_percent > 50 ? '1' : '0'); ?>
} }
#maebara-used { #maebara-used {
--value: <?php echo ($maebara_percent ? $maebara_percent : 0); ?>; --value: <?php echo ($maebara_percent ? $maebara_percent : 0); ?>;
--over50: <?php echo ($maebara_percent > 50 ? '1' : '0'); ?> --over50: <?php echo ($maebara_percent > 50 ? '1' : '0'); ?>
} }
#houjou-used { #houjou-used {
--value: <?php echo ($houjou_percent ? $houjou_percent : 0); ?>; --value: <?php echo ($houjou_percent ? $houjou_percent : 0); ?>;
--over50: <?php echo ($houjou_percent > 50 ? '1' : '0'); ?> --over50: <?php echo ($houjou_percent > 50 ? '1' : '0'); ?>
} }
#ryuuguu-used { #ryuuguu-used {
--value: <?php echo ($ryuuguu_percent ? $ryuuguu_percent : 0); ?>; --value: <?php echo ($ryuuguu_percent ? $ryuuguu_percent : 0); ?>;
--over50: <?php echo ($ryuuguu_percent > 50 ? '1' : '0'); ?> --over50: <?php echo ($ryuuguu_percent > 50 ? '1' : '0'); ?>
} }
#sonozaki-used { #sonozaki-used {
--value: <?php echo ($sonozaki_percent ? $sonozaki_percent : 0); ?>; --value: <?php echo ($sonozaki_percent ? $sonozaki_percent : 0); ?>;
--over50: <?php echo ($sonozaki_percent > 50 ? '1' : '0'); ?> --over50: <?php echo ($sonozaki_percent > 50 ? '1' : '0'); ?>
} }
</style> </style>
</head> </head>
<body> <body>
<header> <header>
<h1>homo.casa</h1> <h1>homo.casa</h1>
<p>Gods and dice are best when silent.</p> <p>Gods and dice are best when silent.</p>
</header> </header>
<div id="homes"> <div id="homes">
<h2>homes</h2> <h2>homes</h2>
<div class="home"> <div class="home">
<h3>hinamizawa - <?php echo getByteString($hinamizawa_total); ?></h3> <h3>hinamizawa - <?php echo getByteString($hinamizawa_total); ?></h3>
<p>the village where we all reside</p> <p>the village where we all reside</p>
<div class="pie"> <div class="pie">
<div class="slice hinamizawa" id="hinamizawa-used"></div> <div class="slice hinamizawa" id="hinamizawa-used"></div>
</div> </div>
<h4>Free Space: <em><?php echo <h4>Free Space: <em><?php echo
getByteString($hinamizawa_free); getByteString($hinamizawa_free);
?></em></h4> ?></em></h4>
<h4>Space Used: <em><?php echo <h4>Space Used: <em><?php echo
getByteString($hinamizawa_used); getByteString($hinamizawa_used);
?></em></h4> ?></em></h4>
</div> </div>
<div class="home"> <div class="home">
<h3>maebara - <?php echo getByteString($maebara_total); ?></h3> <h3>maebara - <?php echo getByteString($maebara_total); ?></h3>
<p>a famous artist, his loving wife, and their charismatic son</p> <p>a famous artist, his loving wife, and their charismatic son</p>
<div class="pie"> <div class="pie">
<div class="slice maebara" id="maebara-used"></div> <div class="slice maebara" id="maebara-used"></div>
</div> </div>
<h4>Free Space: <em><?php echo <h4>Free Space: <em><?php echo
getByteString($maebara_free); getByteString($maebara_free);
?></em></h4> ?></em></h4>
<h4>Space Used: <em><?php echo <h4>Space Used: <em><?php echo
getByteString($maebara_used); getByteString($maebara_used);
?></em></h4> ?></em></h4>
</div> </div>
<div class="home"> <div class="home">
<h3>houjou - <?php echo getByteString($houjou_total); ?></h3> <h3>houjou - <?php echo getByteString($houjou_total); ?></h3>
<p>a little girl awaiting the return of her big brother</p> <p>a little girl awaiting the return of her big brother</p>
<div class="pie"> <div class="pie">
<div class="slice houjou" id="houjou-used"></div> <div class="slice houjou" id="houjou-used"></div>
</div> </div>
<h4>Free Space: <em><?php echo <h4>Free Space: <em><?php echo
getByteString($houjou_free); getByteString($houjou_free);
?></em></h4> ?></em></h4>
<h4>Space Used: <em><?php echo <h4>Space Used: <em><?php echo
getByteString($houjou_used); getByteString($houjou_used);
?></em></h4> ?></em></h4>
</div> </div>
<div class="home"> <div class="home">
<h3>ryuuguu - <?php echo getByteString($ryuuguu_total); ?></h3> <h3>ryuuguu - <?php echo getByteString($ryuuguu_total); ?></h3>
<p>a caring father and his superstitious daughter</p> <p>a caring father and his superstitious daughter</p>
<div class="pie"> <div class="pie">
<div class="slice ryuuguu" id="ryuuguu-used"></div> <div class="slice ryuuguu" id="ryuuguu-used"></div>
</div> </div>
<h4>Free Space: <em><?php echo <h4>Free Space: <em><?php echo
getByteString($ryuuguu_free); getByteString($ryuuguu_free);
?></em></h4> ?></em></h4>
<h4>Space Used: <em><?php echo <h4>Space Used: <em><?php echo
getByteString($ryuuguu_used); getByteString($ryuuguu_used);
?></em></h4> ?></em></h4>
</div> </div>
<div class="home"> <div class="home">
<h3>sonozaki - <?php echo getByteString($sonozaki_total); ?></h3> <h3>sonozaki - <?php echo getByteString($sonozaki_total); ?></h3>
<p>a grandmother of twins carrying on her stone face</p> <p>a grandmother of twins carrying on her stone face</p>
<div class="pie"> <div class="pie">
<div class="slice sonozaki" id="sonozaki-used"></div> <div class="slice sonozaki" id="sonozaki-used"></div>
</div> </div>
<h4>Free Space: <em><?php echo <h4>Free Space: <em><?php echo
getByteString($sonozaki_free); getByteString($sonozaki_free);
?></em></h4> ?></em></h4>
<h4>Space Used: <em><?php echo <h4>Space Used: <em><?php echo
getByteString($sonozaki_used); getByteString($sonozaki_used);
?></em></h4> ?></em></h4>
</div> </div>
</div> </div>
<div id="services"> <div id="services">
<h2>services</h2> <h2>services</h2>
<p>note: authentication required for access.</p> <p>note: authentication required for access.</p>
<div class="service"> <div class="service">
<h3>St. Lucia</h3> <h3>St. Lucia</h3>
<div id="st-lucia"></div> <div id="st-lucia"></div>
<p>a private school where research is exchanged</p> <p>a private school where research is exchanged</p>
</div> </div>
<div class="service"> <div class="service">
<h3>Angel Mort</h3> <h3>Angel Mort</h3>
<div id="angel-mort"></div> <div id="angel-mort"></div>
<p>a restaurant where luxury is served</p> <p>a restaurant where luxury is served</p>
</div> </div>
</div> </div>
<footer> <footer>
<p>Child of Man. What do you seek from this World?</p> <p>Child of Man. What do you seek from this World?</p>
</footer> </footer>
</body> </body>
</html> </html>