光照模块
This commit is contained in:
@ -255,16 +255,19 @@ onMounted(() => {
|
|||||||
if (window.sunshine) {
|
if (window.sunshine) {
|
||||||
let data = JSON.parse(localStorage.getItem('shineSetting'))
|
let data = JSON.parse(localStorage.getItem('shineSetting'))
|
||||||
// weatherData.currWeather = data.currWeather
|
// weatherData.currWeather = data.currWeather
|
||||||
//是否是实时光照
|
if (data) {
|
||||||
if (!data?.currWeather) {
|
//判断是否有数据
|
||||||
weatherData.time = data.time
|
//是否是实时光照
|
||||||
|
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
|
// list = data.wearther
|
||||||
switchStatus.value = true
|
switchStatus.value = true
|
||||||
sunshine = window.sunshine
|
sunshine = window.sunshine
|
||||||
@ -278,7 +281,7 @@ onMounted(() => {
|
|||||||
// sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 })
|
// sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 })
|
||||||
timeline.moveComplay((item) => {
|
timeline.moveComplay((item) => {
|
||||||
weatherData.currWeather = false
|
weatherData.currWeather = false
|
||||||
sunshine.timeBar = item
|
sunshine && (sunshine.timeBar = item)
|
||||||
})
|
})
|
||||||
|
|
||||||
// timeline.setTime(myData)
|
// timeline.setTime(myData)
|
||||||
@ -561,8 +564,11 @@ var shadowChange = () => {
|
|||||||
width: 250px;
|
width: 250px;
|
||||||
height: auto;
|
height: auto;
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
background:
|
background: linear-gradient(
|
||||||
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
|
180deg,
|
||||||
|
rgba(var(--color-base1), 0) 0%,
|
||||||
|
rgba(var(--color-base1), 0.2) 100%
|
||||||
|
),
|
||||||
rgba(0, 0, 0, 0.6);
|
rgba(0, 0, 0, 0.6);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1.5px solid rgba(var(--color-base1), 1);
|
border: 1.5px solid rgba(var(--color-base1), 1);
|
||||||
|
|||||||
@ -46,14 +46,14 @@ export default class TimeLine {
|
|||||||
that.timeline.addEventListener('mousedown', (e) => {
|
that.timeline.addEventListener('mousedown', (e) => {
|
||||||
|
|
||||||
if (e.srcElement.className === 'handle') {
|
if (e.srcElement.className === 'handle') {
|
||||||
if (!that.sunShine) {
|
// if (!that.sunShine) {
|
||||||
ElMessage({
|
// ElMessage({
|
||||||
message: '请开启光照功能',
|
// message: '请开启光照功能',
|
||||||
type: 'warning'
|
// type: 'warning'
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
that.isDragging = true;
|
that.isDragging = true;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
@ -88,7 +88,7 @@ export default class TimeLine {
|
|||||||
that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false)
|
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)
|
callback(false)
|
||||||
}
|
}
|
||||||
} else {//播放
|
} else {//播放
|
||||||
|
|||||||
Reference in New Issue
Block a user