@energie360/ui-library 0.1.31 → 0.1.33
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/components/badge/badge.scss +11 -4
- package/components/badge/u-badge.vue +3 -13
- package/components/card-amount/u-card-amount.vue +1 -1
- package/components/card-amount-illustrated/u-card-amount-illustrated.vue +1 -1
- package/components/card-contact/u-card-contact.vue +1 -1
- package/components/card-highlight/u-card-highlight.vue +2 -2
- package/components/card-price-list/u-card-price-list.vue +2 -2
- package/components/card-statistic/card-statistic.scss +31 -0
- package/components/card-statistic/u-card-statistic.vue +34 -0
- package/components/chip/chip.scss +1 -0
- package/components/chip/u-chip.vue +1 -0
- package/components/download-list-item/u-download-list-item.vue +1 -0
- package/components/empty/empty.scss +27 -0
- package/components/empty/u-empty.vue +32 -0
- package/components/hint/hint.scss +144 -33
- package/components/hint/u-hint.vue +44 -4
- package/components/index.js +2 -0
- package/components/navigation-panel-tile/navigation-panel-tile.scss +0 -18
- package/components/navigation-panel-tile/u-navigation-panel-tile.vue +8 -7
- package/components/navigation-toolbar-link/u-navigation-toolbar-link.vue +2 -2
- package/components/progress-avatar/u-progress-avatar.vue +1 -1
- package/components/slider/u-slider.vue +1 -1
- package/components/slider-progress-animation/u-slider-progress-animation.vue +1 -1
- package/components/table/table-cell.scss +9 -0
- package/components/table/u-cell-icon-group.vue +1 -1
- package/components/table/u-cell-progress-bar.vue +1 -1
- package/components/table/u-table-cell.vue +3 -0
- package/components/text-block/u-text-block.vue +1 -1
- package/dist/base-style.css +2 -2
- package/elements/button/u-button.vue +2 -1
- package/layout/portal-block/portal-block.scss +36 -3
- package/layout/portal-block/u-portal-block.vue +9 -3
- package/modules/dialog/dialog.scss +28 -23
- package/modules/dialog/u-dialog.vue +14 -17
- package/modules/index.js +1 -0
- package/modules/login-animation/butterfly-sprite.json +9 -0
- package/modules/login-animation/butterfly-sprite.png +0 -0
- package/modules/login-animation/login-animation.scss +65 -0
- package/modules/login-animation/u-login-animation.vue +74 -0
- package/modules/navigation-toolbar-top/u-navigation-toolbar-top.vue +24 -2
- package/package.json +9 -9
- package/utils/http/url.js +25 -0
- package/utils/vue/helpers.ts +27 -0
- package/wizard/wizard-outro/u-wizard-outro.vue +3 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { UIcon } from '../../elements'
|
|
4
|
-
|
|
5
|
-
type
|
|
4
|
+
import UBadge from '../../components/badge/u-badge.vue'
|
|
5
|
+
import type { Badge } from '../badge/u-badge.vue'
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
active?: boolean
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
greyed?: boolean
|
|
12
12
|
href?: string
|
|
13
13
|
icon?: string
|
|
14
|
-
|
|
14
|
+
badge?: Badge
|
|
15
15
|
target?: string
|
|
16
16
|
title?: string
|
|
17
17
|
}
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
const {
|
|
20
20
|
description = '',
|
|
21
21
|
icon = '',
|
|
22
|
-
|
|
22
|
+
badge = undefined,
|
|
23
23
|
title = '',
|
|
24
24
|
href = '',
|
|
25
25
|
target = '_self',
|
|
@@ -53,9 +53,10 @@ const tag = computed(() => (href ? 'a' : 'div'))
|
|
|
53
53
|
|
|
54
54
|
<div class="navigation-panel-tile__icon-column">
|
|
55
55
|
<div v-if="icon" class="navigation-panel-tile__icon-wrapper">
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
<UBadge v-if="badge" v-bind="badge">
|
|
57
|
+
<UIcon :name="icon" />
|
|
58
|
+
</UBadge>
|
|
59
|
+
<UIcon v-else :name="icon" />
|
|
59
60
|
</div>
|
|
60
61
|
</div>
|
|
61
62
|
</component>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, watch, computed, useTemplateRef } from 'vue'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import UIcon from '../../elements/icon/u-icon.vue'
|
|
4
|
+
import UBadge from '../../components/badge/u-badge.vue'
|
|
5
5
|
import { Badge } from '../badge/u-badge.vue'
|
|
6
6
|
|
|
7
7
|
// TODO: Label animation when collapsed is a mess. Refactor it as soon as possbile!
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onMounted, useTemplateRef, ref } from 'vue'
|
|
3
3
|
import { Image } from '../../elements/types'
|
|
4
|
-
import
|
|
4
|
+
import UCircularProgress from '../circular-progress/u-circular-progress.vue'
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
image: Image
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { watch, useId, useTemplateRef, onMounted, ref } from 'vue'
|
|
3
3
|
import { scaleValue } from '../../utils/math/scale-value'
|
|
4
4
|
import { clamp } from '../../utils/math/clamp'
|
|
5
|
-
import
|
|
5
|
+
import UTooltip from '../tooltip/u-tooltip.vue'
|
|
6
6
|
|
|
7
7
|
interface SliderDot {
|
|
8
8
|
value: number
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onMounted, onUnmounted, ref, useTemplateRef } from 'vue'
|
|
3
3
|
import '@lottiefiles/lottie-player'
|
|
4
|
-
import
|
|
4
|
+
import USlider from '../slider/u-slider.vue'
|
|
5
5
|
import { Slider } from '../slider/u-slider.vue'
|
|
6
6
|
import { Image } from '../../elements/types'
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import UIcon from '../../elements/icon/u-icon.vue'
|
|
3
3
|
import UTooltip from '../tooltip/u-tooltip.vue'
|
|
4
|
-
import
|
|
4
|
+
import UBadge from '../badge/u-badge.vue'
|
|
5
5
|
import { Badge } from '../badge/u-badge.vue'
|
|
6
6
|
import { TableCellIconColor } from './table.type'
|
|
7
7
|
|
|
@@ -7,6 +7,7 @@ interface Props extends TableCellBase {
|
|
|
7
7
|
infoText?: string
|
|
8
8
|
textStyle?: TableCellTextStyle
|
|
9
9
|
nowrap?: boolean
|
|
10
|
+
dotColor?: string
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const {
|
|
@@ -15,6 +16,7 @@ const {
|
|
|
15
16
|
hAlign = TableCellHAlign.left,
|
|
16
17
|
vAlign = TableCellVAlign.center,
|
|
17
18
|
nowrap = false,
|
|
19
|
+
dotColor = '',
|
|
18
20
|
} = defineProps<Props>()
|
|
19
21
|
</script>
|
|
20
22
|
|
|
@@ -24,6 +26,7 @@ const {
|
|
|
24
26
|
:class="['table-cell', `h-align-${hAlign}`, `v-align-${vAlign}`, { 'has-tooltip': infoText }]"
|
|
25
27
|
>
|
|
26
28
|
<div :class="['cell-content', `text-${textStyle}`, { nowrap }]">
|
|
29
|
+
<span v-if="dotColor" class="table-cell__dot" :style="{ backgroundColor: dotColor }"></span>
|
|
27
30
|
<slot><span v-html="text" /></slot>
|
|
28
31
|
</div>
|
|
29
32
|
|
package/dist/base-style.css
CHANGED
|
@@ -317,8 +317,8 @@ body {
|
|
|
317
317
|
--e-c-signal-02-700-rgb: 204, 122, 0;
|
|
318
318
|
--e-c-signal-02-900: #703600;
|
|
319
319
|
--e-c-signal-02-900-rgb: 112, 54, 0;
|
|
320
|
-
--e-c-signal-03-100: #
|
|
321
|
-
--e-c-signal-03-100-rgb: 255,
|
|
320
|
+
--e-c-signal-03-100: #ffccd7;
|
|
321
|
+
--e-c-signal-03-100-rgb: 255, 204, 215;
|
|
322
322
|
--e-c-signal-03-500: #ff0c3e;
|
|
323
323
|
--e-c-signal-03-500-rgb: 255, 12, 62;
|
|
324
324
|
--e-c-signal-03-700: #b90d31;
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
.portal-block {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
&.bottom-space-0 {
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&.bottom-space-100 {
|
|
7
|
+
margin-bottom: var(--e-space-6);
|
|
8
|
+
}
|
|
4
9
|
|
|
5
|
-
&.
|
|
10
|
+
&.bottom-space-300 {
|
|
6
11
|
margin-bottom: var(--e-space-10);
|
|
7
12
|
}
|
|
13
|
+
|
|
14
|
+
&.bottom-space-500 {
|
|
15
|
+
margin-bottom: var(--e-space-16);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.bottom-space-700 {
|
|
19
|
+
margin-bottom: var(--e-space-28);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.top-space-0 {
|
|
23
|
+
margin-top: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.top-space-100 {
|
|
27
|
+
margin-top: var(--e-space-6);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.top-space-300 {
|
|
31
|
+
margin-top: var(--e-space-10);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.top-space-500 {
|
|
35
|
+
margin-top: var(--e-space-16);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.top-space-700 {
|
|
39
|
+
margin-top: var(--e-space-28);
|
|
40
|
+
}
|
|
8
41
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/*
|
|
3
|
+
Preferably only use `bottom-space`.
|
|
4
|
+
`top-space` can make sense for last portal-block for example.
|
|
5
|
+
This works because parent container is `display: block`, meaning that the vertical margins will collapse.
|
|
6
|
+
*/
|
|
2
7
|
interface Props {
|
|
3
8
|
big?: boolean
|
|
4
|
-
|
|
9
|
+
bottomSpace?: '0' | '100' | '300' | '500' | '700'
|
|
10
|
+
topSpace?: '0' | '100' | '300' | '500' | '700'
|
|
5
11
|
}
|
|
6
12
|
|
|
7
|
-
const {
|
|
13
|
+
const { bottomSpace = '100', topSpace = '0' } = defineProps<Props>()
|
|
8
14
|
</script>
|
|
9
15
|
|
|
10
16
|
<template>
|
|
11
|
-
<div :class="['portal-block', space]">
|
|
17
|
+
<div :class="['portal-block', `bottom-space-${bottomSpace}`, `top-space-${topSpace}`]">
|
|
12
18
|
<slot />
|
|
13
19
|
</div>
|
|
14
20
|
</template>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
.dialog-container {
|
|
6
6
|
--overflow-gradient-height: var(--e-space-10);
|
|
7
|
+
--dialog-max-width: #{a.rem(540)};
|
|
7
8
|
|
|
8
9
|
padding: 0;
|
|
9
10
|
border: 0;
|
|
@@ -26,18 +27,6 @@
|
|
|
26
27
|
opacity: 0.4;
|
|
27
28
|
animation: fade-in-backdrop var(--e-trs-duration-faster) var(--e-trs-easing-default);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
&.has-header-image {
|
|
31
|
-
.dialog__header-image-container {
|
|
32
|
-
display: flex;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.has-content-image {
|
|
37
|
-
.dialog__content-image {
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
30
|
}
|
|
42
31
|
|
|
43
32
|
.dialog {
|
|
@@ -47,14 +36,22 @@
|
|
|
47
36
|
overflow: auto;
|
|
48
37
|
scrollbar-width: none;
|
|
49
38
|
border-radius: var(--e-brd-radius-3);
|
|
50
|
-
padding: var(--e-space-
|
|
39
|
+
padding: var(--e-space-8) var(--e-space-8) 0;
|
|
51
40
|
height: a.rem(670);
|
|
52
41
|
max-height: 80vh;
|
|
53
|
-
max-width:
|
|
42
|
+
max-width: var(--dialog-max-width);
|
|
54
43
|
min-width: a.rem(480);
|
|
55
44
|
|
|
56
|
-
&.
|
|
45
|
+
&.fit-height {
|
|
57
46
|
height: auto;
|
|
47
|
+
|
|
48
|
+
.cta-container {
|
|
49
|
+
margin-top: 0;
|
|
50
|
+
|
|
51
|
+
&::after {
|
|
52
|
+
content: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
* + .dialog__content-image {
|
|
@@ -67,13 +64,14 @@
|
|
|
67
64
|
min-width: 0;
|
|
68
65
|
height: auto;
|
|
69
66
|
min-height: a.rem(440);
|
|
67
|
+
padding-top: var(--e-space-6);
|
|
70
68
|
padding-left: var(--e-space-5);
|
|
71
69
|
padding-right: var(--e-space-5);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
.dialog__header-image-container {
|
|
76
|
-
display:
|
|
74
|
+
display: flex;
|
|
77
75
|
justify-content: center;
|
|
78
76
|
height: a.rem(184);
|
|
79
77
|
margin-bottom: var(--e-space-8);
|
|
@@ -105,8 +103,6 @@
|
|
|
105
103
|
}
|
|
106
104
|
|
|
107
105
|
.dialog__content-image {
|
|
108
|
-
display: none;
|
|
109
|
-
|
|
110
106
|
img {
|
|
111
107
|
width: 100%;
|
|
112
108
|
}
|
|
@@ -116,10 +112,10 @@
|
|
|
116
112
|
position: sticky;
|
|
117
113
|
display: flex;
|
|
118
114
|
flex-direction: column;
|
|
119
|
-
|
|
115
|
+
gap: var(--e-space-4) var(--e-space-3);
|
|
120
116
|
bottom: 0;
|
|
121
117
|
margin-top: var(--overflow-gradient-height);
|
|
122
|
-
padding: var(--e-space-8) var(--e-space-1) var(--e-space-
|
|
118
|
+
padding: var(--e-space-8) var(--e-space-1) var(--e-space-8);
|
|
123
119
|
background-color: var(--e-c-mono-00);
|
|
124
120
|
|
|
125
121
|
&::after {
|
|
@@ -132,13 +128,22 @@
|
|
|
132
128
|
background-image: linear-gradient(0deg, rgb(255 255 255 / 100%) 0%, rgb(255 255 255 / 0%) 100%);
|
|
133
129
|
}
|
|
134
130
|
|
|
131
|
+
&.cta-inline {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-columns: 1fr 1fr;
|
|
134
|
+
}
|
|
135
|
+
|
|
135
136
|
@include a.bp(m) {
|
|
136
|
-
padding: var(--e-space-8) 0 var(--e-space-
|
|
137
|
+
padding: var(--e-space-8) 0 var(--e-space-6);
|
|
138
|
+
|
|
139
|
+
&.cta-inline {
|
|
140
|
+
display: flex;
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
// MOBILE "MODAL" Variant
|
|
141
|
-
.dialog-container.modal {
|
|
146
|
+
.dialog-container.variant-modal {
|
|
142
147
|
@include a.bp(m) {
|
|
143
148
|
padding-left: a.rem(a.$container-edge-m);
|
|
144
149
|
padding-right: a.rem(a.$container-edge-m);
|
|
@@ -151,7 +156,7 @@
|
|
|
151
156
|
}
|
|
152
157
|
|
|
153
158
|
// MOBILE "SLIDE-OUT" Variant
|
|
154
|
-
.dialog-container.slideout {
|
|
159
|
+
.dialog-container.variant-slideout {
|
|
155
160
|
@include a.bp(m) {
|
|
156
161
|
align-items: flex-end;
|
|
157
162
|
|
|
@@ -11,9 +11,10 @@ interface Props {
|
|
|
11
11
|
headerImage?: Image
|
|
12
12
|
contentImage?: Image
|
|
13
13
|
closeBtnLabel?: string
|
|
14
|
-
autoHeight?: boolean
|
|
15
14
|
modal?: boolean
|
|
16
15
|
mobileDialogStyle?: 'modal' | 'slideout'
|
|
16
|
+
ctaInline?: boolean
|
|
17
|
+
fitHeight?: boolean
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const {
|
|
@@ -24,6 +25,8 @@ const {
|
|
|
24
25
|
contentImage = undefined,
|
|
25
26
|
mobileDialogStyle = 'modal',
|
|
26
27
|
closeBtnLabel = getTranslation('close'),
|
|
28
|
+
ctaInline = false,
|
|
29
|
+
fitHeight = false,
|
|
27
30
|
} = defineProps<Props>()
|
|
28
31
|
|
|
29
32
|
const visible = defineModel<boolean>('visible')
|
|
@@ -84,18 +87,11 @@ watch(visible, (newV) => {
|
|
|
84
87
|
<dialog
|
|
85
88
|
ref="dialog"
|
|
86
89
|
closedby="none"
|
|
87
|
-
:class="[
|
|
88
|
-
'dialog-container',
|
|
89
|
-
mobileDialogStyle,
|
|
90
|
-
{
|
|
91
|
-
'has-header-image': !!slots['header-image'] || (headerImage?.src && headerImage?.alt),
|
|
92
|
-
'has-content-image': !!slots['content-image'] || contentImage,
|
|
93
|
-
},
|
|
94
|
-
]"
|
|
90
|
+
:class="['dialog-container', `variant-${mobileDialogStyle}`]"
|
|
95
91
|
>
|
|
96
|
-
<div :class="['dialog', { '
|
|
97
|
-
<div class="dialog__header-image-container">
|
|
98
|
-
<slot name="
|
|
92
|
+
<div :class="['dialog', { 'fit-height': fitHeight }]">
|
|
93
|
+
<div v-if="!!slots.headerImage || headerImage" class="dialog__header-image-container">
|
|
94
|
+
<slot name="headerImage">
|
|
99
95
|
<img v-bind="headerImage" />
|
|
100
96
|
</slot>
|
|
101
97
|
</div>
|
|
@@ -119,16 +115,17 @@ watch(visible, (newV) => {
|
|
|
119
115
|
<slot name="custom"></slot>
|
|
120
116
|
</div>
|
|
121
117
|
|
|
122
|
-
<div class="dialog__content-image">
|
|
123
|
-
<slot name="
|
|
118
|
+
<div v-if="!!slots.contentImage || contentImage" class="dialog__content-image">
|
|
119
|
+
<slot name="contentImage">
|
|
124
120
|
<img v-bind="contentImage" />
|
|
125
121
|
</slot>
|
|
126
122
|
</div>
|
|
127
123
|
</div>
|
|
128
124
|
|
|
129
|
-
<div class="cta-container">
|
|
130
|
-
<slot name="cta"
|
|
131
|
-
|
|
125
|
+
<div :class="['cta-container', { 'cta-inline': ctaInline }]">
|
|
126
|
+
<slot name="cta">
|
|
127
|
+
<UButton @click="visible = false">{{ closeBtnLabel || getTranslation('close') }}</UButton>
|
|
128
|
+
</slot>
|
|
132
129
|
</div>
|
|
133
130
|
</div>
|
|
134
131
|
</dialog>
|
package/modules/index.js
CHANGED
|
@@ -9,3 +9,4 @@ export { default as UToast, toast } from './toast/u-toast.vue'
|
|
|
9
9
|
export { default as UDialog } from './dialog/u-dialog.vue'
|
|
10
10
|
export { default as USearchFilter } from './search-filter/u-search-filter.vue'
|
|
11
11
|
export { default as UContentTitle } from './content-title/u-content-title.vue'
|
|
12
|
+
export { default as ULoginAnimation } from './login-animation/u-login-animation.vue'
|
|
Binary file
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
$sprite-width: 52px;
|
|
4
|
+
$sprite-height: 77px;
|
|
5
|
+
$sprite-width-mobile: 40px;
|
|
6
|
+
$sprite-height-mobile: 59px;
|
|
7
|
+
|
|
8
|
+
@keyframes island-image {
|
|
9
|
+
0% {
|
|
10
|
+
transform: translateY(-10px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
100% {
|
|
14
|
+
transform: translateY(10px);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.login-animation {
|
|
19
|
+
background-color: var(--e-c-secondary-01-1000);
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.login-animation__image {
|
|
27
|
+
position: relative;
|
|
28
|
+
max-width: 680px;
|
|
29
|
+
margin: 0 60px;
|
|
30
|
+
|
|
31
|
+
img {
|
|
32
|
+
user-select: none;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
display: block;
|
|
35
|
+
width: 100%;
|
|
36
|
+
animation-name: island-image;
|
|
37
|
+
animation-iteration-count: infinite;
|
|
38
|
+
animation-duration: 1.6s;
|
|
39
|
+
animation-direction: alternate;
|
|
40
|
+
animation-timing-function: ease-in-out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include a.bp(lg) {
|
|
44
|
+
margin: 0 40px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include a.bp(m) {
|
|
48
|
+
margin: 0 20px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.login-animation__sprite {
|
|
53
|
+
position: absolute;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
top: calc(50% - (#{$sprite-height} / 2) + 10%);
|
|
56
|
+
left: calc(50% - (#{$sprite-width} / 2) + 10%);
|
|
57
|
+
|
|
58
|
+
@include a.bp(m) {
|
|
59
|
+
width: $sprite-width-mobile;
|
|
60
|
+
height: $sprite-height-mobile;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.flip {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { USpriteAnimation } from '../../components'
|
|
3
|
+
import { useTemplateRef, ref } from 'vue'
|
|
4
|
+
import butterflySpritePositions from './butterfly-sprite.json'
|
|
5
|
+
import butterflySprite from './butterfly-sprite.png'
|
|
6
|
+
import { gsap } from 'gsap'
|
|
7
|
+
|
|
8
|
+
const butterfly = useTemplateRef('butterfly')
|
|
9
|
+
const butterflyWrapper = useTemplateRef('butterflyWrapper')
|
|
10
|
+
const container = useTemplateRef('container')
|
|
11
|
+
const mouseRightSide = ref(true)
|
|
12
|
+
|
|
13
|
+
const onSpriteReady = () => {
|
|
14
|
+
butterfly.value.playLoop()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const onMouseleave = () => {
|
|
18
|
+
gsap.to(butterflyWrapper.value, {
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0,
|
|
21
|
+
ease: 'power2',
|
|
22
|
+
duration: 4,
|
|
23
|
+
overwrite: true,
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const onMousemove = (e) => {
|
|
28
|
+
const { left, top, width, height } = container.value.getBoundingClientRect()
|
|
29
|
+
|
|
30
|
+
const halfW = width / 2
|
|
31
|
+
const halfH = height / 2
|
|
32
|
+
const mouseX = e.x - left
|
|
33
|
+
const mouseY = e.y - top
|
|
34
|
+
|
|
35
|
+
mouseRightSide.value = mouseX > halfW
|
|
36
|
+
|
|
37
|
+
const x = gsap.utils.interpolate(-halfW, halfW, mouseX / width)
|
|
38
|
+
const y = gsap.utils.interpolate(-halfH, halfH, mouseY / height)
|
|
39
|
+
|
|
40
|
+
gsap.to(butterflyWrapper.value, {
|
|
41
|
+
x: x,
|
|
42
|
+
y: y,
|
|
43
|
+
duration: 4,
|
|
44
|
+
ease: 'power1',
|
|
45
|
+
overwrite: true,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<div ref="container" class="login-animation" @mousemove="onMousemove" @mouseleave="onMouseleave">
|
|
52
|
+
<div class="login-animation__image">
|
|
53
|
+
<div ref="butterflyWrapper" :class="['login-animation__sprite', { flip: !mouseRightSide }]">
|
|
54
|
+
<USpriteAnimation
|
|
55
|
+
ref="butterfly"
|
|
56
|
+
:style="{
|
|
57
|
+
transform: mouseRightSide ? 'scaleX(1)' : 'scaleX(-1)',
|
|
58
|
+
}"
|
|
59
|
+
:spritesheet-path="butterflySprite"
|
|
60
|
+
:frame-positions="butterflySpritePositions"
|
|
61
|
+
:frame-width="202"
|
|
62
|
+
:frame-height="300"
|
|
63
|
+
:width="52"
|
|
64
|
+
:height="77"
|
|
65
|
+
:duration="1000"
|
|
66
|
+
@ready="onSpriteReady"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
<img src="/static/ui-assets/images/forest.png" alt="" />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<style lang="scss" scoped src="./login-animation.scss"></style>
|
|
@@ -23,24 +23,38 @@ interface Props {
|
|
|
23
23
|
|
|
24
24
|
defineProps<Props>()
|
|
25
25
|
|
|
26
|
+
const model = defineModel<boolean>({ default: false })
|
|
27
|
+
|
|
26
28
|
const mobilePanelEl = useTemplateRef('mobile-panel')
|
|
27
29
|
const mobileOpen = ref(false)
|
|
28
30
|
const isMobilePanelOpening = ref(false)
|
|
29
31
|
const isMobilePanelClosing = ref(false)
|
|
30
32
|
|
|
31
|
-
const
|
|
33
|
+
const openPanel = () => {
|
|
32
34
|
mobilePanelEl.value?.addEventListener('transitionend', onMobilePanelTransitionEnd)
|
|
33
35
|
|
|
34
36
|
document.documentElement.classList.toggle('navigation-toolbar-mobile-open', true)
|
|
35
37
|
isMobilePanelOpening.value = true
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
const
|
|
40
|
+
const closePanel = () => {
|
|
39
41
|
mobilePanelEl.value?.addEventListener('transitionend', onMobilePanelTransitionEnd)
|
|
40
42
|
|
|
41
43
|
isMobilePanelClosing.value = true
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
const onToggleMenu = () => {
|
|
47
|
+
openPanel()
|
|
48
|
+
|
|
49
|
+
model.value = true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const onNavClose = () => {
|
|
53
|
+
closePanel()
|
|
54
|
+
|
|
55
|
+
model.value = false
|
|
56
|
+
}
|
|
57
|
+
|
|
44
58
|
const onMobilePanelTransitionEnd = (e) => {
|
|
45
59
|
if (e.target !== mobilePanelEl.value) {
|
|
46
60
|
return
|
|
@@ -58,6 +72,14 @@ const onMobilePanelTransitionEnd = (e) => {
|
|
|
58
72
|
watch(mobileOpen, (newV) => {
|
|
59
73
|
document.documentElement.classList.toggle('navigation-toolbar-mobile-open', newV)
|
|
60
74
|
})
|
|
75
|
+
|
|
76
|
+
watch(model, (newV) => {
|
|
77
|
+
if (newV === true) {
|
|
78
|
+
openPanel()
|
|
79
|
+
} else {
|
|
80
|
+
closePanel()
|
|
81
|
+
}
|
|
82
|
+
})
|
|
61
83
|
</script>
|
|
62
84
|
|
|
63
85
|
<template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@energie360/ui-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"author": "",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"@lottiefiles/dotlottie-web": "^0.60.0",
|
|
27
28
|
"@tsconfig/node22": "^22.0.5",
|
|
28
|
-
"@types/node": "^
|
|
29
|
-
"@vue/tsconfig": "^0.
|
|
30
|
-
"autoprefixer": "^10.4.
|
|
31
|
-
"chokidar": "^
|
|
29
|
+
"@types/node": "^25.0.3",
|
|
30
|
+
"@vue/tsconfig": "^0.8.1",
|
|
31
|
+
"autoprefixer": "^10.4.23",
|
|
32
|
+
"chokidar": "^5.0.0",
|
|
32
33
|
"postcss": "^8.5.6",
|
|
33
|
-
"sass": "^1.
|
|
34
|
+
"sass": "^1.97.1",
|
|
34
35
|
"typescript": "^5.9.3"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@lottiefiles/dotlottie-vue": "^0.10.
|
|
38
|
-
"@lottiefiles/dotlottie-web": "^0.58.1",
|
|
38
|
+
"@lottiefiles/dotlottie-vue": "^0.10.12",
|
|
39
39
|
"@lottiefiles/lottie-player": "^2.0.12",
|
|
40
|
-
"gsap": "^3.14.
|
|
40
|
+
"gsap": "^3.14.2",
|
|
41
41
|
"@energie360/design-tokens": "^1.3.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|