Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/lanecarford_front
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped

This commit is contained in:
X1627315083
2025-12-29 14:43:03 +08:00
16 changed files with 225 additions and 92 deletions

View File

@@ -59,3 +59,19 @@ export const googleAuth = (data: GoogleAuthParamsType): Promise<LoginResponse> =
params: data
})
}
/** 更改用户信息
* @param data 包含用户信息的对象
* @param data.username 用户名
* @param data.email 邮箱
* @param data.password 密码
* @returns 包含更新后的用户信息的对象
*/
export const updateUserInfo = (data: any) => {
return request({
url: '/api/auth/updateUserInfo',
method: 'post',
data
})
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,9 +1,7 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="44" height="44" fill="url(#pattern0_27_31213)"/>
<defs>
<pattern id="pattern0_27_31213" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_27_31213" transform="scale(0.0078125)"/>
</pattern>
<image id="image0_27_31213" width="128" height="128" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACdpJREFUeJztnXmsXUUdxz9vgVff6ysSw1Yr4bmgQaDWxAJqoWnFgoW6YkQrMXE3BmONRomKC+ASlX8QgohEgoAIKkFU6lYLAoq4gQUiVSi0arW12+vy2tfrH783uWfmzLnnLme7c36fZBLeOefO/Mr3d85sv5kBpdYMlW1ATiwF3gE8G3gUOFiqNUqhrAIakfT9cs1RimQWsA3bARrAwjKNqjKDZRuQMUuBwzzXX1+0IUo5fIP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org/2000/svg" viewBox="0 0 880 860.38">
<path d="M0,778.02v-31c5.85-.83,5.72-6.77,7.59-9.91,8.69-14.56,35.82-36.92,48.91-50.09,132.41-133.33,265.22-266.72,399-399,24.48-24.21,50.22-64.36,90.41-43.4,11.6,6.05,52.53,47.35,62.07,58.93,36.58,44.38-10.81,75.6-38.98,103.98-134.47,135.49-269.91,271.36-406,406-16.26,16.09-36.44,43.61-60.47,46.53-29.22,3.55-48.2-22.96-66.04-41.03-9.24-9.36-21.12-18.28-28.34-29.66-2.17-3.42-2.85-10.44-8.15-11.35ZM411.35,365.37c-2.17,2.21-15.35,15.62-15.83,16.67-.89,1.93-.9,4.04,0,5.97,13.11,12.89,26.45,25.54,39.5,38.49,9.43,9.36,18.54,18.95,28.02,27.98,3.81,3.63,7.06,10.05,13.42,10.57l111.05-110.01c8.1-9.65,12.08-18.21,5.33-30.36-3.97-7.14-45.89-48.98-53.82-55.18-15.22-11.91-27.19-3.82-38.92,7.13-29.56,27.59-60.23,59.7-88.75,88.75ZM45.35,731.37c-11.89,12.23-27.69,25.33-17.21,44.01,4.11,7.33,43.34,46.29,51.36,52.64,12.24,9.71,22.88,9.89,35.03.02l338.5-338.5c2.02-1.93,3.87-4.47,2.24-7.24l-76.71-77.33c-6.81-3.73-7.97,2-11.53,5.57-106.81,107.19-216.25,212.35-321.68,320.82Z"/>
<path d="M880,334.02v17c-5.37-.47-7.34,5.21-11.28,7.22-8.66,4.42-23.83,6.25-34.09,10.91-26.75,12.14-29.6,29.14-37.9,54.1-3.19,9.58-7.95,22.23-20.19,21.83-17.04-.55-18.67-24.85-23.04-37.04-6.38-17.79-17.31-31.49-34.79-39.21-12.9-5.7-50.73-9.57-44.24-30.86,4.1-13.47,23.9-15.02,35.08-18.92,23.2-8.09,37.12-22.61,45.17-45.83,3.07-8.85,4.36-25.17,12.91-31.09,13.68-9.47,24.05,3.61,28.11,15.65,5.67,16.79,7.2,30.82,20.37,44.63,16.19,16.99,35.71,15.07,53.62,24.38,3.37,1.75,6.17,6.34,10.28,7.22ZM776.74,289.16c-4.56.64-5.93,9.79-7.87,13.23-4.92,8.72-16.76,21.22-24.93,27.07-3.39,2.43-27.4,12.25-17.91,17.04,1.57.79,3.84.48,5.69,1.3,14.82,6.58,27.91,19.11,36.1,32.9,2.41,4.06,4.1,13.24,9.67,13.25,5.06.01,6.38-9.04,8.68-13.25,7.33-13.41,22.11-26.66,36.1-32.9,2.84-1.26,8.25-.22,7.76-5.23-.43-4.4-10.52-7.04-13.94-9.15-10.29-6.37-25.31-20.31-30.97-31.03-1.68-3.19-3.2-13.95-8.4-13.22Z"/>
<path d="M372.75.26c17.02-2.7,21.7,16.54,25.74,28.78.66,2,.35,4.18.97,6.03,13.37,39.65,24.62,56.65,65.57,70.43,12.7,4.27,34.46,6.35,40.83,19.17,3.04,6.11.84,15.15-3.82,19.9-7.28,7.4-39.68,13.7-51.41,18.59-18.8,7.84-36.26,25.05-44.04,43.96-4.84,11.74-11.29,45.73-19.62,52.38-9.65,7.7-21.8,4.05-27.82-6.11-7.31-12.34-9.82-36.44-16.95-51.05-15.65-32.09-39.88-37.6-70.19-47.81-6.54-2.2-20.02-5.97-23.84-11.16-7.42-10.08-4.71-18.67,3.87-26.8,29-11.22,57.77-13.95,78.99-39.01,16.65-19.67,17.52-40.92,26.48-63.52,2.43-6.14,8.52-12.7,15.25-13.77ZM373.63,45.09c-3.49,2.24-2.14,6.63-3.08,9.98-8.8,31.51-36.03,59.55-66.76,70.24-3.39,1.18-14.11,1.7-14.73,5.33-.78,4.51,19.66,9.4,23.63,11.19,23.74,10.71,47.33,35.36,55.8,60.2,1.49,4.36,1.94,11.23,3.41,14.59.55,1.24.82,2.54,2.58,2.47,1.5-.08,2.17-1.03,2.94-2.13,3.14-4.52,5.53-17.08,8.16-22.84,9.96-21.83,30.88-42.46,52.72-52.28,5.99-2.69,14.22-4.36,20.1-6.9,13.11-5.67-3.32-7.16-6.66-8.15-28.02-8.37-54.24-31.06-66.23-57.77-1.97-4.39-6.53-21.22-8.95-23.05-.95-.72-1.67-1.23-2.94-.86Z"/>
<path d="M636.71,457.23c20.94-4.69,20.95,15.78,25.59,28.99,5.11,14.55,14.97,26.74,29.53,32.47,9.09,3.58,25.95,5.73,31.6,13.4,9.34,12.66-1.53,22.37-13.25,26.61-18.27,6.61-33.98,7.98-43.9,28.1-6.28,12.74-8.15,46.13-30.23,38.68-10.99-3.71-14.09-28.07-18.87-38.13-5.97-12.57-17.69-20.98-30.64-25.36-3.51-1.19-7.43-1.16-10.72-2.28-6.67-2.26-17.88-7.24-18.84-15.15-2.53-20.97,22.31-20.38,35.96-26.09,8.39-3.51,21.6-16.31,25.26-24.74,4.28-9.87,6.48-33.79,18.51-36.49ZM676.76,545.79c5.98-5.71-8.51-11.82-11.7-14.33-6.14-4.82-12.27-10.92-16.47-17.53-1.39-2.19-3.02-9.96-6.08-9.97-2.5,0-11.59,15.35-14.51,18.56-5.69,6.22-13.07,9.73-19.02,14.98-8.94,7.88,1.05,8.3,5.39,10.67,4.81,2.63,14.75,12.4,18.08,16.92,2.63,3.58,6.01,13.02,10.06,13.03s3.7-4.8,5.7-8.4c2.93-5.27,16.66-19.78,21.87-22.13,1.99-.9,5.35-.52,6.69-1.81Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,13 +1,23 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent'
const router = useRouter()
defineProps({
title: { type: String, default: 'STYLING ASSISTANT' }
title: { type: String, default: 'STYLING ASSISTANT' },
})
const emit = defineEmits(['clickReturn', 'clickProfile'])
const profileVisible = ref(false)
const handleProfileVisibleChange = (visible) => {
profileVisible.value = visible
}
MyEvent.add('change-profile-visible',handleProfileVisibleChange)
const handleClickReturn = () => {
router.back()
// emit('clickReturn')
@@ -22,7 +32,9 @@
<div class="header-title">
<div class="return" @click="handleClickReturn"><SvgIcon name="return" size="34" /></div>
<span class="title">{{ title }}</span>
<div class="profile" @click="handleClickProfile"><SvgIcon name="profile" size="45" /></div>
<div class="profile" @click="handleClickProfile">
<SvgIcon :name="profileVisible ? 'profileFilledBlack' : 'profile_white'" size="45" />
</div>
</div>
</template>

View File

@@ -3,6 +3,7 @@
const props = defineProps({
loading: { default: false, type: Boolean },
finish: { default: false, type: Boolean },
empty: { default: false, type: Boolean },
pel: { default: () => {}, type: Function }
})
const emit = defineEmits(['load'])
@@ -23,12 +24,13 @@
})
</script>
<template>
<div class="my-list" ref="el">
<div class="my-list" ref="el" :class="{ empty: !loading && empty }">
<slot></slot>
<div class="footer">
<p v-show="!loading" class="placeholder" ref="placeholder"></p>
<span class="loading" v-show="loading">Loading...</span>
<span class="nomore" v-show="finish">No more</span>
<span class="loading" v-if="loading">Loading...</span>
<span class="empty" v-else-if="empty">Nothing Here</span>
<span class="nomore" v-else-if="finish">No more</span>
</div>
</div>
</template>
@@ -40,12 +42,28 @@
> .footer {
width: 100%;
font-size: 3rem;
color: #000;
color: #a1a1a1;
text-align: center;
margin: var(--my-list-footer-margin, 0);
> .placeholder {
height: 1px;
}
> .empty {
font-size: 4rem;
}
}
&.empty {
> .footer {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
padding: 0;
margin: 0;
> .empty {
margin-bottom: 5rem;
}
}
}
}
</style>

