Skip to content

Commit

Permalink
Integrated PHP code further.
Browse files Browse the repository at this point in the history
Added URL GET and POST requests that validate the entered day and redirect to the respective profile.
Started with the CSS of the personality page.
  • Loading branch information
justwaitfor-me committed Mar 6, 2024
1 parent 4b15812 commit 0921fbe
Show file tree
Hide file tree
Showing 20 changed files with 12,440 additions and 126 deletions.
60 changes: 36 additions & 24 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
{
"files.exclude": {
".github": false,
".vscode": false,
"Backup": false,
"README.md": false,
"LICENSE": false,
"web/soon.personalitylib.com": false,
"web/dev.personalitylib.com": false,
"web/error.personalitylib.com": false,
"web/personalitylib.com/assets/css/template.css": false,
"web/personalitylib.com/assets/css/template.css.map": false,
"web/personalitylib.com/assets/css/style.css.map": false,
"web/personalitylib.com/assets/css/style.css": false,
"web/personalitylib.com/assets/css/login.css": false,
"web/personalitylib.com/assets/css/login.css.map": false,
"web/personalitylib.com/assets/css/legalnotice.css": false,
"web/personalitylib.com/assets/css/legalnotice.css.map": false,
"web/personalitylib.com/assets/css/licence.css": false,
"web/personalitylib.com/assets/css/licence.css.map": false,
"web/personalitylib.com/assets/css/account.css": false,
"web/personalitylib.com/assets/css/account.css.map": false,
"web/personalitylib.com/assets/css/about.css": false,
"web/personalitylib.com/assets/css/about.css.map": false,
"web\\personalitylib.com\\node_modules": false,
"web\\personalitylib.com\\vite.config.ts": false
".github": true,
".vscode": true,
"Backup": true,
"README.md": true,
"LICENSE": true,
"web/soon.personalitylib.com": true,
"web/dev.personalitylib.com": true,
"web/error.personalitylib.com": true,
"web/personalitylib.com/assets/css/template.css": true,
"web/personalitylib.com/assets/css/template.css.map": true,
"web/personalitylib.com/assets/css/style.css.map": true,
"web/personalitylib.com/assets/css/style.css": true,
"web/personalitylib.com/assets/css/login.css": true,
"web/personalitylib.com/assets/css/login.css.map": true,
"web/personalitylib.com/assets/css/legalnotice.css": true,
"web/personalitylib.com/assets/css/legalnotice.css.map": true,
"web/personalitylib.com/assets/css/licence.css": true,
"web/personalitylib.com/assets/css/licence.css.map": true,
"web/personalitylib.com/assets/css/account.css": true,
"web/personalitylib.com/assets/css/account.css.map": true,
"web/personalitylib.com/assets/css/about.css": true,
"web/personalitylib.com/assets/css/about.css.map": true,
"web\\personalitylib.com\\node_modules": true,
"web\\personalitylib.com\\vite.config.ts": true,
"web\\personalitylib.com\\public\\css\\template.css": true,
"web\\personalitylib.com\\public\\css\\template.css.map": true,
"web\\personalitylib.com\\public\\css\\style.css": true,
"web\\personalitylib.com\\public\\css\\style.css.map": true,
"web\\personalitylib.com\\public\\css\\licence.css": true,
"web\\personalitylib.com\\public\\css\\licence.css.map": true,
"web\\personalitylib.com\\public\\css\\legalnotice.css": true,
"web\\personalitylib.com\\public\\css\\legalnotice.css.map": true,
"web\\personalitylib.com\\public\\css\\about.css": true,
"web\\personalitylib.com\\public\\css\\about.css.map": true,
"web\\personalitylib.com\\public\\css\\personality.css.map": true,
"web\\personalitylib.com\\public\\css\\personality.css": true
},
"liveServer.settings.port": 5502,
"docwriter.style": "Auto-detect",
Expand Down
114 changes: 74 additions & 40 deletions web/personalitylib.com/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
// The code checks if a tag is provided via GET or POST methods. It validates the tag length and content, then redirects
to a URL with the tag if it meets the criteria. The tag prefix and style are adjusted based on validation results.
<?php
$prefix = "#";
$style = "";
if (isset($_GET['tag'])) {
$tag = $_GET["tag"];
}else{
if (!isset($_POST["tag"]) || empty($_POST["tag"])) {
$prefix = "#"; // Empty tag
$style = "";
} else if (!ctype_digit($_POST["tag"])) {
$prefix = "has to be just numbers"; // Not only digits
$style = "color:red;";
} else {
$length = strlen($_POST["tag"]);
if ($length < 6) {
$prefix = "too short"; // Less than 6 digits
$style = "color:red;";
} else if ($length > 6) {
$prefix = "too long"; // More than 6 digits
$style = "color:red;";
} else{
$style = "";
$url = "personality?tag=" . urlencode($_POST["tag"]);
header("Location: $url");
exit;
}
}
}
?>
<!DOCTYPE html>
<html lang="en">

Expand Down Expand Up @@ -54,52 +85,55 @@
<main>
<div class="input-div">
<nav class="navbar bg-body-tertiary">
<form class="container-fluid">
<form class="container-fluid" action="index.php" method="POST">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">#</span>
<input type="text" class="form-control" placeholder="PersoTag" aria-label="PeroTag"
aria-describedby="basic-addon1" />

<?php
echo '<label for="tag" class="input-group-text" id="basic-addon1" style="'.$style.'">'.$prefix.'</label>';
?>
<input type="text" id="tag" class="form-control" placeholder="PersoTag" aria-label="PersoTag"
name="tag" aria-describedby="basic-addon1" />

</div>
</form>
</nav>
</div>
<div class="submit-div">
<div class="button-submit-div">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal"
data-bs-target="#betaModal">
Search
</button>
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal"
data-bs-target="#betaModal">
Help
</button>
</div>
<!-- Modal -->
<div class="modal fade" id="betaModal" tabindex="-1" aria-labelledby="betaModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="betaModalLabel">
Open Beta
</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
This website is still under construction and is in an open
beta
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
Close
<div class="submit-div">
<div class="button-submit-div">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<input type="submit" value="Send" class="input-button btn btn-outline-primary"></input>
<button type="button" class="input-button btn btn-outline-primary"
data-bs-toggle="modal" data-bs-target="#betaModal">
Help
<!--TODO: Make Help Modal-->
</button>

</div>
<!-- Modal -->
<div class="modal fade" id="betaModal" tabindex="-1" aria-labelledby="betaModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="betaModalLabel">
Open Beta
</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
This website is still under construction and is in an open
beta
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</nav>
</div>
</main>
<footer>
Expand Down
107 changes: 107 additions & 0 deletions web/personalitylib.com/personality/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="PersoLib is an open-source project that allows individuals to share their personality data with others." />
<meta name="keywords"
content="personality, libary, exchange, explore, perso, dating, friends, personalitylib, personalitylib.com, justwait" />
<meta name="robots" content="index, follow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="English" />
<meta name="revisit-after" content="2 days" />
<meta name="author" content="JustWait" />
<!-- BOOTTSTRAP -->
<script src="../public/bootstrap/bootstrap.bundle.js"></script>
<!-- FAVICON -->
<link rel="shortcut icon" href="../public/favicon.ico" type="image/x-icon">
<title>USERNAME</title>
<meta name="title" content="USERNAME" />
<link rel="stylesheet" href="../public/css/personality.css" />
<!--Google Ads-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4168649657374641"
crossorigin="anonymous"></script>
</head>
<body>
<header class="z-1 hstack gap-2">
<h1 class="titel p-2"><a href="https://personalitylib.com/">PersonalityLib</a></h1>
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb p-2">
<li class="breadcrumb-item"><a href="../../index.html">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">USERNAME</li>
</ol>
</nav>
<div class="link-tree p-2 ms-auto">
<button type="button" class="btn btn-outline-primary home"
onclick="window.location.href='https://personalitylib.com/'">
Home
</button>
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal"
data-bs-target="#betaModal">
LogIn
</button>
<button type="button" class="btn btn-outline-primary create" data-bs-toggle="modal"
data-bs-target="#betaModal">
Create
</button>
<button type="button" class="btn btn-outline-primary" onclick="window.location.href='../about/'">
About
</button>
<!-- Modal -->
<div class="modal fade" id="betaModal" tabindex="-1" aria-labelledby="betaModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="betaModalLabel">Open Beta</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
This website is still under construction and is in an open beta
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<main class="z-0">
</main>
<footer class="z-1">
<span class="">
<p>Links:</p>
<span class="hstack gap-4 media-uvis">
<p class="p-2"><a href="../about/">About</a></p>
<p class="p-2"><a href="../legalnotice/">Legal Notice</a></p>
<p class="p-2"><a href="../licence/">Licence</a></p>
<p class="p-2"><a href="https://github.com/persolib/personalitylib.com">Github</a></p>
</span>
<span class="media-vis">
<span class="hstack gap-2">
<p class=""><a href="../about/">About</a></p>
<p class=""><a href="../legalnotice/">Legal Notice</a></p>
</span>
<span class="hstack gap-2">
<p class=""><a href="../licence/">Licence</a></p>
<p class=""><a href="https://github.com/persolib/personalitylib.com">Github</a></p>
</span>
</span>
</span>
<h1>by JustWait</h1>
<span class="footer-span">
<p>© 2024 PersonalityLib</p>
</span>
</footer>
</body>
</html>
18 changes: 17 additions & 1 deletion web/personalitylib.com/public/css/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
margin-left: $b;
}

