Skip to content

Commit

Permalink
added themes
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanGhalib committed Dec 14, 2024
1 parent cce70c4 commit 61a9e84
Show file tree
Hide file tree
Showing 9 changed files with 467 additions and 4 deletions.
7 changes: 7 additions & 0 deletions changetheme.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
if(isset($_GET['theme'])){
$theme = $_GET['theme'];
session_start();
$_SESSION['theme'] = $theme;
header("location: settings.php");
}
12 changes: 10 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head><?php
session_start();
if (isset($_SESSION['theme'])) {
$theme = $_SESSION['theme'];
} else {
$theme = 1;
}

?>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/quill.snow.css" rel="stylesheet" />

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="styles/<?php echo $theme ?>.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<label for="name">Title:</label>
<input required type="text" name="title" id="title" class="form-control" maxlength="12" placeholder="Some Person">
<br>

<p>Try the new <a href="changetheme.php?theme=3"><u>GruvBox Dark</u></a> and <a href="changetheme.php?theme=2"><u>GruvBox Light</u></a> theme </p>
<div id="editor" name="note" style="height: 200px">
<h3>Anything you type will be engraved in the code of this site, forever!</h3>
<h4>Confess your crush, share your thoughts or do whatever you want!</h4>
Expand Down
34 changes: 34 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php include 'header.php';
include 'db.php';


?>
<body >
<div class="container-fluid">
<div class="row mt-5">
<?php include 'sidebar.php' ?>
<div class="col-lg-9">
<div class="notepadbox">
<h1>Change Theme</h1>
<br>
Current Theme: <strong>Classic</strong>
<br><br>
<h5>Choose a theme and click Save</h5>
<p>Thanks for the advice, RandomGuy!</p>
<form action="changetheme.php" method="GET">
<select name="theme" id="theme" class="form-control">
<option value="1" <?php if ($theme == 1) echo 'selected'; ?>>Classic</option>
<option value="2" <?php if ($theme == 2) echo 'selected'; ?>>GruvBox Light</option>
<option value="3" <?php if ($theme == 3) echo 'selected'; ?>>GruvBox Dark</option>
</select>
<br>
<input type="hidden" name="submit">
<button class="submitbutton" type="submit">Save</button>
</div>

</div>
</div>
</div>


</html>
10 changes: 9 additions & 1 deletion sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="col">
<div class="listnotes overflow-auto " style="height: 400px; overflow-x: hidden !important;">
<?php
$query = "SELECT * FROM notes ORDER BY views DESC limit 150";
$query = "SELECT * FROM notes ORDER BY views DESC";
$result = mysqli_query($conn, $query);

