add feature for users to create and store recipes

This commit is contained in:
2025-08-10 13:52:45 +01:00
parent a53c50b8b4
commit 1d2fa1bf02
7 changed files with 779 additions and 9 deletions

View File

@@ -0,0 +1,325 @@
.create-recipe-container {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: #f8f9fa;
min-height: 100vh;
}
.create-recipe-header {
text-align: center;
margin-bottom: 2rem;
}
.create-recipe-header h1 {
color: #2c3e50;
font-size: 2.5rem;
margin-bottom: 0.5rem;
font-weight: 700;
}
.create-recipe-header p {
color: #6c757d;
font-size: 1.1rem;
margin: 0;
}
.create-recipe-form {
background: white;
border-radius: 12px;
padding: 2rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.form-section {
margin-bottom: 2.5rem;
}
.form-section h2 {
color: #2c3e50;
font-size: 1.5rem;
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid #e9ecef;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
color: #495057;
font-weight: 600;
font-size: 0.9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 0.75rem;
border: 2px solid #e9ecef;
border-radius: 8px;
font-size: 1rem;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
background: white;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
outline: none;
border-color: #FF6B35;
box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}
.form-group textarea {
resize: vertical;
min-height: 80px;
}
.form-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
/* Ingredients Section */
.ingredient-row {
display: grid;
grid-template-columns: 2fr 1fr 1fr auto;
gap: 0.75rem;
align-items: end;
margin-bottom: 1rem;
padding: 1rem;
background: #f8f9fa;
border-radius: 8px;
border: 1px solid #e9ecef;
}
.ingredient-row .form-group {
margin-bottom: 0;
}
.ingredient-row input {
margin-bottom: 0;
}
/* Instructions Section */
.instruction-row {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 1rem;
align-items: start;
margin-bottom: 1rem;
padding: 1rem;
background: #f8f9fa;
border-radius: 8px;
border: 1px solid #e9ecef;
}
.step-number {
background: #FF6B35;
color: white;
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 0.9rem;
flex-shrink: 0;
margin-top: 0.75rem;
}
.instruction-row .form-group {
margin-bottom: 0;
}
.instruction-row textarea {
margin-bottom: 0;
}
/* Buttons */
.add-btn {
background: #28a745;
color: white;
border: none;
padding: 0.75rem 1.5rem;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.add-btn:hover {
background: #218838;
transform: translateY(-1px);
}
.remove-btn {
background: #dc3545;
color: white;
border: none;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 1.2rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.remove-btn:hover:not(:disabled) {
background: #c82333;
transform: scale(1.1);
}
.remove-btn:disabled {
background: #6c757d;
cursor: not-allowed;
opacity: 0.5;
}
/* Form Actions */
.form-actions {
display: flex;
gap: 1rem;
justify-content: flex-end;
margin-top: 2rem;
padding-top: 2rem;
border-top: 2px solid #e9ecef;
}
.cancel-btn {
background: #6c757d;
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.cancel-btn:hover:not(:disabled) {
background: #5a6268;
transform: translateY(-1px);
}
.submit-btn {
background: #FF6B35;
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.submit-btn:hover:not(:disabled) {
background: #e55a2b;
transform: translateY(-1px);
}
.submit-btn:disabled,
.cancel-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
/* Messages */
.error-message {
background: #f8d7da;
color: #721c24;
padding: 1rem;
border-radius: 8px;
border: 1px solid #f5c6cb;
margin-bottom: 1.5rem;
font-weight: 500;
}
.success-message {
background: #d4edda;
color: #155724;
padding: 1rem;
border-radius: 8px;
border: 1px solid #c3e6cb;
margin-bottom: 1.5rem;
font-weight: 500;
}
/* Responsive Design */
@media (max-width: 768px) {
.create-recipe-container {
padding: 1rem;
}
.create-recipe-form {
padding: 1.5rem;
}
.create-recipe-header h1 {
font-size: 2rem;
}
.form-row {
grid-template-columns: 1fr;
}
.ingredient-row {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.instruction-row {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.step-number {
align-self: start;
margin-top: 0;
}
.form-actions {
flex-direction: column;
}
.form-actions button {
width: 100%;
}
}
@media (max-width: 480px) {
.create-recipe-container {
padding: 0.5rem;
}
.create-recipe-form {
padding: 1rem;
}
.create-recipe-header h1 {
font-size: 1.75rem;
}
.form-section h2 {
font-size: 1.25rem;
}
}