-
-
Notifications
You must be signed in to change notification settings - Fork 796
Expand file tree
/
Copy pathCTAButton.vue
More file actions
58 lines (52 loc) · 1011 Bytes
/
CTAButton.vue
File metadata and controls
58 lines (52 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps({
primary: Boolean,
href: String
})
const classes = computed(() => {
return { 'btn-primary': props.primary }
})
</script>
<template>
<a
:href="href || '/guides/'"
class="btn text-md font-bold uppercase px-6 py-0.5 rounded-full"
md="text-lg px-8 py-1.6"
lg="py-2.8 px-12"
:class="classes"
>
<slot />
</a>
</template>
<style lang="postcss">
.btn {
animation: button-pop var(--animation-btn, 0.25s) ease-out;
}
.btn:active:hover,
.btn:active:focus {
animation: none;
}
.btn:active:hover,
.btn:active:focus {
transform: scale(var(--btn-focus-scale, 0.95));
}
.btn-primary {
background-color: var(--vp-c-brand);
transition: all 300ms;
}
.btn-primary:hover {
background-color: var(--vp-c-brand-darker);
}
@keyframes button-pop {
0% {
transform: scale(var(--btn-focus-scale, 0.95));
}
40% {
transform: scale(1.02);
}
100% {
transform: scale(1);
}
}
</style>