first commit

This commit is contained in:
FrancescoCeliento 2020-12-19 09:43:44 +01:00
commit a14e5421e4
4 changed files with 233 additions and 0 deletions

BIN
LOGO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

78
index.php Normal file
View File

@ -0,0 +1,78 @@
<?php
if (strpos($_SERVER['REQUEST_URI'], 'index.php') !== false) {
$newLink = str_replace('/index.php','', $_SERVER['REQUEST_URI']);
header('Location: '.$newLink);
}
$searchsite = ['https://www.ecosia.org/search?q=',
'https://search.lilo.org/?q=',
'https://www.givero.com/search?q='];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Search for planet</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<header>
<ul>
<!--<li><a href="#">What is Ethical research</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">News</a></li>-->
<li>No Cookie</li>
<li>No Profiling</li>
<li>No Script</li>
<li>No Track</li>
</ul>
</header>
<div class="main">
<form name="searchForm" class="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<img src="LOGO.png">
<div class="searchBox">
<input type="text" name="search_query" class="search">
<div class="icons">
<div>
<img src="search-icon.png">
</div>
</div>
</div>
<div class="buttons">
<button type="submit" name="submit">Search</button>
</div>
</form>
</div>
<div class="footer">
<div class="row row2">
<ul>
<!--<li><a href="#">Gitea</a></li>-->
<!--<li><a href="#">Liberapay</a></li>-->
<li><a href="https://www.selectallfromdual.com" target="_blank">Powered by Dummy-X</a></li>
<li><a href="https://mastodon.uno/@selectallfromdual" target="_blank">Mastodon</a></li>
</ul>
</div>
</div>
</section>
</body>
</html>
<?php
if(isset($_POST['submit'])) {
$q = $_POST['search_query'];
$q = str_replace (' ', '+', $q);
$idx = rand(1,sizeof($searchsite))-1;
$query = $searchsite[$idx].$q.'&src=searchforplanet.org';
header('Location: '.$query);
}
?>

BIN
search-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

155
style.css Normal file
View File

@ -0,0 +1,155 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'arial', sans-serif;
}
section {
position: relative;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
section header {
position: absolute;
top: 0;
width: 100%;
display: flex;
justify-content: flex-end;
padding: 20px;
}
section header ul {
display: flex;
justify-content: center;
align-items: center;
}
section header ul li {
list-style: none;
margin-left: 20px;
}
section header ul li a {
color: #111;
text-decoration: none;
font-size: 13px;
}
section .main {
width: 580px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
section .main .form {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
section .main .form .searchBox {
position: relative;
width: 100%;
margin-top: 20px;
}
section .main .form .searchBox .search {
width: 100%;
padding: 13px;
padding-left: 45px;
padding-right: 60px;
border-radius: 30px;
border: 1px solid #ccc;
outline: none;
font-size: 16px;
}
section .main .form .searchBox .icons {
position: absolute;
top: 0;
width: 100%;
display: flex;
padding: 12px 20px;
justify-content: space-between;
align-items: center;
pointer-events: none;
}
section .main .form .buttons {
margin-top: 20px;
align-items: center;
}
section .main .form .buttons button {
margin: 0 5px;
padding: 12px 20px;
color: #555;
font-size: 14px;
border: none;
cursor: pointer;
border-radius: 4px;
border: 1px solid transparent;
outline: none;
}
section .main .form .buttons button:hover {
border: 1px solid #ccc;
}
section .footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background: #f2f2f2;
}
section .footer .row {
padding: 15px 25px;
border-top: 1px solid rgba(0,0,0,0.05);
}
section .footer .row {
padding: 15px 25px;
border-top: 1px solid rgba(0,0,0,0.05);
}
section .footer .row.row2 {
display: flex;
justify-content: space-between;
}
section .footer .row.row2 ul {
display: flex;
}
section .footer .row.row2 ul li {
list-style: none;
}
section .footer .row.row2 ul li a {
text-decoration: none;
font-size: 14px;
color: #5f6368;
margin-right: 25px;
}
section .footer .row.row2 ul:nth-child(2) li a {
text-decoration: none;
font-size: 14px;
color: #5f6368;
margin-right: 0px;
margin-left: 25px;
}