Редизайн главной страницы

This commit is contained in:
Shr3dd3r 2023-12-22 06:10:49 +03:00
parent 8d74a51937
commit 6958b75414
11 changed files with 137 additions and 63 deletions

View File

@ -42,4 +42,4 @@ Files starting from "_" ("_example.php") are intended for internal use only.
- [ ] comments/ (GET/POST): show all comments from section by id
- [ ] comments/create.php (POST): create new comment at selected section
- [ ] comments/edit.php (POST): edit existing comment
- [ ] comments/delete.php (POST): remove existing comment
- [ ] comments/delete.php (POST): remove existing comment

View File

@ -2,5 +2,4 @@
**api**: E949 PHP API
**docs**: all documentation here
<!--**html_drafts**: peaces of html markup-->
**front**: things for frontend, like CSS
**front**: things for frontend, like CSS, php script pieces and markup drafts

16
front/footer.php Normal file
View File

@ -0,0 +1,16 @@
<div class="visualbox footer">
<div class="quicklinks">
<p>
<a title="Contacts" href="./static/contact">Contacts</a> |
<a title="Terms of service" href="./static/terms_of_service">Terms of service</a> |
<a title="Privacy policy" href="./static/privacy">Privacy</a>
</p>
</div>
<div class="description">
<p>
E949: The newest generation imageboard.<br>
Copyright (C) 2023 Cyclone-Team<br>
Yes, this project is <a title="E949 source code repository" href="https://git.projectsegfau.lt/Cyclone-Team/e949">open source</a><br>
</p>
</div>
</div>

View File

@ -13,4 +13,6 @@ require_once("favicon.html");
?>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="front/styles/default.css">
<link rel="stylesheet" href="front/styles/base.css">
<link rel="stylesheet" href="front/styles/footer.css">
<link rel="stylesheet" href="front/styles/index.css"> <!--TODO: insert different additional styles on different pages-->

View File

@ -10,14 +10,14 @@ $totalPostsAmount = Post_GetPostsAmount();
$totalPostsAmount = strval($totalPostsAmount);
?>
<div class="nibbabox notsearchbox">
<div class="visualbox">
<?php
// India stronk 🇮🇳💪
$allNumbers = array();
for ($i = 0; $i < strlen($totalPostsAmount); ++$i)
$allNumbers[] = "<img src=\"front/images/counter/" . $totalPostsAmount[$i] . ".png\">";
while (count($allNumbers) < 7)
$allNumbers[] = "<img src=\"front/images/counter/0.png\">";
foreach ($allNumbers as $numberImg)
echo $numberImg;
?>

View File

@ -0,0 +1,6 @@
<?php
// TODO: picking random meme
?>
<div class="visualbox">
<img src="test.png">
</div>

View File

