view recipe display

This commit is contained in:
kaipher7
2026-04-22 02:31:29 -06:00
parent 2499ea086d
commit 725244a6d7
3 changed files with 282 additions and 181 deletions
+208 -96
View File
@@ -31,7 +31,7 @@ body, html {
font-family: 'Mali', cursive;
background-color: var(--pale-yellow);
overflow-x: hidden;
overflow-y: auto;
overflow-y: hidden;
}
/* =========================
@@ -43,10 +43,11 @@ body, html {
height: 100%;
}
.body-left, .body-right {
.body-left {
position: sticky;
flex-grow: 0;
width: 400px;
flex-shrink: 0;
width: 250px;
}
/* =========================
@@ -88,7 +89,7 @@ body, html {
background-color: var(--peach);
color: var(--dark);
padding: 6px;
font-size: 1.75em;
font-size: 1.8em;
font-weight: 900;
letter-spacing: 1.5px;
display: flex;
@@ -121,7 +122,7 @@ body, html {
border: none;
padding: 0;
cursor: pointer;
height: 100px;
height: 85px;
width: auto;
border-radius: 8px;
transition: transform 0.2s ease;
@@ -131,6 +132,8 @@ body, html {
transform: scale(1.05);
}
/* =========================
Floating Create Icon
========================= */
@@ -142,6 +145,28 @@ body, html {
transition: transform 0.2s ease;
}
.create_icon::after {
content: "Create a recipe";
display: none;
position: absolute;
left: 50%;
bottom: 100%;
transform: translateX(-50%);
background: var(--dark-yellow);
color: var(--dusty-red);
font-family: 'Mali', cursive;
font-size: 0.85em;
font-weight: 600;
white-space: nowrap;
padding: 4px 10px;
border-radius: 10px;
}
.create_icon:hover::after {
display: block;
}
.create_icon:hover {
transform: scale(1.02);
}
@@ -152,40 +177,6 @@ body, html {
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.6em;
font-weight: 900;
letter-spacing: 1.5px;
}
.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
========================= */
@@ -195,82 +186,203 @@ body, html {
display: flex;
justify-content: center;
align-items: flex-start;
overflow: scroll;
height: 100%;
overflow-y: auto;
scrollbar-color: var(--dusty-red) transparent;
}
/* =========================
Recipe Cards Layout
Recipe Container
========================= */
.recipe-card {
margin-top: 35px;
.recipe-container {
width: 100%;
max-width: 1100px;
margin: 35px auto;
display: flex;
flex-wrap: wrap;
gap: 35px;
justify-content: flex-start;
flex-direction: row;
height: fit-content;
flex-direction: column;
justify-content: center;
}
a {
text-decoration: none;
.recipe-section {
border-radius: 20px;
padding: 18px 24px;
color: var(--dark);
display: flex;
flex-direction: row;
gap: 28px;
margin-bottom: 30px;
font-size: 1.05em;
}
.recipe-section h1 {
margin-top: 0;
font-size: 2.8em;
}
.recipe-section h2 {
margin-top: 0;
}
.left-view, .right-view {
flex: 1;
max-width: 500px;
}
/* Author */
.recipe-author {
font-size: 1.4em;
margin-bottom: 20px;
color: var(--dusty-red);
}
.recipe-author a{
font-size: 1.1em;
font-weight: 600;
color: var(--dusty-red);
transition: background-color 0.1s ease;
}
.recipe-author a:hover{
color: var(--dusty-red-hover);
}
/* Image */
.recipe-image-wrap {
margin-bottom: 36px;
}
.recipe-image-wrap img {
display: block;
width: 100%;
max-width: 700px;
max-height: 420px;
object-fit: cover;
border-radius: 16px;
margin: 0 auto;
}
.recipe-no-image {
margin-bottom: 28px;
font-style: italic;
}
/* Description */
.recipe-description {
margin-bottom: 25px;
font-weight: 500;
}
/* Meta row — prep, cook, servings, cost */
.recipe-meta {
display: flex;
flex-direction: column;
gap: 20px;
margin-bottom: 30px;
font-size: 1.4em;
}
.recipe-meta p {
margin: 0;
color: var(--dusty-red);
font-weight: 500;
}
.recipe-meta strong {
margin: 0;
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 */
/* Ingredients */
.recipe-ingredients {
margin-bottom: 30px;
background: var(--dark-yellow);
border-radius: 12px;
background: var(--peach);
padding: 16px;
}
/* Folder Tab */
.card::before {
content: "";
position: absolute;
top: -16px;
left: 0px;
width: 100px;
height: 28px;
background: var(--peach);
border-radius: 6px 6px 0 0;
.recipe-ingredients ul {
line-height: 1.8;
}
/* =========================
Card Content
========================= */
.card .card-text {
height: 100%;
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);
/* Steps */
.recipe-steps {
font-weight: 500;
margin-bottom: 30px;
}
/* =========================
Card Image
========================= */
.card img {
.recipe-steps ol {
line-height: 1.9;
}
/* Tags */
.recipe-tags {
margin-bottom: 25px;
background: var(--dark-yellow);
border-radius: 12px;
padding: 16px;
color: var(--dusty-red);
}
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.tag-list span {
background: var(--pale-yellow);
padding: 8px 14px;
border-radius: 999px;
font-weight: 700;
}
/* Bottom links */
.recipe-links {
display: flex;
gap: 20px;
flex-wrap: wrap;
margin-top: 25px;
}
.recipe-links a {
color: var(--dusty-red);
}
.save-btn {
background: var(--dusty-red);
color: var(--dark-yellow);
border: none;
border-radius: 10px;
padding: 8px 18px;
margin-bottom: 60px;
font-family: 'Mali', cursive;
font-size: 1.4em;
width: 40%;
font-weight: 700;
cursor: pointer;
transition: background 0.1s ease;
align-self: center;
}
.save-btn:hover {
background: var(--dusty-red-hover);
}
.save-btn.saved {
background: var(--dark);
color: var(--pale-yellow);
}
/* Not found */
.recipe-not-found {
width: 100%;
height: 100px;
object-fit: cover;
border-radius: 8px;
max-width: 950px;
margin: 35px auto;
}
/* =========================
Card Columns
========================= */
.card-left,
.card-right {
flex-shrink: 0;
width: 50%;
}
.recipe-not-found section {
background: var(--peach);
border-radius: 20px;
padding: 28px 32px;
color: var(--dark);
}