|
9 | 9 | </div> |
10 | 10 | </div> |
11 | 11 | <div> |
12 | | - <div class="flex-col flex gap-3"> |
13 | | - <div> |
14 | | - <h1 class="text-2xl">{{ product.name }}</h1> |
15 | | - </div> |
16 | | - <div> |
| 12 | + <div class="flex-col flex gap-4"> |
| 13 | + <div class="pb-4 border-b border-white/20"> |
| 14 | + <h1 class="text-2xl font-semibold mb-1">{{ product.name }}</h1> |
17 | 15 | <div class="flex justify-between flex-row items-baseline"> |
18 | 16 | <div class="flex flex-row items-baseline"> |
19 | | - <p class="text-xl font-bold" v-html="product.salePrice"></p> |
| 17 | + <p class="text-xl font-bold text-[#ff0000]" v-html="product.salePrice"></p> |
20 | 18 | <p class="text-sm ml-2">VAT included</p> |
21 | 19 | </div> |
22 | 20 | </div> |
23 | 21 | <div class="flex-wrap items-baseline flex-row flex"> |
24 | 22 | <p class="text-sm">Originally:</p> |
25 | 23 | <p class="text-sm ml-1 line-through" v-html="product.regularPrice"></p> |
26 | | - <p class="text-sm ml-1">{{ calculateDiscountPercentage }}%</p> |
| 24 | + <p class="text-sm ml-1 text-[#ff0000]">{{ calculateDiscountPercentage }}%</p> |
27 | 25 | </div> |
28 | 26 | </div> |
29 | 27 | <div class="flex gap-2" v-for="(variation, i) in product.productTypes.nodes" :key="variation.id"> |
|
35 | 33 | </NuxtLink> |
36 | 34 | </div> |
37 | 35 | </div> |
38 | | - <div> |
39 | | - <div>Size: {{ selectedVariation }}</div> |
40 | | - <div class="flex gap-2 mt-3 flex-wrap"> |
| 36 | + <div class="pb-4 border-b border-white/20"> |
| 37 | + <div class="text-sm font-semibold leading-5">Size: {{ selectedVariation }}</div> |
| 38 | + <div class="flex gap-2 mt-3 mb-4 flex-wrap"> |
41 | 39 | <label |
42 | | - class="py-1 px-3 border rounded-md" |
| 40 | + class="py-1 px-3 border rounded-md cursor-pointer select" |
43 | 41 | v-for="variation in product.variations.nodes" |
44 | 42 | :key="variation.id" |
45 | 43 | :class="[ |
46 | 44 | variation.stockStatus === 'OUT_OF_STOCK' ? 'disabled' : '', |
47 | | - selectedVariation === variation.attributes.nodes.map((attr) => attr.value).toString() ? 'bg-red-500' : '', |
| 45 | + selectedVariation === variation.attributes.nodes.map((attr) => attr.value).toString() ? 'selected' : '', |
48 | 46 | ]"> |
49 | 47 | <input |
50 | 48 | type="radio" |
|
53 | 51 | :value="variation.attributes.nodes.map((attr) => attr.value).toString()" |
54 | 52 | :disabled="variation.stockStatus === 'OUT_OF_STOCK'" |
55 | 53 | v-model="selectedVariation" /> |
56 | | - <span>{{ variation.attributes.nodes.map((attr) => attr.value).toString() }}</span> |
| 54 | + <span :title="`Size: ${variation.attributes.nodes.map((attr) => attr.value).toString()}`">{{ |
| 55 | + variation.attributes.nodes.map((attr) => attr.value).toString() |
| 56 | + }}</span> |
57 | 57 | </label> |
58 | 58 | </div> |
| 59 | + <div class="flex"> |
| 60 | + <button type="submit" class="w-full h-12 border rounded-md tracking-wide font-semibold border-[#990000] bg-[#ff0000] transition duration-200 hover:bg-[#c90000]"> |
| 61 | + Add to Cart |
| 62 | + </button> |
| 63 | + <div class="cursor-pointer"> |
| 64 | + <div class="w-12 h-12 rounded-md border ml-4 flex justify-center items-center"> |
| 65 | + <Icon name="ion:heart-outline" size="26" /> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + <div> |
| 71 | + <div class="text-base mb-2 font-semibold">Featured Information</div> |
| 72 | + <div class="description leading-7 overflow-hidden max-h-84 text-sm"> |
| 73 | + <ul> |
| 74 | + <li>Free returns within 15 days. Click for detailed <a class="underline" href="#">information</a>.</li> |
| 75 | + <li>Article number: {{ product.sku }}</li> |
| 76 | + <div v-html="product.description"></div> |
| 77 | + </ul> |
| 78 | + </div> |
59 | 79 | </div> |
60 | | - <div v-html="product.description"></div> |
61 | 80 | </div> |
62 | 81 | </div> |
63 | 82 | </div> |
@@ -122,8 +141,20 @@ const calculateDiscountPercentage = computed(() => { |
122 | 141 | // const product = data?.value?.product; |
123 | 142 | </script> |
124 | 143 |
|
125 | | -<style> |
| 144 | +<style lang="postcss"> |
126 | 145 | .disabled { |
127 | | - opacity: 0.4; |
| 146 | + @apply opacity-40 cursor-default; |
| 147 | +} |
| 148 | +.selected, |
| 149 | +.select:hover:not(.disabled) { |
| 150 | + background-color: rgb(242 26 26 / 15%); |
| 151 | + border: solid 2px #ff0000; |
| 152 | + padding: 0.188rem 0.688rem; |
| 153 | + color: #ff0000; |
| 154 | +} |
| 155 | +.description ul li { |
| 156 | + background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxlbGxpcHNlIHJ5PSIzIiByeD0iMyIgY3k9IjMiIGN4PSIzIiBmaWxsPSIjYzljOWM5Ii8+PC9zdmc+) |
| 157 | + no-repeat 0 0.7rem; |
| 158 | + padding-left: 0.938rem; |
128 | 159 | } |
129 | 160 | </style> |
0 commit comments