@ -7,8 +7,8 @@ if (!$IS_FRONTEND) {
}
?>
<div class="nibbabox searchbox">
<h1 class="title"><a href=".">E949</a></h1>
<div class="visualbox searchbox">
<a class="title" href=".">E949</a>
<div class="nav">
<?php
// If user is logged in
@ -18,6 +18,7 @@ if (!$IS_FRONTEND) {
$res->ThrowJSONError();
$uname = $res->GetData()["login"];
echo "<a class=\"useraccount\" title=\"Account page\" href=\"./?do=view_user&id=$THIS_USER\">$uname</a>";
unset($res);
} else { // If user is NOT logged in
?>
<a title="Login in existing account" href="./?do=login">Login</a>
@ -34,6 +35,7 @@ if (!$IS_FRONTEND) {
<form action="." accept-charset="UTF-8" method="get">
<input type="text" name="tags" id="tags" value="" size="36" autofocus="autofocus" autocomplete="on"><br>
<input type="submit" value="Search">
<input type="hidden" name="do" value="search_posts">
<!-- TODO: JS
<input type="button" value="Show random meme" id="random-meme">
-->

View File

@ -1,3 +1,5 @@
/* Common blocks */
body {
background-color: #094e59;
background-image: url("../images/bg_pattern_peace.png");
@ -9,35 +11,8 @@ body, div, p, a {
margin: 0;
}
div.wrapper {
text-align: center;
margin: auto;
}
div.nav {
margin-bottom: 0.25rem;
}
div.nav > a {
padding: 0.25rem 0.25rem;
}
div.nibbabox {
margin: 10px auto;
padding: 2px 0;
width: 480px;
max-width: 98vw;
border-radius: 5px;
box-shadow: 0 0 5px #000;
text-shadow: 0 0 2px black, 0 0 6px black;
}
div.searchbox {
padding-bottom: 5px;
}
div.notsearchbox {
font-size: 80%;
}
/* Fonts */
h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt {
font-family: Verdana, Sans-Serif;
@ -50,21 +25,21 @@ h1, h2, h3, h4, h5, h6, p, a {
a {
color: #009049;
}
div.nav a.useraccount {
color: orange;
text-decoration: underline;
transition: all 0.2s;
}
h1.title {
font-size: 4em;
padding: 0;
margin: 0;
a:hover {
color: #00c07c;
}
@media only screen and (max-height: 600px) {
div.wrapper {
top: 25vh;
}
/* Custom blocks */
div.visualbox {
margin: 10px;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 5px #000;
text-shadow: 0 0 2px black, 0 0 6px black;
}

7
front/styles/footer.css Normal file
View File

@ -0,0 +1,7 @@
div.footer div.quicklinks {
padding: 0 0 4px 0;
}
div.footer div.description {
font-size: 80%;
}

77
front/styles/index.css Normal file
View File

@ -0,0 +1,77 @@
/* Index wrapper */
div.wrapper {
text-align: center;
margin: auto;
width: 65%;
}
/* Index fonts */
div.searchbox a.title {
font-size: 4em;
font-weight: bold;
text-decoration: none;
padding: 0;
margin: 0;
}
div.searchbox a.title:hover {
color: #009049;
}
/* Index search box */
div.searchbox input[type=text] {
margin-top: 2px;
margin-bottom: 4px;
color: #00c07c;
background-color: transparent;
border: 2px solid #009049;
border-radius: 3px;
font-family: Verdana, Sans-Serif;
font-size: 16px;
text-shadow: 0 0 6px black;
transition: all 0.25s;
}
div.searchbox input[type=text]:focus {
border: 2px solid transparent;
border-bottom: 2px solid #009049;
outline: none;
}
div.searchbox input[type=submit] {
margin-top: 4px;
background-color: transparent;
border: 2px solid #009049;
border-radius: 3px;
color: #00c07c;
text-shadow: 0 0 6px #000a;
font-family: Verdana, Sans-Serif;
font-size: 16px;
padding: 5px 10px;
cursor: pointer;
}
div.searchbox input[type=submit]:focus {
border: 2px solid transparent;
border-bottom: 2px solid #009049;
background-color: #009049a0;
}
/* Index navigation */
div.nav {
margin-bottom: 0.25rem;
}
div.nav > a {
padding: 0.25rem 0.25rem;
}
div.nav a.useraccount {
color: orange;
text-decoration: underline;
}

View File

@ -22,23 +22,13 @@ $PAGE_TITLE = "Index"; // TODO
</head>
<body>
<div class="wrapper">
<div class="nibbabox notsearchbox">
<img src="test.png">
</div>
<?php
require_once("front/searchbox.php");
require_once("front/counter.php");
// TODO: different pages
require_once("front/pages/index/random_meme.php");
require_once("front/pages/index/searchbox.php");
require_once("front/pages/index/counter.php");
require_once("front/footer.php");
?>
<div class="nibbabox notsearchbox">
<p>
Serving 3,451,953 posts<br>
<a title="Takedown Information" href="./static/takedown">Takedown Policy and Process</a> |
<a title="Contact Us" href="./static/contact">Contact Us</a> |
<a title="Advertising with Us" href="./help/advertising">Advertising</a> |
<a title="Terms of Service" href="./static/terms_of_service">Terms of Service</a> |
<a title="Privacy Policy" href="./static/privacy">Privacy</a>
</p>
</div>
</div>
</body>
</html>