Skip to content

Commit b66c367

Browse files
committed
Add animation on products table
1 parent 0284fe2 commit b66c367

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

Diff for: backend/src/views/Products/ProductsTable.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="bg-white p-4 rounded-lg shadow">
2+
<div class="bg-white p-4 rounded-lg shadow animate-fade-in-down">
33
<div class="flex justify-between border-b-2 pb-3">
44
<div class="flex items-center">
55
<span class="whitespace-nowrap mr-3">Per Page</span>
@@ -57,7 +57,8 @@
5757
</tr>
5858
</tbody>
5959
<tbody v-else>
60-
<tr v-for="product of products.data">
60+
<tr v-for="(product, index) of products.data" class="animate-fade-in-down"
61+
:style="{'animation-delay': (index * 0.1) + 's'}">
6162
<td class="border-b p-2 ">{{ product.id }}</td>
6263
<td class="border-b p-2 ">
6364
<img class="w-16 h-16 object-cover" :src="product.image_url" :alt="product.title">

Diff for: backend/tailwind.config.js

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
/** @type {import('tailwindcss').Config} */
22
module.exports = {
3-
content: [
4-
"./index.html",
5-
"./src/**/*.{vue,js,ts,jsx,tsx}",
6-
],
7-
theme: {
8-
extend: {},
3+
content: [
4+
"./index.html",
5+
"./src/**/*.{vue,js,ts,jsx,tsx}",
6+
],
7+
theme: {
8+
extend: {
9+
keyframes: {
10+
'fade-in-down': {
11+
"from": {
12+
transform: "translateY(-0.75rem)",
13+
opacity: '0'
14+
},
15+
"to": {
16+
transform: "translateY(0rem)",
17+
opacity: '1'
18+
},
19+
},
20+
},
21+
animation: {
22+
'fade-in-down': "fade-in-down 0.2s ease-in-out both",
23+
},
924
},
1025
plugins: [
1126
require('@tailwindcss/forms'),
1227
],
28+
}
1329
}

0 commit comments

Comments
 (0)