File size: 2,822 Bytes
8ede856
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<template>
    <div class="welcome-container fade-in">
        <div v-if="isLoading" class="loading-overlay-welcome">
            <v-progress-circular
                indeterminate
                size="48"
                width="4"
                color="primary"
            ></v-progress-circular>
        </div>
        <template v-else>
            <div class="welcome-content">
                <div class="welcome-title">
                    <span class="bot-name-container">
                        <span class="bot-name-text">
                            Hello, I'm <span class="highlight-name">AstrBot</span>
                        </span>
                        <span class="bot-name-star"></span>
                    </span>
                </div>
            </div>
            <div class="welcome-input">
                <slot></slot>
            </div>
        </template>
    </div>
</template>

<script setup lang="ts">
interface Props {
    isLoading?: boolean;
}

withDefaults(defineProps<Props>(), {
    isLoading: false
});
</script>

<style scoped>
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-container {
    height: 100%;
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
}

.welcome-content {
    padding: 24px 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-title {
    font-size: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-input {
    width: 75%;
}

.loading-overlay-welcome {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bot-name-container {
    display: flex;
    align-items: center;
}

.highlight-name {
    color: var(--v-theme-secondary);
    font-weight: 700;
}

.bot-name-text {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    opacity: 0;
    animation: revealText 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
}

.bot-name-star {
    margin-left: 0;
    display: inline-block;
    transform-origin: center;
    animation: rotateStar 1.2s cubic-bezier(0.34, 1, 0.64, 1) forwards;
    animation-delay: 0.2s;
    padding-left: 4px;
}

@keyframes revealText {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 9.2em;
        opacity: 1;
    }
}

@keyframes rotateStar {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@media (max-width: 600px) {
    .welcome-input {
        width: 100%;
    }
}
</style>