Merge branch 'master' into preview
This commit is contained in:
commit
125af3a567
4 changed files with 38 additions and 9 deletions
|
|
@ -18,10 +18,19 @@
|
||||||
height="55"
|
height="55"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://hellogithub.com/repository/57771fd91d1542c7a470959b677a9944" target="_blank">
|
||||||
|
<img
|
||||||
|
src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=57771fd91d1542c7a470959b677a9944&claim_uid=qi74Zp23wYKeAVB&theme=neutral"
|
||||||
|
alt="Featured|HelloGitHub"
|
||||||
|
width="250"
|
||||||
|
height="55"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
<a href="https://www.uneed.best/tool/sink" target="_blank">
|
<a href="https://www.uneed.best/tool/sink" target="_blank">
|
||||||
<img
|
<img
|
||||||
src="https://www.uneed.best/POTW1.png"
|
src="https://www.uneed.best/POTW1.png"
|
||||||
alt="Uneed Badge"
|
alt="Uneed Badge"
|
||||||
|
width="250"
|
||||||
height="55"
|
height="55"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -74,21 +74,37 @@ function trafficEvent({ props }, { delay = 0 }) {
|
||||||
startLng: props.item.longitude,
|
startLng: props.item.longitude,
|
||||||
endLat: colos.value[props.item.COLO]?.lat,
|
endLat: colos.value[props.item.COLO]?.lat,
|
||||||
endLng: colos.value[props.item.COLO]?.lon,
|
endLng: colos.value[props.item.COLO]?.lon,
|
||||||
color: 'red',
|
color: 'darkOrange',
|
||||||
arcAltitude: 0.5,
|
arcAltitude: 0.2,
|
||||||
|
}
|
||||||
|
console.info(`from ${props.item.city}(${arc.startLat}, ${arc.startLng}) to ${props.item.COLO}(${arc.endLat}, ${arc.endLng})`)
|
||||||
|
const isNear = Math.abs(arc.endLat - arc.startLat) < 5 && Math.abs(arc.endLng - arc.startLng) < 5
|
||||||
|
if (isNear) {
|
||||||
|
console.info(`from ${props.item.city} to ${props.item.COLO} is near, skip`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
console.info(`from ${props.item.city}(${props.item.latitude}, ${props.item.longitude}) to ${props.item.COLO}(${colos.value[props.item.COLO]?.lat}, ${colos.value[props.item.COLO]?.lon})`)
|
|
||||||
const random = Math.random()
|
const random = Math.random()
|
||||||
globe.arcsData([arc])
|
globe.arcsData([arc])
|
||||||
.arcColor('color')
|
.arcColor('color')
|
||||||
.arcDashLength(() => random + 0.2)
|
.arcDashLength(() => random)
|
||||||
.arcDashGap(() => random - 0.2)
|
.arcDashGap(() => 1 - random)
|
||||||
.arcDashAnimateTime(2000)
|
.arcDashAnimateTime(delay * 2)
|
||||||
|
.ringRepeatPeriod(delay * 2)
|
||||||
|
|
||||||
|
const srcRing = { lat: arc.startLat, lng: arc.startLng }
|
||||||
|
globe.ringsData([...globe.ringsData(), srcRing])
|
||||||
|
setTimeout(() => globe.ringsData(globe.ringsData().filter(r => r !== srcRing)), delay * 2)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const targetRing = { lat: arc.endLat, lng: arc.endLng }
|
||||||
|
globe.ringsData([...globe.ringsData(), targetRing])
|
||||||
|
setTimeout(() => globe.ringsData(globe.ringsData().filter(r => r !== targetRing)), delay * 2)
|
||||||
|
}, delay * 2)
|
||||||
|
|
||||||
clearTimeout(cleanArcsDataTimer)
|
clearTimeout(cleanArcsDataTimer)
|
||||||
cleanArcsDataTimer = setTimeout(() => {
|
cleanArcsDataTimer = setTimeout(() => {
|
||||||
globe.arcsData([])
|
globe.arcsData([])
|
||||||
}, delay + 100)
|
}, delay * 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalized = 5 / props.minutes
|
const normalized = 5 / props.minutes
|
||||||
|
|
@ -114,6 +130,9 @@ function initGlobe() {
|
||||||
.hexBinMerge(true)
|
.hexBinMerge(true)
|
||||||
.hexBinPointWeight('count')
|
.hexBinPointWeight('count')
|
||||||
.hexPolygonColor(() => `rgba(54, 211, 153, ${Math.random() / 1.5 + 0.5})`)
|
.hexPolygonColor(() => `rgba(54, 211, 153, ${Math.random() / 1.5 + 0.5})`)
|
||||||
|
.ringColor(() => t => `rgba(255,100,50,${1 - t})`)
|
||||||
|
.ringMaxRadius(3)
|
||||||
|
.ringPropagationSpeed(3)
|
||||||
.onGlobeReady(() => {
|
.onGlobeReady(() => {
|
||||||
globe.pointOfView({ lat: currentLocation.value.latitude, lng: currentLocation.value.longitude, altitude: width.value > 768 ? 2 : 3 })
|
globe.pointOfView({ lat: currentLocation.value.latitude, lng: currentLocation.value.longitude, altitude: width.value > 768 ? 2 : 3 })
|
||||||
globe.controls().autoRotate = true
|
globe.controls().autoRotate = true
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,8 @@ onMounted(() => loadComponents())
|
||||||
<div
|
<div
|
||||||
v-for="(item, idx) in itemsToShow"
|
v-for="(item, idx) in itemsToShow"
|
||||||
:key="item.props.key"
|
:key="item.props.key"
|
||||||
v-motion :initial="getInitial(idx)" :enter="getEnter(idx)" :leave="getLeave()"
|
v-motion
|
||||||
|
:initial="getInitial(idx)" :enter="getEnter(idx)" :leave="getLeave()"
|
||||||
:class="cn('mx-auto w-full')"
|
:class="cn('mx-auto w-full')"
|
||||||
>
|
>
|
||||||
<component :is="item" />
|
<component :is="item" />
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ export default defineNuxtConfig({
|
||||||
modules: [
|
modules: [
|
||||||
'@nuxthub/core',
|
'@nuxthub/core',
|
||||||
'shadcn-nuxt',
|
'shadcn-nuxt',
|
||||||
|
'@vueuse/motion/nuxt',
|
||||||
'@nuxt/eslint',
|
'@nuxt/eslint',
|
||||||
'@nuxtjs/tailwindcss',
|
'@nuxtjs/tailwindcss',
|
||||||
'@vueuse/motion/nuxt',
|
|
||||||
'@nuxtjs/color-mode',
|
'@nuxtjs/color-mode',
|
||||||
'@nuxtjs/i18n',
|
'@nuxtjs/i18n',
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue