光照分析

This commit is contained in:
2025-11-07 11:19:34 +08:00
parent 4f0a18b29a
commit ec3d708e1c
2 changed files with 52 additions and 4 deletions

View File

@ -49,12 +49,16 @@
</div> </div>
</div> </div>
<div class="iconCon"> <div class="iconCon">
<div class="item_icon" v-for="(item, index) in timelist" :key="index"> <div
class="item_icon"
v-for="(item, index) in timelist"
:key="index"
@click="clickTimeIcon(item)"
>
<svg-icon <svg-icon
:name="item.svg" :name="item.svg"
:size="20" :size="20"
:color="!item.status ? 'rgba(255, 255, 255, 1)' : 'rgba(var(--color-base1), 1)'" :color="!item.status ? 'rgba(255, 255, 255, 1)' : 'rgba(var(--color-base1), 1)'"
@click="clickIcon(item)"
></svg-icon> ></svg-icon>
<div> <div>
<span :class="['icon_text', !item.status ? '' : 'active']">{{ item.name }}</span> <span :class="['icon_text', !item.status ? '' : 'active']">{{ item.name }}</span>
@ -146,12 +150,11 @@
<span class="text_two">可叠加以下天气类型</span> <span class="text_two">可叠加以下天气类型</span>
</div> </div>
<div class="weather_content_body"> <div class="weather_content_body">
<div class="item_icon" v-for="(item, index) in list" :key="index"> <div class="item_icon" v-for="(item, index) in list" :key="index" @click="clickIcon(item)">
<svg-icon <svg-icon
:name="item.svg" :name="item.svg"
:size="20" :size="20"
:color="!item.status ? 'rgba(255, 255, 255, 1)' : 'rgba(var(--color-base1), 1)'" :color="!item.status ? 'rgba(255, 255, 255, 1)' : 'rgba(var(--color-base1), 1)'"
@click="clickIcon(item)"
></svg-icon> ></svg-icon>
<div> <div>
<span :class="['icon_text', !item.status ? '' : 'active']">{{ item.name }}</span> <span :class="['icon_text', !item.status ? '' : 'active']">{{ item.name }}</span>
@ -386,6 +389,28 @@ var clickIcon = (item: any) => {
}) })
} }
} }
var clickTimeIcon = (item: any) => {
if (document.getElementById('timePause').textContent == '播放') {
timelist.forEach((data) => {
if (data.name != item.name) data.status = false
})
item.status = true
} else {
timelist.forEach((data) => {
data.status = false
})
}
let arr = {
清晨: '6:40',
正午: '12:00',
黄昏: '19:15',
夜晚: '24:00'
}
timeline.setTime(arr[item.name])
timeline.setSpeed(weatherData.speed)
sunshine && (sunshine.timeBar = arr[item.name] + ':00')
}
var changDarkness = () => { var changDarkness = () => {
sunshine && (sunshine.darkness = weatherData.darkness) sunshine && (sunshine.darkness = weatherData.darkness)
@ -579,6 +604,7 @@ var shadowChange = () => {
top: -200%; top: -200%;
transform: translateY(-100%); transform: translateY(-100%);
color: rgba(255, 223, 83, 1); color: rgba(255, 223, 83, 1);
cursor: auto;
} }
#timePause { #timePause {

View File

@ -219,6 +219,28 @@ export default class TimeLine {
// this.update(); // this.update();
} }
setTime(time) {
// 解析传入的时间字符串 "6:40"
const [hours, minutes] = time.split(':').map(Number);
// 设置秒数为0
const seconds = 0;
// 计算传入时间总秒数
const totalSeconds = (hours * 3600) + (minutes * 60) + seconds;
// 24小时总秒数
const totalSecondsInDay = 24 * 3600;
// 计算百分比
const pos = totalSeconds / totalSecondsInDay;
this.manualPosition = pos;
this.progress.style.width = `${pos * 100}%`;
const displaySeconds = pos * 86400;
this.currentTime.textContent = this.formatTime(displaySeconds);
}
closeChangeDate() { closeChangeDate() {
this.changeDate && (this.changeDate = false) this.changeDate && (this.changeDate = false)
} }