Skip to content

Commit

Permalink
feat: stylish catalog component
Browse files Browse the repository at this point in the history
  • Loading branch information
koshacha committed Oct 4, 2024
1 parent 4b98819 commit 0833dea
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 deletions.
Binary file added src/assets/plant-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/plant-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/plant-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/plant-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/plant-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 34 additions & 16 deletions src/components/TheCatalog.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<script lang="ts" setup>
import plant1 from '~/assets/plant-1.png'
import plant2 from '~/assets/plant-2.png'
import plant3 from '~/assets/plant-3.png'
import plant4 from '~/assets/plant-4.png'
import plant5 from '~/assets/plant-5.png'
interface Product {
id: string
name: string
Expand All @@ -9,47 +15,59 @@ interface Product {
const items: Product[] = [
{
id: '1',
name: 'Kembang Flower Mantap',
image: 'https://source.unsplash.com/random',
name: 'Kaktus Plants',
image: plant1,
price: 10000,
},
{
id: '2',
name: 'Kembang Flower Mantap',
image: 'https://source.unsplash.com/random',
name: 'Landak Plants',
image: plant2,
price: 10000,
},
{
id: '3',
name: 'Kembang Flower Mantap',
image: 'https://source.unsplash.com/random',
name: 'Kecubung Plants',
image: plant3,
price: 10000,
},
{
id: '4',
name: 'Kembang Flower Mantap',
image: 'https://source.unsplash.com/random',
name: 'Kecubung Plants',
image: plant4,
price: 10000,
},
{
id: '5',
name: 'Kembang Flower Mantap Kembang',
image: plant5,
price: 10000,
},
]
</script>

<template>
<section>
<div>
<div>
<section m="b-20">
<div container>
<div flex items="center" justify="between" p="b-4" m="b-6" border="b #E0E0E0">
<h2>Featured Plants</h2>
<div>
<select>
<option>Cheaper First</option>
</select>
</div>
</div>
<div>
<div v-for="item in items" :key="item.id">
<img :src="item.image" alt="">
<div>{{ item.name }}</div>
<div>IDR {{ item.price }}</div>
<div grid="~ cols-5" gap="5">
<div v-for="item in items" :key="item.id" class="group">
<div overflow-hidden m="b-4">
<img :src="item.image" alt="" aspect-ratio-1 w-full transition transform="origin-top group-hover:scale-120">
</div>
<div text="center balance" m="b-2">
{{ item.name }}
</div>
<div text="center" font="600">
IDR {{ item.price }}
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineConfig({
}),
presetWebFonts({
fonts: {
montserrat: 'Montserrat:400,500,700',
montserrat: 'Montserrat:400,500,600,700',
nunito: 'Nunito:700',
},
}),
Expand Down

0 comments on commit 0833dea

Please sign in to comment.