11<script setup lang="ts">
2- interface Course {
3- slug: string
4- image_thumb: string
5- titulo: string
6- shortdes: string
7- total_duration_text: string
8- price: number | null
9- }
2+ import type { Course } from ' ~/interfaces/courses.response'
103
114defineProps <{ course: Course }>()
5+
6+ const { convertToHours } = useFormatter ()
127 </script >
138
149<template >
@@ -30,7 +25,7 @@ defineProps<{ course: Course }>()
3025 >
3126 </figure >
3227 <!-- Card Content -->
33- <div class =" flex-grow flex flex-col p-5 " >
28+ <div class =" flex-grow flex flex-col p-4 " >
3429 <!-- Card body -->
3530 <div class =" flex-grow" >
3631 <!-- Header -->
@@ -57,12 +52,18 @@ defineProps<{ course: Course }>()
5752 <!-- Card footer -->
5853 <div class =" flex justify-between items-center" >
5954 <p class =" font-inconsolata text-sm text-gray-400" >
60- {{ course.total_duration_text }}
55+ {{ convertToHours( course.total_duration_text) }}
6156 </p >
62- <div v-if =" course.price === 0 || course.price === null" class =" font-semibold text-sm inline-flex items-center justify-center px-4 py-2 rounded-lg transition-colors duration-150 ease-in-out bg-bta-pink/95 hover:bg-bta-pink text-white" >
57+ <div
58+ v-if =" course.price === 0 || course.price === null"
59+ class =" font-semibold text-sm inline-flex items-center justify-center px-4 py-2 rounded-lg transition-all duration-300 ease-in-out bg-bta-pink/95 hover:bg-bta-pink hover:scale-105 hover:-translate-y-1 text-white"
60+ >
6361 Gratis
6462 </div >
65- <div v-else class =" font-semibold text-sm inline-flex items-center justify-center px-4 py-2 rounded-lg transition-colors duration-150 ease-in-out bg-bta-pink/95 hover:bg-bta-pink text-white" >
63+ <div
64+ v-else
65+ class =" font-semibold text-sm inline-flex items-center justify-center px-4 py-2 rounded-lg transition-all duration-300 ease-in-out bg-bta-pink/95 hover:bg-bta-pink hover:scale-105 hover:-translate-y-1 text-white"
66+ >
6667 $ {{ course.price }}
6768 </div >
6869 </div >
@@ -106,4 +107,15 @@ defineProps<{ course: Course }>()
106107 clip-path : polygon (0 55% , 100% 55% , 100% 100% , 0 100% );
107108 text-shadow : 2px 0 #00fff9 ;
108109}
110+
111+ /* Animación suave para el precio */
112+ .transition-all {
113+ transition-property : all ;
114+ transition-timing-function : cubic-bezier (0.4 , 0 , 0.2 , 1 );
115+ transition-duration : 300ms ;
116+ }
117+
118+ .hover\: scale-105 :hover {
119+ transform : scale (1.05 ) translateY (-0.25rem );
120+ }
109121 </style >
0 commit comments