光照模块

This commit is contained in:
2025-11-28 14:32:01 +08:00
parent 5c1d299483
commit 39b73bcad8
2 changed files with 27 additions and 21 deletions

View File

@ -255,16 +255,19 @@ onMounted(() => {
if (window.sunshine) {
let data = JSON.parse(localStorage.getItem('shineSetting'))
// weatherData.currWeather = data.currWeather
//是否是实时光照
if (!data?.currWeather) {
weatherData.time = data.time
if (data) {
//判断是否有数据
//是否是实时光照
if (!data?.currWeather) {
weatherData.time = data.time
}
weatherData.softShadow = data.softShadow
weatherData.darkness = data.darkness
weatherData.speed = data.speed
data?.wearther.forEach((item, index) => {
list[index].status = item.status
})
}
weatherData.softShadow = data.softShadow
weatherData.darkness = data.darkness
weatherData.speed = data.speed
data?.wearther.forEach((item, index) => {
list[index].status = item.status
})
// list = data.wearther
switchStatus.value = true
sunshine = window.sunshine
@ -278,7 +281,7 @@ onMounted(() => {
// sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 })
timeline.moveComplay((item) => {
weatherData.currWeather = false
sunshine.timeBar = item
sunshine && (sunshine.timeBar = item)
})
// timeline.setTime(myData)
@ -561,8 +564,11 @@ var shadowChange = () => {
width: 250px;
height: auto;
z-index: 30;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6);
padding: 10px;
border: 1.5px solid rgba(var(--color-base1), 1);

View File

@ -46,14 +46,14 @@ export default class TimeLine {
that.timeline.addEventListener('mousedown', (e) => {
if (e.srcElement.className === 'handle') {
if (!that.sunShine) {
ElMessage({
message: '请开启光照功能',
type: 'warning'
})
} else {
that.isDragging = true;
}
// if (!that.sunShine) {
// ElMessage({
// message: '请开启光照功能',
// type: 'warning'
// })
// } else {
that.isDragging = true;
// }
}
e.preventDefault();
});
@ -88,7 +88,7 @@ export default class TimeLine {
that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false)
//判断当没有开启光照时,点击停止播放时关闭实时光照按钮
if (document.getElementById('weatherSwitch').style.color == 'rgb(255, 255, 255)') {
if (document.getElementById('weatherSwitch').style.color == 'rgba(var(--color-base1), 1)') {
callback(false)
}
} else {//播放