6464 <div class =" text-sm text-gray-500 flex gap-2 items-center" >
6565 <span >{{ file.file.type }}</span >
6666 <div class =" h-1 w-1 rounded-full bg-gray-300" ></div >
67- <div >
67+ <div class = " flex items-center " >
6868 <span class =" mr-2" >{{
6969 formatFileSize(file.file.size)
7070 }}</span >
@@ -80,12 +80,30 @@ watch(
8080 v-else-if =" file.status === 'pending'"
8181 class =" pi pi-spinner text-blue-600 dark:text-blue-400 pi-spin"
8282 ></i >
83- <i
83+ <!-- Thay thế icon đồng hồ cát bằng dots loader -->
84+ <div
8485 v-else-if =" file.status === 'queued'"
85- class =" pi pi-hourglass text-yellow-600 dark:text-yellow-400"
86- ></i >
86+ class =" dots-loader"
87+ >
88+ <div ></div >
89+ <div ></div >
90+ <div ></div >
91+ </div >
8792 </div >
8893 </div >
94+ <!-- Progress bar with gradient -->
95+ <div
96+ v-if =" file.status === 'pending' || file.status === 'queued'"
97+ class =" w-full h-1.5 bg-gray-100 rounded-full mt-2 overflow-hidden"
98+ >
99+ <div
100+ class =" h-full rounded-full transition-all duration-300 bg-gradient-to-r from-blue-500 via-blue-400 to-blue-500 background-animate"
101+ :class =" {
102+ 'animate-progress': file.status === 'pending',
103+ 'w-0': file.status === 'queued',
104+ }"
105+ ></div >
106+ </div >
89107 </div >
90108 <button
91109 class =" pi pi-times-circle"
@@ -94,3 +112,71 @@ watch(
94112 ></button >
95113 </div >
96114</template >
115+
116+ <style scoped>
117+ @keyframes progress {
118+ 0% {
119+ width : 0 ;
120+ }
121+ 100% {
122+ width : 100% ;
123+ }
124+ }
125+
126+ .animate-progress {
127+ animation : progress 2s ease-in-out infinite ;
128+ }
129+
130+ /* Dots loader animation */
131+ .dots-loader {
132+ display : flex ;
133+ align-items : center ;
134+ gap : 2px ;
135+ height : 16px ;
136+ }
137+
138+ .dots-loader div {
139+ width : 4px ;
140+ height : 4px ;
141+ background-color : #4b5563 ;
142+ border-radius : 50% ;
143+ animation : dots 1.4s infinite ease-in-out ;
144+ }
145+
146+ .dots-loader div :nth-child (1 ) {
147+ animation-delay : -0.32s ;
148+ }
149+
150+ .dots-loader div :nth-child (2 ) {
151+ animation-delay : -0.16s ;
152+ }
153+
154+ @keyframes dots {
155+ 0% ,
156+ 80% ,
157+ 100% {
158+ transform : scale (0 );
159+ }
160+ 40% {
161+ transform : scale (1 );
162+ }
163+ }
164+
165+ /* Gradient animation for progress bar */
166+ .background-animate {
167+ background-size : 200% ;
168+ animation : gradient 2s linear infinite ;
169+ }
170+
171+ @keyframes gradient {
172+ 0% {
173+ background-position : 0% 50% ;
174+ }
175+ 50% {
176+ background-position : 100% 50% ;
177+ }
178+ 100% {
179+ background-position : 0% 50% ;
180+ }
181+ }
182+ </style >
0 commit comments