This commit is contained in:
felix
2025-11-27 03:54:38 +00:00
committed by Felix
6 changed files with 93 additions and 31 deletions

View File

@@ -42,6 +42,7 @@ Page({
facePosition: 'normal' as 'up' | 'down' | 'normal',
// SVG data for avatar
avatarSvgData: '',
photoSvgData: '',
scrollTop: 0
},
@@ -58,6 +59,7 @@ Page({
console.error('登录检查失败:', error)
})
this.generateAvatarSvg()
this.generatePhotoSvg()
},
// Generate SVG data URL for avatar
@@ -76,6 +78,30 @@ Page({
});
},
generatePhotoSvg() {
const svgString = `
<svg viewBox="0 0 2000 960" width="500" height="240" xmlns="http://www.w3.org/2000/svg">
<path transform="translate(59,243)" d="m0 0h16l8 5 7 9 4 8 3 15 8 87 6 62 12 109 7 59 2 15 8-24 11-21 11-17 9-11 10-9 16-11 12-6 20-6 19-2 19 1 16 4 11 5 16 9 11 9 10 9 10 13 11 18 8 16 5 17 7 29 2 19 1 16v12l-2 28-4 24-6 22-7 19-12 28-13 21-16 21-12 13-14 11-21 12-19 8-17 5-18 3h-25l-15-3-18-7-13-7-13-10-9-12-8-17-6-20-5-23-8-51-24-122-9-60-8-60-5-43-8-92-6-74v-29l4-10 6-7 8-5z" fill="#4D4848"/>
<path transform="translate(1026,96)" d="m0 0h7l10 3 8 7 6 11 3 14 2 33 2 115 3 62 5 57 5 37 4 23v4h2l1-11 4-15 5-12 8-15 11-15 10-11 13-10 14-8 16-6 16-3 17-1 17 2 13 4 12 5 13 7 12 9 13 13 10 15 8 14 8 20 6 25 3 18 1 11v35l-2 29-4 24-6 20-8 20-12 25-8 14-11 15-8 10-11 12-11 11-14 9-25 12-20 6-10 2h-29l-18-4-15-6-13-7-12-11-8-10-8-14-7-20-6-26-6-37-6-35-8-39-6-32-8-54-4-29-6-56-3-37-2-40-1-35-1-65v-29l1-21 3-18 5-10 9-8 5-2z" fill="#4D4848"/>
<path transform="translate(1740,245)" d="m0 0h10l16 3 13 5 17 9 14 11 12 12 8 14 5 18 2 17 3 56 3 29 5 26 6 23 8 21 9 17 10 13 8 7 7 4 8 1 11-4 11-8 12-10 10-4 12 1 10 5 7 8 3 10v8l-3 12-6 11-9 10-10 8-15 8-12 3-7 1h-27l-16-4-16-8-13-8-13-12-10-14-9-20-2-1-3 12-6 16-12 22-8 12-8 10-9 10-12 10-13 8-12 6-16 4h-26l-16-4-14-6-13-9-12-11-9-10-10-17-8-19-7-28-3-20-1-11v-22l3-29 6-31 8-28 8-22 11-24 11-22 10-16 10-13 12-14 10-9 14-10 19-9 12-3z" fill="#4D4848"/>
<path transform="translate(794,392)" d="m0 0h9l16 3 19 7 14 8 11 9 9 10 8 14 5 14 2 13 3 69 4 40 5 25 7 21 12 23 10 14 8 8 12 6h10l10-5 12-12 9-6 3-1h14l8 4 9 8 4 8 1 3v17l-3 10-6 10-7 7-14 8-18 6-12 2h-25l-17-4-16-7-14-9-10-9-14-24-7-14-2-1-3 10-9 24-8 16-7 11-9 10-12 12-13 10-13 8-16 6-17 3h-19l-15-3-10-4-10-6-13-10-9-9-12-17-9-17-6-17-4-19-2-15-1-15v-21l2-28 4-26 6-25 12-36 10-23 9-17 14-20 9-11 15-15 10-9 14-9 12-6 17-5z" fill="#4D4848"/>
<path transform="translate(1408,40)" d="m0 0h13l8 3 5 5 4 5 4 8 2 9v30l-6 98-2 42-1 38v103l2 43 4 46 5 39 5 29 8 32 8 24 9 16 9 10 6 4 3 1h8l11-4 9-8 6-8 8-11 8-10 7-5 4-1h17l10 5 6 7 4 10v14l-4 13-7 13-8 11-9 10-9 8-15 9-16 6-15 3h-24l-15-4-17-8-10-8-9-9-12-17-9-16-9-21-7-23-9-41-8-45-6-41-3-36-2-32-1-30v-98l2-54 6-89 3-32 4-18 7-14 8-7z" fill="#4D4848"/>
<path transform="translate(460,186)" d="m0 0 9 1 8 5 6 7 5 10 3 11 1 9v44l-4 71-2 65v67l2 48 4 53 5 45 6 38 8 37 8 27 10 25 6 10 8 9 6 4 6 2h8l10-5 5-4 10-13 9-13 6-7 9-5 4-1h12l10 4 8 9 4 8 1 4v14l-3 12-6 10-9 13-7 8-14 11-12 7-18 7-15 3h-21l-15-3-13-5-12-8-10-9-9-12-14-24-8-17-12-36-6-23-10-50-12-91-3-28-1-16-1-37v-78l1-46 4-91 3-35 4-18 5-10 7-7 7-4z" fill="#4D4848"/>
<path transform="translate(249,568)" d="m0 0 14 1 10 4 10 9 6 7 8 15 6 18 4 17 2 17v34l-3 26-6 25-8 21-8 17-13 19-12 13-9 8-11 7-19 9-15 4h-21l-8-3-4-6-3-12-1-7-1-25v-28l2-28 5-35 5-26 7-27 7-20 10-19 8-11 9-10 8-7 11-5z" fill="#FEFDE2"/>
<path transform="translate(1194,416)" d="m0 0h7l10 3 11 7 7 7 8 13 7 16 5 22 2 20v29l-3 22-5 24-8 24-8 16-8 14-9 11-9 10-7 7-13 10-10 6-16 7-8 2h-14l-8-5-7-8-4-11-2-11-1-13v-31l2-25 4-29 8-43 7-24 8-19 8-15 10-14 9-10 11-7 11-4z" fill="#FEFDE2"/>
<path transform="translate(1737,307)" d="m0 0h13l10 5 7 8 5 10 2 9 1 16v60l-3 28-5 25-7 27-10 25-10 19-9 13-12 12-8 5-7 2h-10l-9-3-10-9-6-10-6-20-2-12-1-14v-25l2-23 5-26 7-25 9-24 11-24 10-18 9-12 8-9 9-7z" fill="#FEFDE2"/>
<path transform="translate(789,454)" d="m0 0h13l10 3 5 5 4 10 3 18 1 12v45l-3 33-4 25-8 34-7 20-11 23-8 12-11 12-9 6-6 2h-13l-10-4-6-5-7-11-6-15-4-19-2-18v-25l4-29 6-26 9-27 9-21 10-19 10-15 12-14 10-8 5-3z" fill="#FEFDE2"/>
</svg>
`.trim();
const encodedSvg = encodeURIComponent(svgString);
const dataUrl = `data:image/svg+xml;utf8,${encodedSvg}`;
this.setData({
photoSvgData: dataUrl
});
},
onShow() {
// 每次显示页面时检查登录状态和清理处理状态
this.updateLoginStatus()

View File

@@ -68,7 +68,9 @@
</view>
<view class="photo-wrapper">
<view class="photo">
<view class="photo-inner"></view>
<view class="photo-inner">
<image class="photo-image" src="{{photoSvgData}}" mode="aspectFit"></image>
</view>
</view>
</view>
<t-action-sheet id="t-action-sheet" bind:selected="handleSelected" />

View File

@@ -815,12 +815,12 @@ position:relative;
.lens-shutter::after {
content: " ";
position: absolute;
top: 0;
left: 50%;
height: 100%;
width: 50%;
top: -120%;
height: 340%;
width: 170%;
transition: .5s all linear;
/* animation: shutter 2.0s infinite ease-in-out; */
animation: shutter 10.0s infinite ease-in-out;
background:
linear-gradient(-150deg, transparent 52%, #000 calc(52% + 2rpx) calc(52% + 4rpx), grey calc(52% + 6rpx)) bottom/100% 40% no-repeat,
linear-gradient(150deg, transparent 52%, #000 calc(52% + 2rpx) calc(52% + 4rpx), grey calc(52% + 6rpx)),
@@ -832,12 +832,12 @@ position:relative;
.lens-shutter::before {
content: " ";
position: absolute;
top: 0;
left: 50%;
height: 100%;
width: 50%;
top: -120%;
height: 340%;
width: 170%;
transition: .5s all linear;
/* animation: shutter 2.0s infinite ease-in-out; */
animation: shutter 10.0s infinite ease-in-out;
background:
linear-gradient(-150deg, transparent 52%, #000 calc(52% + 2rpx) calc(52% + 4rpx), grey calc(52% + 6rpx)) bottom/100% 40% no-repeat,
linear-gradient(150deg, transparent 52%, #000 calc(52% + 2rpx) calc(52% + 4rpx), grey calc(52% + 6rpx)),
@@ -846,11 +846,17 @@ position:relative;
}
@keyframes shutter {
0%, 100% {
0% {
top: -120%;
height: 340%;
width: 170%;
opacity: 0;
} 10% {
top: 0;
height: 100%;
width: 50%;
} 50% {
opacity: 1;
} 20%, 100% {
top: -120%;
height: 340%;
width: 170%;
@@ -901,10 +907,12 @@ position:relative;
.photo-wrapper {
position: relative;
box-shadow: 0 4rpx 6rpx rgba(0, 0, 0, 0.2);
bottom: 12rpx;
left: 0rpx;
width: 264rpx;
height: 284rpx;
/* height: 284rpx; */
height: 568rpx;
overflow: hidden;
}
@@ -921,34 +929,60 @@ position:relative;
/* box-shadow: 0 4rpx 6rpx rgba(0, 0, 0, 0.1); */
overflow: hidden;
z-index: 2;
animation: reveal 5s;
}
.photo-inner {
position: relative;
width: 100%;
height: 100%;
background-color: black;
filter: blur(10rpx) brightness(0%) saturate(0%);
transform: translateY(-100%);
animation: reveal 10s infinite ease-out;
}
@keyframes reveal {
0% {
transform: translateY(-100%);
}
30% {
20% {
transform: translateY(-100%);
}
80% {
transform: translateY(0);
30% {
transform: translateY(0%);
opacity: 1;
}
85% {
transform: translateY(0%);
opacity: 1;
}
95% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 0;
transform: translateY(100%);
transform: translateY(-100%);
}
}
.photo-inner {
position: relative;
width: 100%;
height: 100%;
background-color: #FEFDE2;
filter: blur(10rpx) brightness(0%) saturate(0%);
animation: showphoto 10s infinite ease-out;
}
@keyframes showphoto {
0%, 25% {
filter: blur(10rpx) brightness(0%) saturate(0%);
}
35%, 90% {
filter: blur(0rpx) brightness(100%) saturate(100%);
}
100% {
filter: blur(10rpx) brightness(0%) saturate(0%);
}
}
.photo-image {
width: 100%;
height: 100%;
}
.lens-outer{
width: 80rpx;
height: 80rpx;

8
package-lock.json generated
View File

@@ -8,7 +8,7 @@
"name": "miniprogram-ts-less-quickstart",
"version": "25.9.10",
"dependencies": {
"tdesign-miniprogram": "^1.11.0"
"tdesign-miniprogram": "^1.11.2"
},
"devDependencies": {
"miniprogram-api-typings": "^2.8.3-1"
@@ -22,9 +22,9 @@
"license": "MIT"
},
"node_modules/tdesign-miniprogram": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.11.0.tgz",
"integrity": "sha512-1Siv2HVrSVlFiQBQXEjBrCvvsC3NQUsGgiej2RDXOxXHAPH2nynLhJhK+wu+KptzXi5GV+XYr+PHV2Je8vgW3w==",
"version": "1.11.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/tdesign-miniprogram/-/tdesign-miniprogram-1.11.2.tgz",
"integrity": "sha512-lXcry3vRa9jHzjpOdIxuIAh7F85kImym82VwLbCqr/TkMhycOsOepx+r1S9fum7u2nsWiYRTV+HuvDHN3KlIuA==",
"license": "MIT"
}
}

View File

@@ -10,6 +10,6 @@
"miniprogram-api-typings": "^2.8.3-1"
},
"dependencies": {
"tdesign-miniprogram": "^1.11.0"
"tdesign-miniprogram": "^1.11.2"
}
}

View File

@@ -18,7 +18,7 @@
"checkInvalidKey": true,
"ignoreDevUnusedFiles": true
},
"libVersion": "2.33.0",
"libVersion": "3.11.2",
"condition": {
"miniprogram": {
"list": [