Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {AddRecipe} from "./pages/recipe/AddRecipe"
import Join from "./pages/user/Join"
import Login from "./pages/user/Login"
import RecipeRecommend from "./pages/recipe/RecipeRecommend"
import RecipeRandom from "./pages/recipe/RecipeRandom"

function App() {
return (
Expand All @@ -22,6 +23,7 @@ function App() {
<Route path='create' element={<AddRecipe/>} />
<Route path='recommend/:userPk' element={<RecipeRecommend/>} />
<Route path=':recipePk' element={<RecipeDetail/>}/>
<Route path='random' element={<RecipeRandom/>}/>
</Route>
<Route path="join" element={<Join/>} />
<Route path="login" element={<Login/>} />
Expand Down
224 changes: 224 additions & 0 deletions src/assets/css/recipe/RecipeRandom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
.random-recipe-container {
min-height: 100vh;
padding: 2rem;
background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.page-title {
text-align: center;
color: #3FA2F6;
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 3rem;
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.draw-section {
max-width: 1000px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
min-height: 60vh;
}

.mystery-box {
position: relative;
width: 300px;
height: 300px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
}

.box-svg {
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.box-lid {
transform-origin: center;
transition: transform 0.5s ease;
}

.mystery-box.opening .box-lid {
animation: openLid 2.5s forwards;
}

.box-body {
transform-origin: bottom center;
}

.mystery-box.opening .box-body {
animation: shakeBox 0.5s ease infinite;
}

.draw-button {
margin-top: 2rem;
padding: 1rem 3rem;
font-size: 1.2rem;
background: linear-gradient(45deg, #3FA2F6, #96C9F4);
color: white;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(63, 162, 246, 0.3);
}

.draw-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(63, 162, 246, 0.4);
}

.draw-button:disabled {
opacity: 0.7;
cursor: not-allowed;
}

.recipe-reveal {
animation: fadeIn 0.5s ease-out;
}

.recipe-card {
background: white;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
overflow: hidden;
max-width: 1000px;
width: 90%;
margin: 0 auto;
}

.recipe-image-container {
height: 400px;
overflow: hidden;
}

.recipe-image {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}

.recipe-image:hover {
transform: scale(1.05);
}

.recipe-details {
padding: 2rem;
}

.recipe-title {
font-size: 1.8rem;
color: #333;
margin-bottom: 1rem;
}

.recipe-description {
color: #666;
line-height: 1.6;
margin-bottom: 1.5rem;
}

.ingredients-section {
background: #f8f9fa;
padding: 1.5rem;
border-radius: 12px;
margin-bottom: 1.5rem;
}

.ingredients-list {
display: flex;
flex-wrap: wrap;
gap: 0.8rem;
margin-top: 1rem;
}

.ingredient-tag {
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.9rem;
transition: all 0.3s ease;
}

.ingredient-tag.necessary {
background: #3FA2F6;
color: white;
}

.ingredient-tag.optional {
background: #96C9F4;
color: white;
opacity: 0.8;
}

.action-buttons {
display: flex;
gap: 1rem;
margin-top: 2rem;
}

.view-recipe, .draw-again {
flex: 1;
padding: 1rem;
border-radius: 10px;
font-weight: bold;
transition: all 0.3s ease;
}

.view-recipe {
background: #3FA2F6;
color: white;
border: none;
}

.draw-again {
background: white;
color: #3FA2F6;
border: 2px solid #3FA2F6;
}

@keyframes openLid {
0% { transform: rotateX(0deg); }
30% { transform: rotateX(-60deg) translateY(-20px); }
100% {
transform: rotateX(-90deg) translateY(-40px);
opacity: 0;
}
}

@keyframes shakeBox {
0% { transform: rotate(0deg); }
25% { transform: rotate(-5deg); }
75% { transform: rotate(5deg); }
100% { transform: rotate(0deg); }
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}

/* 반짝이 효과 */
.mystery-box::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: radial-gradient(circle, white 10%, transparent 60%);
opacity: 0;
pointer-events: none;
}

.mystery-box.opening::after {
animation: shine 2s ease-out forwards;
}

@keyframes shine {
0% { opacity: 0; transform: scale(0.5); }
50% { opacity: 0.5; transform: scale(1.2); }
100% { opacity: 0; transform: scale(2); }
}
Loading