Skip to content

Commit 6959b13

Browse files
authored
Fix css issue
#339
1 parent 2631fda commit 6959b13

File tree

1 file changed

+95
-156
lines changed

1 file changed

+95
-156
lines changed

www/index.php

Lines changed: 95 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,106 @@
11
<?php
22
if (!empty($_GET['q'])) {
3-
switch ($_GET['q']) {
4-
case 'info':
5-
phpinfo();
6-
exit;
7-
break;
8-
}
3+
$query = htmlspecialchars($_GET['q'], ENT_QUOTES, 'UTF-8');
4+
5+
switch ($query) {
6+
case 'info':
7+
phpinfo();
8+
exit;
9+
default:
10+
header("HTTP/1.0 404 Not Found");
11+
echo "Invalid query parameter.";
12+
exit;
13+
}
914
}
1015
?>
16+
1117
<!DOCTYPE html>
1218
<html lang="en">
13-
1419
<head>
15-
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
16-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
17-
<title>Laragon</title>
18-
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css">
19-
<link rel="shortcut icon" href="https://i.imgur.com/ky9oqct.png" type="image/png">
20-
<style>
21-
*,
22-
:before *,
23-
:after * {
24-
box-sizing: border-box;
25-
}
26-
27-
body {
28-
margin: 0;
29-
min-height: 100vh;
30-
font-weight: 100;
31-
font-family: 'Karla', sans-serif;
32-
font-size: 18px;
33-
}
34-
35-
header,
36-
main,
37-
nav,
38-
aside {
39-
padding: 1rem;
40-
margin: auto;
41-
max-width: 1200px;
42-
text-align: center;
43-
}
44-
45-
header {
46-
display: flex;
47-
flex-wrap: wrap;
48-
justify-content: center;
49-
align-items: center;
50-
}
51-
52-
.header__item {
53-
margin: 0;
54-
padding: 1rem;
55-
}
56-
57-
.header--logo {
58-
height: 8rem;
59-
}
60-
61-
h1 {
62-
font-size: 5rem;
63-
}
64-
65-
main {
66-
background-color: #f5f5f5;
67-
}
68-
69-
nav {
70-
width: 100%;
71-
}
72-
73-
ul {
74-
list-style: none;
75-
padding: 0;
76-
margin: auto;
77-
}
78-
79-
a {
80-
color: #37ADFF;
81-
font-weight: 900;
82-
text-decoration: none;
83-
}
84-
85-
a:hover {
86-
color: red;
87-
font-weight: 900;
88-
transition: 300ms;
89-
}
90-
91-
main a {
92-
color: grey;
93-
}
94-
95-
nav a {
96-
display: block;
97-
margin: 1rem 0;
98-
}
99-
100-
nav a:after {
101-
content: '→';
102-
margin-left: 0.5rem;
103-
}
104-
105-
.alert {
106-
color: red;
107-
font-weight: 900;
108-
}
109-
110-
@media (min-width: 650px) {
111-
h1 {
112-
font-size: 10rem;
113-
}
114-
}
115-
</style>
20+
<meta charset="UTF-8">
21+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
22+
<title>Laragon</title>
23+
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css">
24+
<style>
25+
html, body {
26+
height: 100%;
27+
margin: 0;
28+
padding: 0;
29+
font-family: 'Karla', sans-serif;
30+
font-weight: 100;
31+
background-color: #f9f9f9;
32+
color: #333;
33+
}
34+
35+
.container {
36+
display: flex;
37+
justify-content: center;
38+
align-items: center;
39+
height: 100%;
40+
text-align: center;
41+
}
42+
43+
.content {
44+
max-width: 800px;
45+
padding: 100px;
46+
background: #fff;
47+
border-radius: 8px;
48+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
49+
}
50+
51+
.title {
52+
font-size: 60px;
53+
margin: 0;
54+
55+
}
56+
57+
.info {
58+
margin-top: 20px;
59+
font-size: 18px;
60+
line-height: 1.6;
61+
}
62+
63+
.info a {
64+
color: #007bff;
65+
text-decoration: none;
66+
}
67+
68+
.info a:hover {
69+
color: #0056b3;
70+
text-decoration: underline;
71+
}
72+
73+
.opt {
74+
margin-top: 30px;
75+
}
76+
77+
.opt a {
78+
font-size: 18px;
79+
color: #007bff;
80+
text-decoration: none;
81+
}
82+
83+
.opt a:hover {
84+
color: #0056b3;
85+
text-decoration: underline;
86+
}
87+
</style>
11688
</head>
117-
11889
<body>
119-
<header>
120-
<img class="header__item header--logo" src="https://i.imgur.com/ky9oqct.png" alt="Offline">
121-
<h1 class="header__item header--title" title="Laragon">Laragon</h1>
122-
</header>
123-
<main>
124-
<p>
125-
<?php print($_SERVER['SERVER_SOFTWARE']); ?>
126-
</p>
127-
<p>
128-
PHP version: <?php print PHP_VERSION; ?> <span><a title="phpinfo()" href="/?q=info">info</a></span>
129-
</p>
130-
<p>
131-
Document Root: <?php print($_SERVER['DOCUMENT_ROOT']); ?>
132-
</p>
133-
<p>
134-
<a title="Getting Started" href="https://laragon.org/docs">Getting Started</a>
135-
</p>
136-
</main>
137-
<?php
138-
$dirList = glob('*', GLOB_ONLYDIR);
139-
if (!empty($dirList)) :
140-
?>
141-
<nav>
142-
<ul>
143-
<?php
144-
foreach ($dirList as $key => $value) :
145-
$link = 'https://' . $value . '.test';
146-
?>
147-
<a href="<?php echo $link; ?>" target="_blank"><?php echo $link; ?></a>
148-
<?php
149-
endforeach;
150-
?>
151-
</ul>
152-
</nav>
153-
<?php
154-
else :
155-
?>
156-
<aside>
157-
<p class="alert">There are no directories, create your first project now</p>
158-
<div>
159-
<img src="https://i.imgur.com/3Sgu8XI.png" alt="Offline">
160-
</div>
161-
</aside>
162-
<?php
163-
endif;
164-
?>
90+
<div class="container">
91+
<div class="content">
92+
<h1 class="title" title="Laragon">Laragon</h1>
93+
<div class="info">
94+
<p><?php echo htmlspecialchars($_SERVER['SERVER_SOFTWARE'], ENT_QUOTES, 'UTF-8'); ?></p>
95+
<p>PHP version: <?php echo htmlspecialchars(phpversion(), ENT_QUOTES, 'UTF-8'); ?>
96+
<a title="phpinfo()" href="/?q=info">info</a>
97+
</p>
98+
<p>Document Root: <?php echo htmlspecialchars($_SERVER['DOCUMENT_ROOT'], ENT_QUOTES, 'UTF-8'); ?></p>
99+
</div>
100+
<div class="opt">
101+
<p><a title="Getting Started" href="https://laragon.org/docs">Getting Started</a></p>
102+
</div>
103+
</div>
104+
</div>
165105
</body>
166-
167106
</html>

0 commit comments

Comments
 (0)