@d0rich/esprit-design 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/index.html +13 -0
- package/package.json +1 -4
- package/plugins/shadows.js +87 -0
- package/src/components/DChip.vue +32 -0
- package/src/components/DPagination.vue +91 -0
- package/src/components/DStats.vue +502 -0
- package/src/components/animations/DAnimationAccordion.vue +103 -0
- package/src/components/animations/DAnimationDefLetterD.vue +11 -0
- package/src/components/animations/DAnimationFloatingLetter.vue +58 -0
- package/src/components/animations/DAnimationHypnosis.vue +102 -0
- package/src/components/animations/DAnimationSpinner.vue +114 -0
- package/src/components/animations/index.ts +11 -0
- package/src/components/buttons/DBigBangButton.vue +70 -0
- package/src/components/buttons/DBigBangButtonAnimation.vue +117 -0
- package/src/components/buttons/DBtn.vue +106 -0
- package/src/components/buttons/index.ts +5 -0
- package/src/components/cards/DCard.vue +98 -0
- package/src/components/cards/DCardTitle.vue +67 -0
- package/src/components/cards/index.ts +4 -0
- package/src/components/content/DAlert.vue +112 -0
- package/src/components/content/DQuote.vue +71 -0
- package/src/components/content/index.ts +4 -0
- package/src/components/index.ts +12 -0
- package/src/components/lists/DActionsFan.vue +153 -0
- package/src/components/lists/DActionsList.vue +100 -0
- package/src/components/lists/index.ts +4 -0
- package/src/components/utils/DWrapBackground.vue +76 -0
- package/src/components/utils/DWrapFocusHighlight.vue +241 -0
- package/src/components/utils/DWrapShape.vue +170 -0
- package/src/components/utils/index.ts +7 -0
- package/src/composables/big-bang-button-utils.ts +7 -0
- package/src/composables/index.ts +2 -0
- package/src/composables/router.ts +66 -0
- package/src/composables/utils.ts +5 -0
- package/src/index.ts +3 -0
- package/src/style.css +3 -0
- package/src/utils/boundings.ts +35 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/pagination.ts +4 -0
- package/src/utils/polygon-animation.ts +139 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +22 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +35 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DAnimationDefLetterD from './DAnimationDefLetterD.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DAnimationHypnosis',
|
|
6
|
+
components: {
|
|
7
|
+
DAnimationDefLetterD
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
defineProps({
|
|
14
|
+
wigglePeriod: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 10
|
|
17
|
+
},
|
|
18
|
+
delay: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 1
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<svg
|
|
27
|
+
viewBox="0 0 630 630"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
class="d-animation-hypnosis"
|
|
30
|
+
:style="{
|
|
31
|
+
'--d-hypnosis-wiggle-period': wigglePeriod + 's',
|
|
32
|
+
'--d-hypnosis-delay': delay + 's'
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
<defs>
|
|
36
|
+
<DAnimationDefLetterD id="d-letter" />
|
|
37
|
+
<use id="d-hypnosis-section" href="#d-letter" />
|
|
38
|
+
</defs>
|
|
39
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
40
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
41
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
42
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
43
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
44
|
+
<use href="#d-hypnosis-section" class="d-animation-hypnosis__section" />
|
|
45
|
+
</svg>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section {
|
|
50
|
+
--hypnosis-section-min-posion: scale(
|
|
51
|
+
calc(var(--hypnosis-section-count) / 12)
|
|
52
|
+
);
|
|
53
|
+
--hypnosis-section-max-posion: translate(
|
|
54
|
+
calc(var(--hypnosis-section-count) / 6)
|
|
55
|
+
);
|
|
56
|
+
transform: var(--hypnosis-section-min-posion);
|
|
57
|
+
transform-origin: 315px 315px;
|
|
58
|
+
animation: d-animation-hypnosis-section-wiggle var(--d-hypnosis-wiggle-period)
|
|
59
|
+
ease-in-out infinite alternate
|
|
60
|
+
calc((var(--hypnosis-section-count) - 6) * -1 * var(--d-hypnosis-delay));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(2n + 1) {
|
|
64
|
+
@apply fill-white;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(2) {
|
|
68
|
+
--hypnosis-section-count: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(3) {
|
|
72
|
+
--hypnosis-section-count: 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(4) {
|
|
76
|
+
--hypnosis-section-count: 3;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(5) {
|
|
80
|
+
--hypnosis-section-count: 4;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(6) {
|
|
84
|
+
--hypnosis-section-count: 5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.d-animation-hypnosis > .d-animation-hypnosis__section:nth-child(7) {
|
|
88
|
+
--hypnosis-section-count: 6;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes d-animation-hypnosis-section-wiggle {
|
|
92
|
+
0% {
|
|
93
|
+
transform: var(--hypnosis-section-min-posion);
|
|
94
|
+
}
|
|
95
|
+
50% {
|
|
96
|
+
transform: var(--hypnosis-section-max-posion);
|
|
97
|
+
}
|
|
98
|
+
100% {
|
|
99
|
+
transform: var(--hypnosis-section-min-posion);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DAnimationDefLetterD from './DAnimationDefLetterD.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DAnimationSpinner',
|
|
6
|
+
components: {
|
|
7
|
+
DAnimationDefLetterD
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const transformOrigin = '315 315'
|
|
14
|
+
defineProps({
|
|
15
|
+
spinPeriod: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 10
|
|
18
|
+
},
|
|
19
|
+
bladeWigglePeriod: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 5
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<svg
|
|
28
|
+
class="spinner"
|
|
29
|
+
viewBox="0 0 630 630"
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
:style="{
|
|
32
|
+
'--d-spinner-spin-period': spinPeriod + 's',
|
|
33
|
+
'--d-spinner-blade-wiggle-period': bladeWigglePeriod + 's'
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<defs>
|
|
37
|
+
<DAnimationDefLetterD id="d-letter" />
|
|
38
|
+
<use
|
|
39
|
+
id="d-spinner-blade"
|
|
40
|
+
href="#d-letter"
|
|
41
|
+
class="d-animation-spinner__blade"
|
|
42
|
+
:transform-origin="transformOrigin"
|
|
43
|
+
/>
|
|
44
|
+
<g
|
|
45
|
+
id="spinner"
|
|
46
|
+
class="d-animation-spinner__spinner"
|
|
47
|
+
:transform-origin="transformOrigin"
|
|
48
|
+
>
|
|
49
|
+
<use
|
|
50
|
+
href="#d-spinner-blade"
|
|
51
|
+
transform="rotate(0)"
|
|
52
|
+
:transform-origin="transformOrigin"
|
|
53
|
+
/>
|
|
54
|
+
<use
|
|
55
|
+
href="#d-spinner-blade"
|
|
56
|
+
transform="rotate(120)"
|
|
57
|
+
:transform-origin="transformOrigin"
|
|
58
|
+
/>
|
|
59
|
+
<use
|
|
60
|
+
href="#d-spinner-blade"
|
|
61
|
+
transform="rotate(240)"
|
|
62
|
+
:transform-origin="transformOrigin"
|
|
63
|
+
/>
|
|
64
|
+
</g>
|
|
65
|
+
</defs>
|
|
66
|
+
<use
|
|
67
|
+
href="#spinner"
|
|
68
|
+
transform="translate( -20 20 )"
|
|
69
|
+
class="d-animation-spinner__background"
|
|
70
|
+
:transform-origin="transformOrigin"
|
|
71
|
+
/>
|
|
72
|
+
<use
|
|
73
|
+
href="#spinner"
|
|
74
|
+
class="d-animation-spinner__foreground"
|
|
75
|
+
:transform-origin="transformOrigin"
|
|
76
|
+
/>
|
|
77
|
+
</svg>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<style>
|
|
81
|
+
.d-animation-spinner__foreground {
|
|
82
|
+
@apply fill-white;
|
|
83
|
+
}
|
|
84
|
+
.d-animation-spinner__background {
|
|
85
|
+
@apply fill-black;
|
|
86
|
+
}
|
|
87
|
+
.d-animation-spinner__blade {
|
|
88
|
+
--transform-static: scale(0.5) rotate(220deg);
|
|
89
|
+
animation: d-spinner-blade-wiggle var(--d-spinner-blade-wiggle-period)
|
|
90
|
+
ease-in-out infinite;
|
|
91
|
+
}
|
|
92
|
+
@keyframes d-spinner-blade-wiggle {
|
|
93
|
+
0% {
|
|
94
|
+
transform: translate(0px, -150px) var(--transform-static);
|
|
95
|
+
}
|
|
96
|
+
50% {
|
|
97
|
+
transform: translate(0px, -120px) var(--transform-static);
|
|
98
|
+
}
|
|
99
|
+
100% {
|
|
100
|
+
transform: translate(0px, -150px) var(--transform-static);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.d-animation-spinner__spinner {
|
|
104
|
+
animation: d-spinner-spin var(--d-spinner-spin-period) linear infinite;
|
|
105
|
+
}
|
|
106
|
+
@keyframes d-spinner-spin {
|
|
107
|
+
0% {
|
|
108
|
+
transform: rotate(0deg);
|
|
109
|
+
}
|
|
110
|
+
100% {
|
|
111
|
+
transform: rotate(-360deg);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import DAnimationAccordion from './DAnimationAccordion.vue'
|
|
2
|
+
import DAnimationFloatingLetter from './DAnimationFloatingLetter.vue'
|
|
3
|
+
import DAnimationHypnosis from './DAnimationHypnosis.vue'
|
|
4
|
+
import DAnimationSpinner from './DAnimationSpinner.vue'
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
DAnimationAccordion,
|
|
8
|
+
DAnimationFloatingLetter,
|
|
9
|
+
DAnimationHypnosis,
|
|
10
|
+
DAnimationSpinner
|
|
11
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useDBigBangButtonUtils } from '../../composables/big-bang-button-utils'
|
|
4
|
+
import { useLink } from '../../composables/router'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'DBigBangButton'
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
const emit = defineEmits(['click'])
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
text: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
tag: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'button'
|
|
21
|
+
},
|
|
22
|
+
to: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const { text: animationText } = useDBigBangButtonUtils()
|
|
29
|
+
|
|
30
|
+
const { linkComponent: currentTag } = useLink(props)
|
|
31
|
+
|
|
32
|
+
const symbols = computed(() => props.text.split(''))
|
|
33
|
+
|
|
34
|
+
function onClick(event: MouseEvent) {
|
|
35
|
+
animationText.value = props.text
|
|
36
|
+
emit('click', event)
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<Component :is="currentTag" :to="to" class="big-bang-button" @click="onClick">
|
|
42
|
+
<span v-for="(symbol, index) in symbols" :key="index" v-text="symbol" />
|
|
43
|
+
</Component>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style>
|
|
47
|
+
.big-bang-button {
|
|
48
|
+
@apply text-3xl font-bold uppercase cursor-pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.big-bang-button:hover > span {
|
|
52
|
+
@apply inline-block transition-all;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.big-bang-button:hover > span:nth-of-type(4n + 1) {
|
|
56
|
+
@apply rotate-12 translate-x-1 -translate-y-2;
|
|
57
|
+
}
|
|
58
|
+
.big-bang-button:hover > span:nth-of-type(4n + 2) {
|
|
59
|
+
@apply -rotate-6 translate-y-3;
|
|
60
|
+
}
|
|
61
|
+
.big-bang-button:hover > span:nth-of-type(4n + 3) {
|
|
62
|
+
@apply -rotate-12 translate-x-1 -translate-y-2;
|
|
63
|
+
}
|
|
64
|
+
.big-bang-button:hover > span:nth-of-type(4n + 4) {
|
|
65
|
+
@apply -rotate-6 translate-x-1 -translate-y-1;
|
|
66
|
+
}
|
|
67
|
+
.big-bang-button:hover > span:first {
|
|
68
|
+
@apply rotate-12 -translate-x-2 -translate-y-2;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import gsap from 'gsap'
|
|
3
|
+
import { watch, computed } from 'vue'
|
|
4
|
+
import { useDBigBangButtonUtils } from '../../composables/big-bang-button-utils'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'DBigBangButtonAnimation'
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
const paths = {
|
|
13
|
+
first: 'M 0 0 C -489.471 -116.5 -526.692 -193.268 -563.913 -311.911',
|
|
14
|
+
last: 'M 0 0 C 317.761 171.963 466.645 199.879 680.666 171.963',
|
|
15
|
+
intermediate: [
|
|
16
|
+
'M 0 0 C 36.277 125.437 19.992 358.068 -49.797 413.9',
|
|
17
|
+
'M 0 0 C 52.561 -69.974 71.171 -118.827 64.192 -446.837',
|
|
18
|
+
'M 0 0 C -3.271 137.068 -26.534 395.289 33.95 439.489'
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { text } = useDBigBangButtonUtils()
|
|
23
|
+
const symbols = computed(() => text.value.split(''))
|
|
24
|
+
|
|
25
|
+
let clearTask: NodeJS.Timeout
|
|
26
|
+
|
|
27
|
+
watch(text, (val) => {
|
|
28
|
+
clearTimeout(clearTask)
|
|
29
|
+
if (val) clearTask = setTimeout(() => (text.value = ''), 1500)
|
|
30
|
+
})
|
|
31
|
+
function pathFromIndex(i: number) {
|
|
32
|
+
if (i === 0) return paths.first
|
|
33
|
+
if (i === symbols.value.length - 1) return paths.last
|
|
34
|
+
return paths.intermediate[
|
|
35
|
+
Math.floor(Math.random() * paths.intermediate.length)
|
|
36
|
+
]
|
|
37
|
+
// return paths.intermediate[i % paths.intermediate.length]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function onEnter(el: Element, done: () => void) {
|
|
41
|
+
gsap.fromTo(
|
|
42
|
+
el,
|
|
43
|
+
{
|
|
44
|
+
opacity: 0,
|
|
45
|
+
rotateX: -90
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
opacity: 1,
|
|
49
|
+
rotateX: 0,
|
|
50
|
+
rotate: -12 + Math.random() * 24,
|
|
51
|
+
delay: Math.random() * 0.3,
|
|
52
|
+
duration: 0.2,
|
|
53
|
+
onComplete: done
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function onLeave(el: Element, done: () => void) {
|
|
59
|
+
const index = +gsap.getProperty(el, 'i')
|
|
60
|
+
gsap.to(el, {
|
|
61
|
+
motionPath: {
|
|
62
|
+
path: pathFromIndex(index)
|
|
63
|
+
},
|
|
64
|
+
opacity: 0,
|
|
65
|
+
rotate: -180 + Math.random() * 360,
|
|
66
|
+
duration: 0.2,
|
|
67
|
+
onComplete: done
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<div id="big-bang-button-animation">
|
|
74
|
+
<TransitionGroup
|
|
75
|
+
tag="div"
|
|
76
|
+
class="bbb__text-container"
|
|
77
|
+
@enter="onEnter"
|
|
78
|
+
@leave="onLeave"
|
|
79
|
+
>
|
|
80
|
+
<span
|
|
81
|
+
v-for="(symbol, index) in symbols"
|
|
82
|
+
:key="index"
|
|
83
|
+
:i="index"
|
|
84
|
+
v-text="symbol"
|
|
85
|
+
/>
|
|
86
|
+
</TransitionGroup>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<style>
|
|
91
|
+
#big-bang-button-animation {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
@apply fixed w-full h-full top-0 left-0
|
|
95
|
+
text-center uppercase text-7xl md:text-9xl font-extrabold;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#big-bang-button-animation > .bbb__text-container {
|
|
99
|
+
width: fit-content;
|
|
100
|
+
margin-left: auto;
|
|
101
|
+
margin-right: 0.5em;
|
|
102
|
+
perspective: 200px;
|
|
103
|
+
transform-origin: right top;
|
|
104
|
+
transform: rotate3d(0, 1, 0, 35deg) rotate(-12deg);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#big-bang-button-animation span {
|
|
108
|
+
@apply inline-block mx-2;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
#big-bang-button-animation span:nth-of-type(3n + 1) {
|
|
112
|
+
@apply text-neutral-900 bg-neutral-50;
|
|
113
|
+
}
|
|
114
|
+
#big-bang-button-animation span:nth-of-type(4n + 3) {
|
|
115
|
+
@apply bg-neutral-900 text-neutral-50;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HighlightVariant } from '../utils/index'
|
|
3
|
+
import DWrapFocusHighlight from '../utils/DWrapFocusHighlight.vue'
|
|
4
|
+
import { useLink } from '../../composables/router'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'DBtn',
|
|
8
|
+
components: {
|
|
9
|
+
DWrapFocusHighlight
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
to: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
href: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: undefined
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* If true, the highlight will be shown only if the link is exact string a URL.
|
|
26
|
+
*/
|
|
27
|
+
exact: Boolean,
|
|
28
|
+
/**
|
|
29
|
+
* Turn off the highlight for active links.
|
|
30
|
+
*/
|
|
31
|
+
noPassiveHighlight: Boolean,
|
|
32
|
+
/**
|
|
33
|
+
* Turn on the highlight even if the link is not active.
|
|
34
|
+
*/
|
|
35
|
+
active: Boolean,
|
|
36
|
+
noRotate: Boolean,
|
|
37
|
+
tag: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'button'
|
|
40
|
+
},
|
|
41
|
+
highlight: {
|
|
42
|
+
type: String as () => HighlightVariant,
|
|
43
|
+
default: undefined
|
|
44
|
+
},
|
|
45
|
+
colorClass: {
|
|
46
|
+
type: [String, Object as () => Record<string, boolean>],
|
|
47
|
+
default: ''
|
|
48
|
+
},
|
|
49
|
+
textTransform: {
|
|
50
|
+
type: String as () => 'uppercase' | 'capitalize' | 'lowercase' | 'none',
|
|
51
|
+
default: 'uppercase'
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
linkComponent: currentComponent,
|
|
57
|
+
isLink,
|
|
58
|
+
isExternalLink
|
|
59
|
+
} = useLink(props)
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<Component
|
|
64
|
+
:is="currentComponent"
|
|
65
|
+
class="d-btn"
|
|
66
|
+
:class="{
|
|
67
|
+
'd-btn--rotated': !noRotate,
|
|
68
|
+
'd-btn--uppercase': textTransform === 'uppercase',
|
|
69
|
+
'd-btn--capitalize': textTransform === 'capitalize',
|
|
70
|
+
'd-btn--lowercase': textTransform === 'lowercase'
|
|
71
|
+
}"
|
|
72
|
+
v-bind="props"
|
|
73
|
+
>
|
|
74
|
+
<DWrapFocusHighlight
|
|
75
|
+
:variant="highlight"
|
|
76
|
+
:link-exact="exact"
|
|
77
|
+
:no-passive-link="noPassiveHighlight || !isLink || isExternalLink"
|
|
78
|
+
:color-class="colorClass"
|
|
79
|
+
:active="active"
|
|
80
|
+
>
|
|
81
|
+
<slot />
|
|
82
|
+
</DWrapFocusHighlight>
|
|
83
|
+
</Component>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style>
|
|
87
|
+
.d-btn {
|
|
88
|
+
@apply font-extrabold select-none relative inline-block cursor-pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.d-btn--rotated {
|
|
92
|
+
@apply -rotate-6;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.d-btn--uppercase {
|
|
96
|
+
@apply uppercase;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.d-btn--capitalize {
|
|
100
|
+
@apply capitalize;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.d-btn--lowercase {
|
|
104
|
+
@apply lowercase;
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DCard',
|
|
6
|
+
components: {
|
|
7
|
+
DWrapShape
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
defineProps({
|
|
14
|
+
mode: {
|
|
15
|
+
type: String as () => 'default' | 'homepage-story' | 'homepage-skills',
|
|
16
|
+
default: 'default'
|
|
17
|
+
},
|
|
18
|
+
dense: Boolean
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<DWrapShape
|
|
24
|
+
:shape-class="{
|
|
25
|
+
card__bg: !dense,
|
|
26
|
+
'card__bg--dense': dense
|
|
27
|
+
}"
|
|
28
|
+
:class="{
|
|
29
|
+
'card--homepage-story force-light': mode === 'homepage-story',
|
|
30
|
+
'card--homepage-skills force-light': mode === 'homepage-skills',
|
|
31
|
+
card: mode === 'default'
|
|
32
|
+
}"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
:class="{
|
|
36
|
+
card__content: !dense,
|
|
37
|
+
'card__content--dense': dense
|
|
38
|
+
}"
|
|
39
|
+
>
|
|
40
|
+
<slot />
|
|
41
|
+
</div>
|
|
42
|
+
</DWrapShape>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
.card__content,
|
|
47
|
+
.card__content--dense {
|
|
48
|
+
@apply md:text-lg;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.card__content {
|
|
52
|
+
padding: var(--shape-card-padding);
|
|
53
|
+
@apply print:p-0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.card__content--dense {
|
|
57
|
+
padding: var(--shape-card--dense__padding);
|
|
58
|
+
@apply print:p-0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card--homepage-story .card__content,
|
|
62
|
+
.card--homepage-skills .card__content {
|
|
63
|
+
@apply text-black;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.force-light :is(.card__bg, .card__bg--dense) {
|
|
67
|
+
@apply !bg-white dark:bg-white;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.card--homepage-story :is(.card__bg, .card__bg--dense) {
|
|
71
|
+
background: var(--d-card-x-ray--idle__color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.card--homepage-skills :is(.card__bg, .card__bg--dense) {
|
|
75
|
+
background: var(--d-card-x-ray--action__color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.card__bg,
|
|
79
|
+
.card__bg--dense {
|
|
80
|
+
@apply bg-white dark:bg-neutral-700
|
|
81
|
+
print:bg-none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.card__bg {
|
|
85
|
+
clip-path: var(--shape-card);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.card__bg--dense {
|
|
89
|
+
clip-path: var(--shape-card--dense);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media print {
|
|
93
|
+
.card__bg {
|
|
94
|
+
clip-path: none !important;
|
|
95
|
+
background: none !important;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DCardTitle',
|
|
6
|
+
components: {
|
|
7
|
+
DWrapShape
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="card__title">
|
|
14
|
+
<DWrapShape
|
|
15
|
+
class="card__title__content"
|
|
16
|
+
shape-class="card__title__content__shape"
|
|
17
|
+
>
|
|
18
|
+
<h3 class="card__title__content__text">
|
|
19
|
+
<slot />
|
|
20
|
+
</h3>
|
|
21
|
+
</DWrapShape>
|
|
22
|
+
<span class="ml-2 print:text-neutral-600">
|
|
23
|
+
<slot name="extra" />
|
|
24
|
+
</span>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.card__title {
|
|
30
|
+
@apply text-2xl md:text-3xl font-semibold -mt-5 mb-3
|
|
31
|
+
print:text-base print:ml-0 print:mb-0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.card__title__content {
|
|
35
|
+
@apply inline-block -ml-10
|
|
36
|
+
print:ml-0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card__title__content__text {
|
|
40
|
+
@apply p-5 text-white dark:text-black
|
|
41
|
+
print:p-0 print:text-inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.card__title__content__shape {
|
|
45
|
+
clip-path: polygon(
|
|
46
|
+
0.4em 0.4em,
|
|
47
|
+
100% 0%,
|
|
48
|
+
calc(100% - 0.4em) calc(100% - 0.4em),
|
|
49
|
+
0% 100%
|
|
50
|
+
);
|
|
51
|
+
@apply bg-black dark:bg-white
|
|
52
|
+
print:bg-transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.force-light .card__title__content__text {
|
|
56
|
+
@apply dark:text-white;
|
|
57
|
+
}
|
|
58
|
+
.force-light .card__title__content__shape {
|
|
59
|
+
@apply dark:bg-black;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media print {
|
|
63
|
+
.card__title__content__shape {
|
|
64
|
+
clip-path: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|