while ($row = mysqli_fetch_assoc($result)) {
Expand Down Expand Up @@ -48,5 +48,13 @@
</div>
</div>
</div>

<div class=" row sticky-bottom mt-2 justify-content-center align-items-center text-align-center">
<div class="col text-align-center dropdown">
<a class="settingsbutton text-align-center " href="settings.php" >
<i class="bi bi-gear-fill"></i> Appearance (NEW!)
</a>
</div>
</div>
</div>
</div>
11 changes: 11 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,15 @@ body{
body a{
text-decoration: none;
color: black;
}
.settingsbutton{
background-color: #e6c046;
border: 0px;
padding: 5px;
font-size: 25px;
width: 100%;
border-radius: 20px;
transition: 0.2s;
text-align: center;
cursor: pointer;
}
128 changes: 128 additions & 0 deletions styles/1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* Custom scrollbar styles */
::-webkit-scrollbar {
width: 10px;
}

::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}

::-webkit-scrollbar-thumb {
background: #e6c046;
border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
background: #b4b650;
}
body{
background-color: #f3f56f !important;
font-family: 'Poppins', sans-serif !important;
}
.sidebar{
background-color: white;
border-radius: 50px;
height: 90vh;
padding: 25px;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.336);

}
.notepadbox{
height: 90vh;
background-color: white;
border-radius: 50px;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.336);
padding: 50px;
}
.logo-text{
background-color: #e6c046;
height: 50px;
border-radius: 20px;
font-family: 'Poppins', sans-serif;
font-size: 25px;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
}
.submitbutton{
background-color: rgb(230, 192, 70);
border: 0px;;
padding: 5px;
font-size: 25px;
width: 100%;
border-radius: 20px;
font-weight: bold;
transition: 0.2s;
}
.submitbutton:hover{
background-color: rgb(0, 0, 0);
color: white;
transition: 0.2s;
transform: scale(1.05);
}
.searchbox{
background-color: rgba(227, 236, 255, 0.555);
padding: 10px;
font-size: 20px;
border-radius: 20px;
}
.searchbox input{
border: 0px;
background-color: transparent;
font-size: 20px;
width: 70%;
margin-left: 5px;
}
.searchbox input:focus{
outline: none;
}
.note{
background-color: rgba(227, 236, 255, 0.555);
padding: 10px;
margin-top: 4px;
border-radius: 20px;
display: flex;
align-items: center;
font-size: 20px;
cursor: pointer;
}
.note:hover{
background-color: rgba(227, 236, 255, 0.755);
}
.addnewbutton{
padding: 20px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
background-color: #e6c046;
border-radius: 20px;


}
.addnewbutton a{
text-decoration: none;
color: rgb(49, 48, 48);
}
.addnewbutton:hover{
background-color: #000000;
color: white !important;
}
body a{
text-decoration: none;
color: black;
}
.settingsbutton{
background-color: #e6c046;
border: 0px;
padding: 5px;
font-size: 25px;
width: 100%;
border-radius: 20px;
transition: 0.2s;
text-align: center;
cursor: pointer;
}
130 changes: 130 additions & 0 deletions styles/2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/* Custom scrollbar styles */
::-webkit-scrollbar {
width: 10px;
}

::-webkit-scrollbar-track {
background: #D5C4A3;
border-radius: 10px;
}

::-webkit-scrollbar-thumb {
background: #D5C4A3;
border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
background: #b4b650;
}
body{
background-color: #EBDAB4 !important;
font-family: 'Poppins', sans-serif !important;
color: #3C3836 !important;
}
.sidebar{
background-color: #FBF0C9;
border-radius: 50px;
height: 90vh;
padding: 25px;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.336);

}
.notepadbox{
height: 90vh;
background-color: #FBF0C9;
border-radius: 50px;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.336);
padding: 50px;
}

.logo-text{
background-color: #D5C4A3;
height: 50px;
border-radius: 20px;
font-family: 'Poppins', sans-serif;
font-size: 25px;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
}
.submitbutton{
background-color: #D5C4A3;
border: 0px;;
padding: 5px;
font-size: 25px;
width: 100%;
border-radius: 20px;
font-weight: bold;
transition: 0.2s;
}
.submitbutton:hover{
background-color: rgb(0, 0, 0);
color: white;
transition: 0.2s;
transform: scale(1.05);
}
.searchbox{
background-color: #D5C4A3;
padding: 10px;
font-size: 20px;
border-radius: 20px;
}
.searchbox input{
border: 0px;
background-color: transparent;
font-size: 20px;
width: 70%;
margin-left: 5px;
}
.searchbox input:focus{
outline: none;
}
.note{
background-color: #EBDAB4;
padding: 10px;
margin-top: 4px;
border-radius: 20px;
display: flex;
align-items: center;
font-size: 20px;
cursor: pointer;
}
.note:hover{
background-color: rgba(227, 236, 255, 0.755);
}
.addnewbutton{
padding: 20px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
background-color: #D5C4A3;
border-radius: 20px;


}
.addnewbutton a{
text-decoration: none;
color: rgb(49, 48, 48);
}
.addnewbutton:hover{
background-color: #000000;
color: white !important;
}
body a{
text-decoration: none;
color: black;
}
.settingsbutton{
background-color: #D5C4A3;
border: 0px;
padding: 5px;
font-size: 25px;
width: 100%;
border-radius: 20px;
transition: 0.2s;
text-align: center;
cursor: pointer;
}
Loading

0 comments on commit 61a9e84

Please sign in to comment.