[PIE-8] Add recipe detail view #6
28
api/pb_migrations/1755039357_updated_steps.js
Normal file
28
api/pb_migrations/1755039357_updated_steps.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_4284789913")
|
||||||
|
|
||||||
|
// remove field
|
||||||
|
collection.fields.removeById("relation3666391351")
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_4284789913")
|
||||||
|
|
||||||
|
// add field
|
||||||
|
collection.fields.addAt(3, new Field({
|
||||||
|
"cascadeDelete": false,
|
||||||
|
"collectionId": "pbc_842702175",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "relation3666391351",
|
||||||
|
"maxSelect": 1,
|
||||||
|
"minSelect": 0,
|
||||||
|
"name": "recipe",
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "relation"
|
||||||
|
}))
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
})
|
97
api/pb_migrations/1755041844_created_ingredients.js
Normal file
97
api/pb_migrations/1755041844_created_ingredients.js
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = new Collection({
|
||||||
|
"createRule": null,
|
||||||
|
"deleteRule": null,
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"autogeneratePattern": "[a-z0-9]{15}",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "text3208210256",
|
||||||
|
"max": 15,
|
||||||
|
"min": 15,
|
||||||
|
"name": "id",
|
||||||
|
"pattern": "^[a-z0-9]+$",
|
||||||
|
"presentable": false,
|
||||||
|
"primaryKey": true,
|
||||||
|
"required": true,
|
||||||
|
"system": true,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"autogeneratePattern": "",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "text1579384326",
|
||||||
|
"max": 0,
|
||||||
|
"min": 0,
|
||||||
|
"name": "name",
|
||||||
|
"pattern": "",
|
||||||
|
"presentable": false,
|
||||||
|
"primaryKey": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "number2683508278",
|
||||||
|
"max": null,
|
||||||
|
"min": null,
|
||||||
|
"name": "quantity",
|
||||||
|
"onlyInt": false,
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"autogeneratePattern": "",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "text3703245907",
|
||||||
|
"max": 0,
|
||||||
|
"min": 0,
|
||||||
|
"name": "unit",
|
||||||
|
"pattern": "",
|
||||||
|
"presentable": false,
|
||||||
|
"primaryKey": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "autodate2990389176",
|
||||||
|
"name": "created",
|
||||||
|
"onCreate": true,
|
||||||
|
"onUpdate": false,
|
||||||
|
"presentable": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "autodate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "autodate3332085495",
|
||||||
|
"name": "updated",
|
||||||
|
"onCreate": true,
|
||||||
|
"onUpdate": true,
|
||||||
|
"presentable": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "autodate"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "pbc_3146854971",
|
||||||
|
"indexes": [],
|
||||||
|
"listRule": null,
|
||||||
|
"name": "ingredients",
|
||||||
|
"system": false,
|
||||||
|
"type": "base",
|
||||||
|
"updateRule": null,
|
||||||
|
"viewRule": null
|
||||||
|
});
|
||||||
|
|
||||||
|
return app.save(collection);
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_3146854971");
|
||||||
|
|
||||||
|
return app.delete(collection);
|
||||||
|
})
|
28
api/pb_migrations/1755041886_updated_recipes.js
Normal file
28
api/pb_migrations/1755041886_updated_recipes.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_842702175")
|
||||||
|
|
||||||
|
// add field
|
||||||
|
collection.fields.addAt(8, new Field({
|
||||||
|
"cascadeDelete": false,
|
||||||
|
"collectionId": "pbc_3146854971",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "relation1264587087",
|
||||||
|
"maxSelect": 999,
|
||||||
|
"minSelect": 0,
|
||||||
|
"name": "ingredients",
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "relation"
|
||||||
|
}))
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_842702175")
|
||||||
|
|
||||||
|
// remove field
|
||||||
|
collection.fields.removeById("relation1264587087")
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
})
|
28
api/pb_migrations/1755042306_updated_ingredients.js
Normal file
28
api/pb_migrations/1755042306_updated_ingredients.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_3146854971")
|
||||||
|
|
||||||
|
// update collection data
|
||||||
|
unmarshal({
|
||||||
|
"createRule": "",
|
||||||
|
"deleteRule": "",
|
||||||
|
"listRule": "",
|
||||||
|
"updateRule": "",
|
||||||
|
"viewRule": ""
|
||||||
|
}, collection)
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_3146854971")
|
||||||
|
|
||||||
|
// update collection data
|
||||||
|
unmarshal({
|
||||||
|
"createRule": null,
|
||||||
|
"deleteRule": null,
|
||||||
|
"listRule": null,
|
||||||
|
"updateRule": null,
|
||||||
|
"viewRule": null
|
||||||
|
}, collection)
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
})
|
28
api/pb_migrations/1755045585_updated_steps.js
Normal file
28
api/pb_migrations/1755045585_updated_steps.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_4284789913")
|
||||||
|
|
||||||
|
// add field
|
||||||
|
collection.fields.addAt(3, new Field({
|
||||||
|
"cascadeDelete": false,
|
||||||
|
"collectionId": "pbc_3146854971",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "relation1264587087",
|
||||||
|
"maxSelect": 999,
|
||||||
|
"minSelect": 0,
|
||||||
|
"name": "ingredients",
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "relation"
|
||||||
|
}))
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_4284789913")
|
||||||
|
|
||||||
|
// remove field
|
||||||
|
collection.fields.removeById("relation1264587087")
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
})
|
44
api/pb_migrations/1755056714_updated_recipes.js
Normal file
44
api/pb_migrations/1755056714_updated_recipes.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
migrate((app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_842702175")
|
||||||
|
|
||||||
|
// add field
|
||||||
|
collection.fields.addAt(9, new Field({
|
||||||
|
"hidden": false,
|
||||||
|
"id": "number1485952547",
|
||||||
|
"max": null,
|
||||||
|
"min": null,
|
||||||
|
"name": "worktime",
|
||||||
|
"onlyInt": true,
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "number"
|
||||||
|
}))
|
||||||
|
|
||||||
|
// add field
|
||||||
|
collection.fields.addAt(10, new Field({
|
||||||
|
"hidden": false,
|
||||||
|
"id": "number2198822773",
|
||||||
|
"max": null,
|
||||||
|
"min": null,
|
||||||
|
"name": "waittime",
|
||||||
|
"onlyInt": true,
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": false,
|
||||||
|
"type": "number"
|
||||||
|
}))
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
}, (app) => {
|
||||||
|
const collection = app.findCollectionByNameOrId("pbc_842702175")
|
||||||
|
|
||||||
|
// remove field
|
||||||
|
collection.fields.removeById("number1485952547")
|
||||||
|
|
||||||
|
// remove field
|
||||||
|
collection.fields.removeById("number2198822773")
|
||||||
|
|
||||||
|
return app.save(collection)
|
||||||
|
})
|
@ -1,27 +1,31 @@
|
|||||||
---
|
---
|
||||||
import client from "@/data/pocketbase"
|
import client from "@/data/pocketbase"
|
||||||
|
import TagRow from "./TagRow.astro"
|
||||||
|
|
||||||
const { recipe } = Astro.props;
|
const { recipe } = Astro.props;
|
||||||
|
|
||||||
const headerImage = await client.collection("images").getOne(recipe.images[0])
|
const headerImage = await client.collection("images").getOne(recipe.images[0])
|
||||||
const image = await client.files.getURL(headerImage, headerImage.image)
|
const image = await client.files.getURL(headerImage, headerImage.image)
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="relative z-0 flex h-60">
|
<div class="relative z-0 flex h-50">
|
||||||
<img
|
<img
|
||||||
class="w-full h-full object-cover rounded-xl"
|
class="w-full h-full object-cover rounded-xl"
|
||||||
src={ image }
|
src={ image }
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="absolute bottom-0 left-0 w-full p-2 h-25 backdrop-filter backdrop-blur-lg rounded-b-xl">
|
<div id="bottom-info-panel" class="absolute bottom-0 left-0 w-full p-2 h-20 backdrop-filter backdrop-blur-lg rounded-b-xl z-1">
|
||||||
<p class="text-[14pt] text-white opacity-90 font-bold" >{recipe.name}</p>
|
<p id="recipe-name" class="text-[14pt] text-white opacity-90 font-bold line-clamp-1" >{recipe.name}</p>
|
||||||
<p class="text-white text-[10pt]"> {recipe.description} </p>
|
<!-- <p id="recipe-desc" class="text-white text-[10pt]"> {recipe.description} </p> -->
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div id="tag-row" class="">
|
||||||
{recipe.tags.map(async tag => (
|
<TagRow tagIds={recipe.tags}/>
|
||||||
<p class="text-white bg-white/20 px-2 mr-2 mt-2 rounded-md">{
|
|
||||||
(await client.collection("tags").getOne(tag)).name
|
|
||||||
}</p>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<a id="link" href={`/recipe/${recipe.id}`} class="absolute inset-0 z-0">
|
||||||
|
<span class="block w-full h-full hover:bg-black/10 transition-colors">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
33
src/components/Card/TagRow.astro
Normal file
33
src/components/Card/TagRow.astro
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
import client from "../../data/pocketbase"
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
tagIds: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const { tagIds } = Astro.props
|
||||||
|
|
||||||
|
const tags = tagIds && tagIds.length > 0
|
||||||
|
? await Promise.all(tagIds.map(async (tagId: string) => {
|
||||||
|
try {
|
||||||
|
const tagData = await client.collection("tags").getOne(tagId)
|
||||||
|
return { name: tagData.name, id: tagId }
|
||||||
|
} catch (error) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
: []
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
{
|
||||||
|
tags.map(tag => (
|
||||||
|
<a
|
||||||
|
href={`/tag/${tag.id}`}
|
||||||
|
class="text-white bg-white/20 px-2 mr-2 mt-2 rounded-md inline-block hover:bg-white/30"
|
||||||
|
>
|
||||||
|
{tag.name}
|
||||||
|
</a>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</div>
|
58
src/components/Detail/ImageCarousel.astro
Normal file
58
src/components/Detail/ImageCarousel.astro
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
import client from "@/data/pocketbase";
|
||||||
|
const { class: className, recipe } = Astro.props
|
||||||
|
|
||||||
|
async function getLink(img: string) {
|
||||||
|
const record = await client.collection("images").getOne(img)
|
||||||
|
const link = await client.files.getURL(record, record.image)
|
||||||
|
return link
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use Promise.all to wait for all async operations to complete
|
||||||
|
const links = await Promise.all(
|
||||||
|
recipe.images.map((img: string) => getLink(img))
|
||||||
|
)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let pos = 0;
|
||||||
|
const dataElement = document.getElementById('carousel-data');
|
||||||
|
const links = dataElement ? JSON.parse(dataElement.textContent || '[]') : [];
|
||||||
|
const cap = links.length - 1;
|
||||||
|
const img = document.getElementById('carousel-img') as HTMLImageElement;
|
||||||
|
|
||||||
|
if (cap == 0) {
|
||||||
|
const b0 = document.getElementById('dec-button')
|
||||||
|
const b1 = document.getElementById('inc-button')
|
||||||
|
|
||||||
|
b0!.hidden = true
|
||||||
|
b1!.hidden = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function inc() {
|
||||||
|
pos = pos === cap ? 0 : pos + 1;
|
||||||
|
if (img) img.src = links[pos];
|
||||||
|
}
|
||||||
|
|
||||||
|
function dec() {
|
||||||
|
pos = pos === 0 ? cap : pos - 1;
|
||||||
|
if (img) img.src = links[pos];
|
||||||
|
}
|
||||||
|
|
||||||
|
// make functions globally accessible
|
||||||
|
(window as any).inc = inc;
|
||||||
|
(window as any).dec = dec;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class={className}>
|
||||||
|
<!-- Hidden element to pass server data to client -->
|
||||||
|
<div class="hidden" id="carousel-data">{JSON.stringify(links)}</div>
|
||||||
|
|
||||||
|
<div class="relative flex items-center w-full h-60">
|
||||||
|
<button id="dec-button" class="absolute left-2" onclick="dec()"><</button>
|
||||||
|
<img id="carousel-img" class="rounded-lg w-full h-full object-cover" src={links[0]} />
|
||||||
|
<!-- <div class="w-70 h-60 bg-green-600" /> -->
|
||||||
|
<button id="inc-button" class="absolute right-2" onclick="inc()">></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
42
src/components/Detail/IngredientTableView.astro
Normal file
42
src/components/Detail/IngredientTableView.astro
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
// const { ingredients } = Astro.props
|
||||||
|
|
||||||
|
const { class: className, ingredients } = Astro.props
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- <div class=`bg-[#2a2b2c] rounded-lg grid grid-cols-3 text-center ${className}`>
|
||||||
|
<span class="font-bold">Quantity</span>
|
||||||
|
<span class="font-bold">Unit</span>
|
||||||
|
<span class="font-bold">Food</span>
|
||||||
|
{
|
||||||
|
ingredients.map(ing => (
|
||||||
|
<span>{ing.quantity}</span>
|
||||||
|
<span>{ing.unit}</span>
|
||||||
|
<span>{ing.name}</span>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<table class={`table-auto text-left bg-[#2a2b2c] rounded-lg ${className} w-full`}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-2">Quantity</th>
|
||||||
|
<th class="px-4 py-2">Unit</th>
|
||||||
|
<th class="px-4 py-2">Food</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{
|
||||||
|
ingredients.map(ing => (
|
||||||
|
<>
|
||||||
|
<tr class="border-t border-gray-600">
|
||||||
|
<td class="px-4 py-2">{ing.quantity}</td>
|
||||||
|
<td class="px-4 py-2">{ing.unit}</td>
|
||||||
|
<td class="px-4 py-2">{ing.name}</td>
|
||||||
|
</tr>
|
||||||
|
</>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
@ -1,13 +1,14 @@
|
|||||||
|
|
||||||
<div class="flex w-full items-center bg-yellow-100 p-5">
|
<div class="flex w-full items-center bg-[#2a2b2c] text-white p-5">
|
||||||
<a class="flex" href="/">
|
<a class="flex" href="/">
|
||||||
<p class=" text-3xl">Reci</p>
|
<p class="text-3xl">Recipie</p>
|
||||||
<p class=" text-3xl text-amber-500">pie</p>
|
<!-- <p class=" text-3xl text-amber-500">pie</p> -->
|
||||||
🥧
|
🥧
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="flex ml-10 space-x-5">
|
<div class="ml-auto space-x-5">
|
||||||
<!-- <span>new</span>
|
<a>new</a>
|
||||||
<span>sf</span> -->
|
<a>tags</a>
|
||||||
|
<a>search</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -10,7 +10,9 @@ import Header from "@/components/Header";
|
|||||||
<body>
|
<body>
|
||||||
<main id="main" class="flex-1">
|
<main id="main" class="flex-1">
|
||||||
<Header/>
|
<Header/>
|
||||||
|
<div class="px-3 md:px-5 pt-2">
|
||||||
<slot />
|
<slot />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,16 +7,14 @@ const recipies = await client.collection("recipes").getFullList()
|
|||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<div id="content" class="p-5 pt-2">
|
|
||||||
<!-- <p class="pb-2">What would you like today?</p> -->
|
<!-- <p class="pb-2">What would you like today?</p> -->
|
||||||
|
|
||||||
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
|
<div class="grid md:gap-2 gap-3 grid-cols-2 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-8">
|
||||||
{
|
{
|
||||||
recipies.map(r => (
|
recipies.map(r => (
|
||||||
<OverviewCard recipe={r} />
|
<OverviewCard recipe={r} />
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
79
src/pages/recipe/[recipeid].astro
Normal file
79
src/pages/recipe/[recipeid].astro
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
import client from "@/data/pocketbase";
|
||||||
|
import SiteLayout from "@/layouts/base";
|
||||||
|
import ImageCarousel from "@/components/Detail/ImageCarousel";
|
||||||
|
import IngredientTableView from "@/components/Detail/IngredientTableView";
|
||||||
|
|
||||||
|
const { recipeid } = Astro.params;
|
||||||
|
|
||||||
|
const re = await client.collection("recipes").getOne(recipeid ?? "0");
|
||||||
|
|
||||||
|
const stepIds = re.steps
|
||||||
|
|
||||||
|
let steps = await Promise.all(
|
||||||
|
stepIds.map(async s =>
|
||||||
|
await client.collection("steps").getOne(s)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
steps = steps.sort((a, b) => a.index - b.index);
|
||||||
|
|
||||||
|
const ingredients = await Promise.all(
|
||||||
|
re.ingredients.map(async s =>
|
||||||
|
await client.collection("ingredients").getOne(s)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
function formatTime(seconds) {
|
||||||
|
if (seconds === 0) return null
|
||||||
|
const h = Math.floor(seconds / 3600);
|
||||||
|
const m = Math.floor((seconds % 3600) / 60);
|
||||||
|
let result = "";
|
||||||
|
if (h > 0) result += `${h}h`;
|
||||||
|
if (m > 0) result += `${m}m`;
|
||||||
|
if (result === "") result = "0m";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const workTime = formatTime(re.worktime)
|
||||||
|
const waitTime = formatTime(re.waittime)
|
||||||
|
---
|
||||||
|
|
||||||
|
<SiteLayout>
|
||||||
|
<div class="flex flex-col md:flex-row">
|
||||||
|
<div class="flex flex-col ">
|
||||||
|
<ImageCarousel class="w-full" recipe={re} />
|
||||||
|
<p class=" md:hidden text-[28pt] font-bold leading-none mt-2">{re.name}</p>
|
||||||
|
|
||||||
|
<!-- Details -->
|
||||||
|
<p class="text-white/60 text-sm mt-1 italic">{re.description}</p>
|
||||||
|
<div class="flex pt-1">
|
||||||
|
{re.servings !== 0 && (<p class="border-r pr-2">Serves: {re.servings}</p>)}
|
||||||
|
{workTime && (<p class="border-r px-2">{workTime} work</p>)}
|
||||||
|
{waitTime && (<p class="border-r px-2">{waitTime} wait</p>)}
|
||||||
|
{re.rating !== 0 && (<p class="pl-2">{re.rating}⭐️</p>)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-[22pt] font-bold 'md:mt-4'">Ingredients</p>
|
||||||
|
<IngredientTableView class:list={['md:w-80', 'px-4']} ingredients={ingredients} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<p class="hidden md:block text-[28pt] font-bold pl-5">{re.name}</p>
|
||||||
|
|
||||||
|
<!-- Steps -->
|
||||||
|
<div class="md:ml-5 mt-2 md:mt-0">
|
||||||
|
<p class="text-[22pt] font-bold md:hidden">Steps</p>
|
||||||
|
{ steps.map(s => (
|
||||||
|
<div class="bg-[#2a2b2c] rounded-lg mb-2 p-3 md:">
|
||||||
|
<p class="text-bold text-[10pt]">Step {s.index + 1}</p>
|
||||||
|
<p>{s.instruction}</p>
|
||||||
|
</div>
|
||||||
|
)) }
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</SiteLayout>
|
@ -1,7 +1,10 @@
|
|||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
|
||||||
html {
|
html {
|
||||||
/* @apply bg-[#1d1f21]; */
|
@apply bg-[#1d1f21];
|
||||||
@apply bg-[#fafafa];
|
/* @apply bg-[#fafafa]; */
|
||||||
@apply font-stretch-condensed;
|
@apply text-white;
|
||||||
|
/* @apply font-; */
|
||||||
|
@apply font-sans;
|
||||||
|
/* font-family: 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; */
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user