View File

@@ -7,7 +7,6 @@ class MyEvent {
MyEvent.list = MyEvent.list.filter(item => item.name != name && item.call != call)
}
emit(name, data) {
console.log('Myevent触发--',name)
MyEvent.list.forEach(item => {
if (item.name == name) item.call(data)
})

View File

@@ -268,7 +268,12 @@
</div>
</div>
<div class="list">
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
<my-list
v-model:loading="loading"
v-model:finish="finish"
@load="onLoad"
:empty="list.length === 0"
>
<div
class="item"
v-for="(v, i) in list"

View File

@@ -121,7 +121,9 @@
</script>
<template>
<div class="loading" v-if="loading"><generate-loading /></div>
<div class="loading" v-if="loading">
<generate-loading title="Generating Results..." />
</div>
<div class="customize" v-else>
<div class="title">Customize your Look!</div>
<p class="tip">Refine your Look</p>

View File

@@ -47,7 +47,7 @@
cancelButtonText: 'Cancel'
}).catch(() => 0)
if (res === 0) return
console.log(obj,i)
console.log(obj, i)
deleteCustomerPhoto(obj.visitRecordId)
.then(() => {
list.splice(i, 1)
@@ -68,7 +68,12 @@
<div class="library">
<div class="title">Library</div>
<div class="list">
<my-list v-model:loading="loading" v-model:finish="finish" @load="onLoad">
<my-list
v-model:loading="loading"
v-model:finish="finish"
:empty="list.length === 0"
@load="onLoad"
>
<div class="item" v-for="(v, i) in list" :key="v.visitRecordId">
<div class="image">
<img v-lazy="v.defaultImageUrl" />
@@ -115,18 +120,18 @@
}
> .title {
font-family: satoshiRegular;
font-size: 9rem;
font-family: satoshiBold;
font-size: 8.9rem;
text-align: left;
line-height: 124%;
margin: 5rem;
margin: 5rem 9.1rem;
}
> .list {
flex: 1;
overflow: hidden;
margin: 0 3rem;
margin: 0 4.5rem;
> .my-list {
padding: 0 3.8rem;
padding: 0 4.5rem;
--my-list-footer-margin: 2rem 0;
> .item {
position: relative;

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { ref, reactive, onMounted, inject } from 'vue'
import router from '@/router'
import { showConfirmDialog } from 'vant'
import { showConfirmDialog, showToast } from 'vant'
import { useUserInfoStore, useOverallStore } from '@/stores'
import { LogOut } from '@/api/login'
import { getCustomerList, type CustomerListParams,customerCheckin } from '@/api/workshop'
import { getCustomerList, type CustomerListParams, customerCheckin } from '@/api/workshop'
import MyEvent from '@/utils/myEvent'
import { encryptPassword } from '@/utils/tools'
import { updateUserInfo } from '@/api/login'
const props = defineProps<{
isCustomer?: boolean
@@ -17,11 +19,14 @@ const emit = defineEmits(['selected-customer'])
const show = ref(false)
const isEdit = ref(false)
const form = reactive({
name: { msg: '', value: userInfoStore.state.userInfo.username },
email: { msg: '', value: userInfoStore.state.userInfo.email },
password: { show: false, msg: '', value: userInfoStore.state.userInfo.password }
name: { msg: '', value: '' },
email: { msg: '', value: '' },
password: { show: true, msg: '', value: '' }
})
const open = () => {
form.name.value = userInfoStore.state.userInfo.username
form.email.value = userInfoStore.state.userInfo.email
form.password.value = ''
isEdit.value = false
show.value = true
}
@@ -41,14 +46,38 @@ const switchCustomer = () => {
handleShowPopup(true)
}
const edit = () => {
form.password.value = ''
isEdit.value = true
}
const confirm = () => {
if (!isEdit.value) return
const password = form.password.value
const params = {
username: form.name.value,
email: form.email.value,
password
}
if (password) {
if (password.length < 6) {
return showToast('Password must be at least 6 characters')
} else {
params.password = encryptPassword(password)
}
} else {
params.password = userInfoStore.state.userInfo.password
}
overallStore.setLoading(true)
setTimeout(() => {
updateUserInfo(params).then((res) => {
overallStore.setLoading(false)
showToast('Update success')
userInfoStore.setUserInfo({
...userInfoStore.state.userInfo,
...params
})
form.password.value = ''
isEdit.value = false
}, 1000)
})
}
const logout = () => {
showConfirmDialog({
@@ -137,6 +166,7 @@ const onScroll = (e: Event) => {
// 打开customer选择时关闭profile弹窗 如果不是点击confirem关闭则重新打开profile弹窗
const handleShowPopup = (flag: boolean) => {
showSwitchCustomerPopup.value = flag
if (props.isCustomer) return
show.value = !flag
if (flag) {
loadCustomers(true)
@@ -152,7 +182,7 @@ const handleSelectCustomer = () => {
if (selectedCustomer) {
emit('selected-customer', selectedCustomer)
}
if(!props.isCustomer){
if (!props.isCustomer) {
// show.value = true
customerCheckin({ nickname: selectedCustomer.name }).then((res) => {
useUserInfoStore().resetGenerateParams()
@@ -168,15 +198,15 @@ const handleFetchCustomerList = () => {
}
MyEvent.add('update-customer-list', handleFetchCustomerList)
const openSwitchCustomerPopup = (flag = true) => {
showSwitchCustomerPopup.value = flag
}
// const openSwitchCustomerPopup = (flag = true) => {
// showSwitchCustomerPopup.value = flag
// }
onMounted(() => {
handleFetchCustomerList()
})
defineExpose({ open, close, openSwitchCustomerPopup })
defineExpose({ open, close, handleShowPopup })
</script>
<template>
@@ -186,7 +216,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
<span class="title">Profile</span>
<van-icon name="cross" class="close" @click="close" />
</div>
<div class="box">
<form class="box" @submit.prevent.stop="confirm">
<div class="form-item">
<div class="label">Your Name</div>
<label class="input">
@@ -196,6 +226,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
placeholder="Enter your name"
v-model="form.name.value"
:readonly="!isEdit"
required
/>
<!-- <div class="icon" v-if="isEdit" @click.stop="onSaveItem('name')">
<SvgIcon name="confirmation" size="37" />
@@ -226,7 +257,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
</label>
<p class="error" v-show="form.email.msg">{{ form.email.msg }}</p>
</div>
<div class="form-item">
<div class="form-item" v-if="isEdit">
<div class="label">Password</div>
<label class="input">
<div class="icon" @click="form.password.show = !form.password.show">
@@ -249,7 +280,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
</div>
<template v-if="isEdit">
<button class="confirm" @click="confirm">Confirm</button>
<button type="submit" class="confirm">Confirm</button>
<p class="tip">Powered by AiDLab for Lane Crawford</p>
</template>
<template v-else>
@@ -257,7 +288,7 @@ defineExpose({ open, close, openSwitchCustomerPopup })
<button class="edit" @click="edit">Edit Profile</button>
<button class="logout" @click="logout">Log out</button>
</template>
</div>
</form>
</div>
</van-popup>
<van-popup
@@ -289,12 +320,13 @@ defineExpose({ open, close, openSwitchCustomerPopup })
<img v-show="item.checked" class="checked-icon" src="@/assets/images/checked.png" />
</div>
</div>
</div>
<div class="list-footer">
<div v-if="pager.loading">Loading...</div>
<div v-else-if="pager.noMore">No more</div>
<div class="list-footer">
<div v-if="pager.loading">Loading...</div>
<div v-else-if="pager.noMore">No more</div>
</div>
</div>
<div class="confirm-btn" @click="handleSelectCustomer">Confirm</div>
<div class="van-safe-area-bottom"></div>
</van-popup>
</template>

View File

@@ -55,6 +55,7 @@ const goToLogin = () => {
.title {
font-family: 'satoshiMedium';
line-height: 120%;
font-size: 11rem;
// letter-spacing: -0.02em;
}
.subtitle {

View File

@@ -5,7 +5,11 @@
>
<div class="setting flex flex-between">
<SvgIcon name="left" size="70" @click.stop="handleBack" />
<SvgIcon name="profile_white" size="55" @click="handleOpenProfile" />
<SvgIcon
:name="profileVisible ? 'profileFilledWhite' : 'profile_white'"
size="55"
@click="handleOpenProfile"
/>
</div>
<template v-if="pageMode === 'entry'">
<div class="content flex-1 flex flex-center flex-column">
@@ -58,14 +62,19 @@
</div>
</template>
<Profile ref="profileRef" @selected-customer="handleSelectCustomer" is-customer />
<Profile
ref="profileRef"
@change-visible="handleChangeVisible"
@selected-customer="handleSelectCustomer"
is-customer
/>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { useGenerateStore, useUserInfoStore } from '@/stores'
import { showToast } from 'vant'
import { showToast, closeToast } from 'vant'
import { customerCheckin, createCustomer, type CreateCustomerParams } from '@/api/workshop'
import Profile from '../Workshop/profile.vue'
import MyEvent from '@/utils/myEvent'
@@ -77,11 +86,12 @@ const handleOpenProfile = () => {
const router = useRouter()
const generateStore = useGenerateStore()
const loading = ref(false)
type PageMode = 'form' | 'entry' | 'create'
const pageMode = ref<PageMode>('entry')
const formTitle = computed(() => {
return pageMode.value === 'entry' ? 'Customer ID' : 'Create Profile'
return pageMode.value === 'entry' || pageMode.value === 'form' ? 'Customer ID' : 'Create Profile'
})
const handleChangeMode = (mode: PageMode) => {
@@ -95,50 +105,45 @@ const customerData = ref({
})
const handleConfirm = async () => {
if (pageMode.value === 'form') {
if (customerData.value.nickname === '') {
showToast({
message: 'please input the nickname'
})
return
}
if (loading.value) return
const nickname = (customerData.value.nickname || '').trim()
const vipId = (customerData.value.vipId || '').trim()
customerCheckin({ nickname: customerData.value.nickname }).then((res) => {
useUserInfoStore().resetGenerateParams()
generateStore.setCustomerInfo(res)
MyEvent.emit('clear-generate-state')
router.push('/workshop/home')
})
} else {
if (customerData.value.vipId === '') {
showToast({
message: 'please input the VIP ID'
})
return
}
if (customerData.value.nickname === '') {
showToast({
message: 'please input the nickname'
})
return
}
if (!nickname) {
showToast({ message: 'please input the nickname' })
return
}
createCustomer({
nickname: customerData.value.nickname,
vipId: customerData.value.vipId
} as CreateCustomerParams).then((res) => {
showToast({
message: 'Customer created successfully'
})
handleBack()
if (pageMode.value === 'create' && !vipId) {
showToast({ message: 'please input the VIP ID' })
return
}
loading.value = true
showToast({ message: 'Processing...', duration: 0, type: 'loading' })
try {
if (pageMode.value === 'create') {
await createCustomer({ nickname, vipId } as CreateCustomerParams)
showToast({ message: 'Customer created successfully' })
MyEvent.emit('update-customer-list')
})
}
const res = await customerCheckin({ nickname })
useUserInfoStore().resetGenerateParams()
generateStore.setCustomerInfo(res)
MyEvent.emit('clear-generate-state')
router.push('/workshop/home')
} catch (err: any) {
showToast({ message: err?.message || 'Operation failed' })
} finally {
loading.value = false
closeToast()
}
}
const handleShowPopup = (flag: Boolean) => {
// showPopup.value = flag
profileRef.value.openSwitchCustomerPopup(flag)
profileRef.value.handleShowPopup(flag)
}
const handleSelectCustomer = (value) => {
@@ -147,6 +152,11 @@ const handleSelectCustomer = (value) => {
}
}
const profileVisible = ref(false)
const handleChangeVisible = (visible: boolean) => {
profileVisible.value = visible
}
const handleBack = (e?: Event) => {
if (e) {
e.stopPropagation()

View File

@@ -220,7 +220,7 @@ onUnmounted(() => {
background-size: cover;
background-position: center;
background-repeat: no-repeat;
padding: 6rem 0 0 0;
padding: 15.9rem 0 0 0;
.content {
.loading-container {
:deep(.loading-image) {
@@ -229,10 +229,11 @@ onUnmounted(() => {
animation: none;
}
:deep(.loading-shadow) {
background-color: #000;
width: 9.2rem;
height: 2.4rem;
filter: blur(6px);
opacity: 0.5;
opacity: 0.2;
margin: 2.4rem 0 0;
// background-color: #d9d9d9;
}
@@ -247,8 +248,10 @@ onUnmounted(() => {
font-weight: 700;
line-height: 1.12;
background: #b3b3b3;
background: linear-gradient(120deg, #b3b3b3 1%, rgba(0, 0, 0, 0) 48%),
linear-gradient(344deg, #b3b3b2 16%, #000000 66%);
background: radial-gradient(80.79% 50% at 50% 50%, #d1c7c2 0%, rgba(255, 255, 255, 0) 100%),
radial-gradient(99.56% 93.08% at 99.56% 93.08%, #e6e6e6 0%, #000000 100%)
/* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */,
linear-gradient(120.09deg, #b3b3b3 0%, rgba(255, 255, 255, 0) 35.41%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
@@ -325,7 +328,7 @@ onUnmounted(() => {
text-align: center;
border-radius: 4.6rem;
padding: 0 2.15rem;
&.active{
&.active {
background-color: #f5f5f5;
}
}

View File

@@ -166,7 +166,7 @@ const handleContinue = () => {
display: flex;
flex-direction: column;
padding: 2rem;
padding-top: 6rem;
padding-top: 10rem;
}
.header {
@@ -178,6 +178,8 @@ const handleContinue = () => {
color: white;
line-height: 96%;
font-family: 'satoshiBold';
letter-spacing: -0.04rem;
margin-bottom: 3.2rem;
}
.sub-title{
font-family: 'satoshiRegular';

View File

@@ -59,11 +59,14 @@ const handleSelect = (value: string) => {
font-weight: 700;
font-size: 11rem;
line-height: 106%;
letter-spacing: -0.02rem;
margin-bottom: 4.6rem;
}
.desc {
font-family: 'satoshiRegular';
font-size: 4rem;
font-size: 6rem;
line-height: 132%;
letter-spacing: 0.02rem;
}
.select-list {
display: flex;