Merge pull request #217 from alternative-rvb/patch-3

Refactoring
This commit is contained in:
Leo Khoa
2021-04-25 14:16:48 +00:00
committed by GitHub

View File

@@ -1,79 +1,167 @@
<?php <?php
if (!empty($_GET['q'])) { if (!empty($_GET['q'])) {
switch ($_GET['q']) { switch ($_GET['q']) {
case 'info': case 'info':
phpinfo(); phpinfo();
exit; exit;
break; break;
}
} }
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>Laragon</title>
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css"> <head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Laragon</title>
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="https://i.imgur.com/ky9oqct.png" type="image/png">
<style>
*,
:before *,
:after * {
box-sizing: border-box;
}
<style> body {
html, body { margin: 0;
height: 100%; min-height: 100vh;
} font-weight: 100;
font-family: 'Karla';
font-size: 18px;
}
body { header,
margin: 0; main,
padding: 0; nav,
width: 100%; aside {
display: table; padding: 1rem;
font-weight: 100; margin: auto;
font-family: 'Karla'; max-width: 1200px;
} text-align: center;
}
.container { header {
text-align: center; display: flex;
display: table-cell; flex-wrap: wrap;
vertical-align: middle; justify-content: center;
} align-items: center;
}
.content { .header__item {
text-align: center; margin: 0;
display: inline-block; padding: 1rem;
} }
.title { .header--logo {
font-size: 96px; height: 8rem;
} }
.opt { h1 {
margin-top: 30px; font-size: 5rem;
} }
.opt a { main {
text-decoration: none; background-color: #f5f5f5;
font-size: 150%; }
}
a:hover { nav {
color: red; width: 100%;
} }
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title" title="Laragon">Laragon</div>
<div class="info"><br /> ul {
<?php print($_SERVER['SERVER_SOFTWARE']); ?><br /> list-style: none;
PHP version: <?php print phpversion(); ?> <span><a title="phpinfo()" href="/?q=info">info</a></span><br /> padding: 0;
Document Root: <?php print ($_SERVER['DOCUMENT_ROOT']); ?><br /> margin: auto;
}
</div> a {
<div class="opt"> color: #37ADFF;
<div><a title="Getting Started" href="http://laragon.org/?q=getting-started">Getting Started</a></div> font-weight: 900;
</div> text-decoration: none;
</div> }
a:hover {
color: red;
font-weight: 900;
transition: 300ms;
}
main a {
color: grey;
}
nav a {
display: block;
margin: 1rem 0;
}
nav a:after {
content: '→';
margin-left: 0.5rem;
}
.alert {
color: red;
font-weight: 900;
}
@media (min-width: 650px) {
h1 {
font-size: 10rem;
}
}
</style>
</head>
<body>
<header>
<img class="header__item header--logo" src="https://i.imgur.com/ky9oqct.png" alt="Offline">
<h1 class="header__item header--title" title="Laragon">Laragon</h1>
</header>
<main>
<p>
<?php print($_SERVER['SERVER_SOFTWARE']); ?>
</p>
<p>
PHP version: <?php print phpversion(); ?> <span><a title="phpinfo()" href="/?q=info">info</a></span>
</p>
<p>
Document Root: <?php print($_SERVER['DOCUMENT_ROOT']); ?>
</p>
<p>
<a title="Getting Started" href="https://laragon.org/docs">Getting Started</a>
</p>
</main>
<?php
$dirList = glob('*', GLOB_ONLYDIR);
if ($dirList != NULL) :
?>
<nav>
<ul>
<?php
foreach ($dirList as $key => $value) :
$link = 'https://' . $value . '.test';
?>
<a href="<?php echo $link; ?>" target="_blank"><?php echo $link; ?></a>
<?php
endforeach;
?>
</ul>
</nav>
<?php
else :
?>
<aside>
<p class="alert">There are no directories, create your first project now</p>
<div>
<img src="https://i.imgur.com/3Sgu8XI.png" alt="Offline">
</div>
</aside>
<?php
endif;
?>
</body>
</div>
</body>
</html> </html>