Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-12-22 14:28:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
98765d8a48a76c08a248f3262f8031dc30c67b58
98765d8a
1 parent
561017bd
feat(StarryBackground): 根据微信移动端调整星星和流星参数
针对微信移动端优化性能,调整星星数量、移动速度和流星效果参数
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
src/components/effects/StarryBackground.vue
src/components/effects/StarryBackground.vue
View file @
98765d8
...
...
@@ -4,6 +4,13 @@
</div>
</template>
<script>
import { wxInfo } from '@/utils/tools';
const { isMobile, isWeiXin } = wxInfo();
const isWxMobile = isMobile && isWeiXin;
</script>
<script setup>
import { ref, onMounted, onUnmounted, computed } from 'vue';
...
...
@@ -21,7 +28,7 @@ const props = defineProps({
// 星星数量
starCount: {
type: Number,
default:
5
00
default:
isWxMobile ? 800 : 8
00
},
// 星星颜色 (RGBA 前缀,例如 '255,255,255')
starColor: {
...
...
@@ -31,22 +38,22 @@ const props = defineProps({
// 星星移动速度系数 (值越大移动越快)
starSpeed: {
type: Number,
default: 1
default:
isWxMobile ? 1 : 0.
1
},
// 流星速度 - 水平分量 (负值向左,正值向右)
meteorVx: {
type: Number,
default:
-5
default:
isWxMobile ? -10 : -2
},
// 流星速度 - 垂直分量 (正值向下)
meteorVy: {
type: Number,
default:
5
default:
isWxMobile ? 10 : 2
},
// 流星拖尾长度系数 (值越大尾巴越长)
meteorTrail: {
type: Number,
default:
5
default:
isWxMobile ? 4 : 10
}
});
...
...
Please
register
or
login
to post a comment