Home page can display the list of all projects in www

This commit is contained in:
Nicolas M
2021-01-06 11:36:14 +01:00
parent 64c3bc65b7
commit 1075a6f142

View File

@@ -14,10 +14,9 @@ if (!empty($_GET['q'])) {
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="https://i.imgur.com/ky9oqct.png" type="image/png">
<title>Laragon</title>
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<link rel="shortcut icon" href="https://i.imgur.com/ky9oqct.png" type="image/png">
<style>
*,
:before *,
@@ -35,7 +34,8 @@ if (!empty($_GET['q'])) {
header,
main,
nav {
nav,
aside {
padding: 1rem;
margin: auto;
max-width: 1200px;
@@ -79,17 +79,13 @@ if (!empty($_GET['q'])) {
a {
color: #37ADFF;
font-weight: 900;
text-decoration: none;
}
a:hover {
color: red;
}
a:after {
font-family: 'Font Awesome 5 Free';
font-weight: 900;
margin-left: 1rem;
content: '\f35d';
transition: 300ms;
}
main a {
@@ -101,6 +97,16 @@ if (!empty($_GET['q'])) {
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;
@@ -111,7 +117,7 @@ if (!empty($_GET['q'])) {
<body>
<header>
<img class="header__item header--logo" src="https://i.imgur.com/ky9oqct.png" alt="Laragon logo">
<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>
@@ -128,21 +134,34 @@ if (!empty($_GET['q'])) {
<a title="Getting Started" href="https://laragon.org/docs">Getting Started</a>
</p>
</main>
<nav>
<ul>
<?php
$variable = scandir('.');
foreach ($variable as $key => $value) :
if ($value != 'desktop.ini' && $value != '.' && $value != '..') :
<?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
endif;
endforeach;
?>
</ul>
</nav>
<?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>
</html>