Skip to content

Commit

Permalink
feat: improve card ui
Browse files Browse the repository at this point in the history
  • Loading branch information
KeziahMoselle committed Apr 8, 2024
1 parent 4ac24e2 commit d678857
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
}
}),
integrations: [
vue(),
vue({ appEntrypoint: '/src/pages/_app' }),
tailwind({
applyBaseStyles: false,
}),
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"vee-validate": "^4.12.6",
"vue": "^3.4.21",
"vue-sonner": "^1.1.2",
"vue3-marquee": "^4.2.0",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions frontend/src/components/molecules/EldenRing/BuildCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
import type { ErBuild } from '~/payload-types'
import Tag from '@/components/molecules/EldenRing/Tag.vue'
import { ThumbsUpIcon } from 'lucide-vue-next'
import EquipmentImage from '@/components/molecules/EldenRing/EquipmentImage.vue';
import EquipmentImage from '@/components/molecules/EldenRing/EquipmentImage.vue';
import { Vue3Marquee } from 'vue3-marquee'
defineProps<{
build?: ErBuild
}>()
</script>

<template>
<article class="z-0 relative pr-5 pt-3 pb-5 border border-accent bg-background max-w-[451px]">
<article class="z-0 relative pr-5 pt-3 pb-5 border border-accent bg-background max-w-[451px] overflow-hidden">
<img
class="-z-10 absolute inset-0 object-cover object-center h-full w-full"
src="/build-background.png"
alt=""
loading="lazy" />
<!-- Build title and like -->
<!-- Build title and Actions -->
<header class="flex justify-between">
<div class="relative h-[44px]">
<div
Expand All @@ -25,7 +27,16 @@ import EquipmentImage from '@/components/molecules/EldenRing/EquipmentImage.vue'
flex items-center gap-x-4
">
<img class="h-6 w-auto" src="https://pub-3a5ef743ff2748219f5eb6a3adad2be7.r2.dev/test%2Fbleed.png" alt="bleed" />
<h3>Bleed build</h3>
<p class="-ml-4 w-40">
<Vue3Marquee
gradient
:gradient-color="[29, 29, 24]"
gradient-length="10%"
animate-on-overflow-only
>
<h3 class="ml-4">Bleed build</h3>
</Vue3Marquee>
</p>
</div>
<img class="w-full h-[44px]" src="/build-title.png" alt="" />
</div>
Expand All @@ -43,15 +54,15 @@ import EquipmentImage from '@/components/molecules/EldenRing/EquipmentImage.vue'
</div>

<!-- Build preview -->
<div class="grid ml-8 mt-8 gap-2 md:grid-cols-3">
<div class="grid ml-8 mt-8 gap-2 grid-cols-2 md:grid-cols-3">
<EquipmentImage
src="https://pub-3a5ef743ff2748219f5eb6a3adad2be7.r2.dev/test%2Fmainhand.png"
alt="Mainhand 1" />
<EquipmentImage
src="https://pub-3a5ef743ff2748219f5eb6a3adad2be7.r2.dev/test%2Fmainhand.png"
alt="Mainhand 2" />

<div class="grid grid-cols-2 gap-2 grid-rows-2">
<div class="grid gap-2 col-span-4 grid-cols-4 md:col-span-1 md:grid-cols-2">
<EquipmentImage
v-for="(_, i) in Array.from({ length: 4 })"
:src="`https://pub-3a5ef743ff2748219f5eb6a3adad2be7.r2.dev/test%2Ftalisman${i + 1}.png`"
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/pages/_app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { App } from 'vue';
import Vue3Marquee from 'vue3-marquee'

export default (app: App) => {
app.use(Vue3Marquee, { name: 'Marquee' });
};
10 changes: 5 additions & 5 deletions frontend/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TranslateImages from '@/components/atoms/TranslateImages.vue'

<Layout title="Home">
<div class="relative">
<img class="-z-10 absolute top-0" src="/hero/gideon.webp" alt="" />
<img class="-z-10 absolute top-0 w-full max-h-screen object-cover object-top" src="/hero/gideon.webp" alt="" />
</div>
<section class="container px-4">
<h1 class="text-center font-display text-3xl md:text-7xl md:leading-xl my-20 md:mt-44">
Expand Down Expand Up @@ -43,10 +43,10 @@ import TranslateImages from '@/components/atoms/TranslateImages.vue'
<section class="mb-16">
<h2 class="type-h2 text-center mb-16">Most popular builds</h2>

<div class="container--xl grid gap-5 md:grid-cols-3">
<BuildCard />
<BuildCard />
<BuildCard />
<div class="container--xl grid gap-5 justify-center md:grid-cols-3">
<BuildCard client:idle />
<BuildCard client:idle />
<BuildCard client:idle />
</div>

<div class="flex justify-center mt-16">
Expand Down

0 comments on commit d678857

Please sign in to comment.