@mixin input-button-groupe {
background-color: none;
border-color: $border-background;
color: $text-background;
width: 90px;
transition: 0.4s;

&:hover {
width: 110px;
border-color: $border;
color: $text;
background-color: $black;
border-style: dashed;
}
}

@mixin button-groupe {
background-color: none;
border-color: $border;
Expand All @@ -35,7 +51,7 @@
width: 110px;
border-color: $black;
color: $text-background;
background-color: white;
background-color: $white;
border-style: dashed;
}
}
Expand Down
2 changes: 2 additions & 0 deletions web/personalitylib.com/public/css/_var.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ $details: #4f5f76;
$border: whitesmoke;
$text: white;
$background: whitesmoke;

$text-background: black;
$border-background: black;

// scss-docs-start color-variables
$blue: #0d6efd !default;
Expand Down
2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/about.css
Original file line number Diff line number Diff line change
Expand Up @@ -12033,7 +12033,7 @@ header .link-tree button:hover {
width: 110px;
border-color: #000;
color: black;
background-color: white;
background-color: #fff;
border-style: dashed;
}
header .link-tree .active {
Expand Down
2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/about.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/legalnotice.css
Original file line number Diff line number Diff line change
Expand Up @@ -12033,7 +12033,7 @@ header .link-tree button:hover {
width: 110px;
border-color: #000;
color: black;
background-color: white;
background-color: #fff;
border-style: dashed;
}
header .link-tree .active {
Expand Down
2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/legalnotice.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/licence.css
Original file line number Diff line number Diff line change
Expand Up @@ -12033,7 +12033,7 @@ header .link-tree button:hover {
width: 110px;
border-color: #000;
color: black;
background-color: white;
background-color: #fff;
border-style: dashed;
}
header .link-tree .active {
Expand Down
2 changes: 1 addition & 1 deletion web/personalitylib.com/public/css/licence.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 0921fbe

Please sign in to comment.