explore page in progress

This commit is contained in:
kaipher7
2026-04-16 11:20:57 -06:00
parent dc8c2a2de4
commit ac87b86787
4 changed files with 431 additions and 13 deletions
@@ -0,0 +1,334 @@
/* =========================
Root Variables
========================= */
:root {
--dusty-red: #D43F3F;
--dusty-red-hover: #C73636;
--dark-yellow: #FFD27F;
--pale-yellow: #FFECB3;
--peach: #F5A96E;
--dark: #850000;
}
/* =========================
Global Styles
========================= */
.delius {
font-family: 'Delius Swash Caps', cursive;
font-weight: 400;
font-style: normal;
}
.mali-regular {
font-family: 'Mali', cursive;
font-weight: 400;
font-style: normal;
}
body, html {
height: 100vh;
margin: 0;
font-family: 'Mali', cursive;
background-color: var(--pale-yellow);
overflow: clip;
}
/* =========================
Layout Structure
========================= */
.body {
display: flex;
flex-direction: row;
height: 100%;
}
.body-left, .body-right {
position: sticky;
flex-grow: 0;
width: 400px;
}
/* =========================
Header Styles
========================= */
.top-header {
display: flex;
align-items: center;
justify-content: center;
gap: 40px;
height: 60px;
padding: 10px 20px;
background-color: var(--dusty-red);
color: var(--dark-yellow);
}
.top-header .swirl {
height: 40px;
width: auto;
margin: 0 20px;
}
.site-name {
font-family: 'Delius Swash Caps', serif;
font-size: 2.5em;
font-weight: bold;
letter-spacing: 4px;
color: var(--dark-yellow);
}
/* =========================
Left Sidebar
========================= */
.sidebar-left {
overflow: hidden;
margin: 25px;
border-radius: 20px;
z-index: 10;
background-color: var(--peach);
color: var(--dark);
padding: 6px;
font-size: 1.75em;
font-weight: 900;
letter-spacing: 1.5px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.sidebar-left ul {
list-style: none;
padding: 0;
}
.sidebar-left li {
margin-bottom: 7px;
}
.sidebar-left a {
color: var(--dark);
text-decoration: none;
transition: 0.1s ease;
}
.sidebar-left a:hover {
color: var(--dusty-red);
}
.sidebar-left .nav_icon {
background: none;
border: none;
padding: 0;
cursor: pointer;
height: 100px;
width: auto;
border-radius: 8px;
transition: transform 0.2s ease;
}
.sidebar-left .nav_icon:hover {
transform: scale(1.05);
}
/* =========================
Floating Create Icon
========================= */
.create_icon {
position: fixed;
bottom: 30px;
left: 55px;
z-index: 1000;
transition: transform 0.2s ease;
}
.create_icon:hover {
transform: scale(1.02);
}
.create_icon img {
width: 150px;
height: auto;
border-radius: 10%;
}
/* =========================
Right Sidebar
========================= */
.sidebar-right {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
margin: 25px;
padding: 5px;
height: 75%;
border-radius: 20px;
z-index: 10;
background-color: var(--peach);
color: var(--dusty-red);
font-size: 1.3em;
font-weight: 900;
letter-spacing: 1.3px;
}
.sidebar-right ul {
list-style: none;
padding: 0;
}
.sidebar-right li {
margin-bottom: 5px;
}
.sidebar-right a {
color: var(--dusty-red);
text-decoration: none;
}
/* =========================
Main Content Area
========================= */
.main-content {
width: 100%;
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
overflow: scroll;
height: 100%;
}
/* =========================
Search Bar
========================= */
.search-bar, input[type="search"] {
width: 90%;
margin: 10px;
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: stretch;
color: var(--dark-yellow);
border: none;
border-radius: 10px;
padding: 0 10px;
height: 50px;
font-size: 20px;
font-family: 'Mali', cursive;
font-weight: 600;
justify-content: flex-start;
}
.search-btn {
display: flex;
flex-direction: row;
gap: 6px;
}
input[type="search"] {
background: var(--dusty-red);
}
input[type="search"]::placeholder {
color: var(--dark-yellow);
}
.search-bar:focus {
outline: none;
}
.search-bar button[type="submit"] {
background: var(--dusty-red);
color: var(--dark-yellow);
font-size: 1.3em;
border: none;
border-radius: 10px;
padding: 0 10px;
height: 50px;
width: 50px;
margin: 10px;
}
.search-bar label { display: none; }
/* =========================
Recipe Cards Layout
========================= */
.recipe-card {
margin-top: 35px;
width: 100%;
display: flex;
flex-wrap: wrap;
gap: 35px;
justify-content: flex-start;
flex-direction: row;
height: fit-content;
}
a {
text-decoration: none;
color: var(--dark);
}
/* =========================
Individual Card (Folder Style)
========================= */
.card {
position: relative; /* needed for tab */
display: flex;
align-items: center;
gap: 10px;
flex: 1 1 260px;
max-width: 400px;
max-height: 200px;
padding: 25px 20px 20px; /* extra space for tab */
border-radius: 12px;
background: var(--peach);
}
/* Folder Tab */
.card::before {
content: "";
position: absolute;
top: -16px;
left: 0px;
width: 100px;
height: 28px;
background: var(--peach);
border-radius: 6px 6px 0 0;
}
/* =========================
Card Content
========================= */
.card .card-text {
height: 100%;
overflow: hidden; /* the scroll bars were difficult to look at, the user can just view the recipe*/
color: var(--dark);
transition: 0.1s ease;
}
.card .card-text:hover{
color: var(--dusty-red-hover);
}
/* =========================
Card Image
========================= */
.card img {
width: 100%;
height: 100px;
object-fit: cover;
border-radius: 8px;
}
/* =========================
Card Columns
========================= */
.card-left,
.card-right {
flex-shrink: 0;
width: 50%;
}
+17 -8
View File
@@ -70,7 +70,7 @@ body, html {
.site-name { .site-name {
font-family: 'Delius Swash Caps', serif; font-family: 'Delius Swash Caps', serif;
font-size: 2.5em; font-size: clamp(1.1em, 5vw, 2.5em);
font-weight: bold; font-weight: bold;
letter-spacing: 4px; letter-spacing: 4px;
color: var(--dark-yellow); color: var(--dark-yellow);
@@ -112,7 +112,7 @@ body, html {
} }
.sidebar-left a:hover { .sidebar-left a:hover {
color: var(--dusty-red); color: var(--dusty-red-hover);
} }
.sidebar-left .nav_icon { .sidebar-left .nav_icon {
@@ -212,6 +212,11 @@ body, html {
height: fit-content; height: fit-content;
} }
a {
text-decoration: none;
color: var(--dark);
}
/* ========================= /* =========================
Individual Card (Folder Style) Individual Card (Folder Style)
========================= */ ========================= */
@@ -232,10 +237,10 @@ body, html {
.card::before { .card::before {
content: ""; content: "";
position: absolute; position: absolute;
top: -15px; top: -16px;
left: 20px; left: 0px;
width: 100px; width: 100px;
height: 20px; height: 28px;
background: var(--peach); background: var(--peach);
border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0;
} }
@@ -245,9 +250,13 @@ body, html {
========================= */ ========================= */
.card .card-text { .card .card-text {
height: 100%; height: 100%;
overflow: scroll; overflow: hidden; /* the scroll bars were difficult to look at, the user can just view the recipe*/
font-family: 'Roboto', sans-serif; color: var(--dark);
color: var(--dark); transition: 0.1s ease;
}
.card .card-text:hover{
color: var(--dusty-red-hover);
} }
/* ========================= /* =========================
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Thyme Crunch Home</title>
<link rel="stylesheet" th:href="@{css/explore.css}">
<link href="https://fonts.googleapis.com/css2?family=Delius+Swash+Caps&family=Mali:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
</head>
<body>
<header class="top-header">
<img th:src="@{images/header_left.png}" alt="Violin f-hole shape to the left of header." class="swirl">
<h1 class="site-name">Thyme Crunch</h1>
<img th:src="@{images/header_right.png}" alt="Violin f-hole shape to the right of header." class="swirl">
</header>
<div class="body">
<!--Navigation Bar -->
<div class="body-left">
<nav class="sidebar-left">
<ul>
<li><a href="/">Home</a></li>
<li><a href="#">Explore</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Saved</a></li>
<li>
<form th:action="@{/logout}" method="post">
<input type="image" th:src="@{images/logout_icon.png}" alt="Logout button" class="nav_icon"/>
</form>
</li>
</ul>
</nav>
<a th:href="@{/create}" target="_blank" class="create_icon">
<img th:src="@{images/create_icon.png}" alt="Create New Recipe Icon (Red mixing bowl with a spoon and yellow addition symbol.">
</a>
</div>
<!-- Main Content -->
<main class="main-content">
<div class="search-bar">
<form action="/search" method="get">
<label for="site-search">Search:</label>
<div class="search-btn">
<input type="search" id="site-search" name="q" placeholder="Search for recipes...">
<button type="submit"><i class="fa fa-search"></i></button>
</div>
</form>
</div>
<div class="recipe-card">
<a th:href="@{/recipes/{id}(id=${recipe.id})}" class="card" th:each="recipe : ${recipes}">
<div class="card-text">
<h2 th:text="${recipe.title}"></h2>
<p th:text="${recipe.description}"></p>
</div>
<div class="card-right">
<div th:each="img : ${recipe.images}">
<img th:src="${img.imageUrl}" alt="Recipe Image"/>
</div>
</div>
</a>
</div>
</main>
<!--Filter -->
<div class="body-right">
<div class="sidebar-right">
<h1> FILTER </h1>
</div>
</div>
</div>
</body>
</html>
+5 -5
View File
@@ -19,8 +19,8 @@
<div class="body-left"> <div class="body-left">
<nav class="sidebar-left"> <nav class="sidebar-left">
<ul> <ul>
<li><a href="#">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="#">Explore</a></li> <li><a th:href="@{/explore}">Explore</a></li>
<li><a href="#">Profile</a></li> <li><a href="#">Profile</a></li>
<li><a href="#">Saved</a></li> <li><a href="#">Saved</a></li>
<li> <li>
@@ -31,7 +31,7 @@
</ul> </ul>
</nav> </nav>
<a th:href="@{/create}" target="_blank" class="create_icon"> <a th:href="@{/create}" target="_blank" class="create_icon">
<img th:src="@{images/create_icon.png}" alt="Description of the icon"> <img th:src="@{images/create_icon.png}" alt="Create New Recipe Icon (Red mixing bowl with a spoon and yellow addition symbol.">
</a> </a>
</div> </div>
@@ -40,7 +40,7 @@
<main class="main-content"> <main class="main-content">
<div class="recipe-card"> <div class="recipe-card">
<div class="card" th:each="recipe : ${recipes}"> <a th:href="@{/recipes/{id}(id=${recipe.id})}" class="card" th:each="recipe : ${recipes}">
<div class="card-text"> <div class="card-text">
<h2 th:text="${recipe.title}"></h2> <h2 th:text="${recipe.title}"></h2>
<p th:text="${recipe.description}"></p> <p th:text="${recipe.description}"></p>
@@ -50,7 +50,7 @@
<img th:src="${img.imageUrl}" alt="Recipe Image"/> <img th:src="${img.imageUrl}" alt="Recipe Image"/>
</div> </div>
</div> </div>
</div> </a>
</div> </div>
</main> </main>