refactor: use dev from SvelteKit
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { dev } from '$app/environment'
|
||||
import { getContext } from 'svelte'
|
||||
import { fade, fly as flySvelte } from 'svelte/transition'
|
||||
import { quartOut } from 'svelte/easing'
|
||||
@@ -13,15 +14,13 @@
|
||||
// Components
|
||||
import SplitText from '$components/SplitText.svelte'
|
||||
|
||||
const isDev = import.meta.env.DEV
|
||||
|
||||
let {
|
||||
type,
|
||||
autoRotate = true,
|
||||
enableMarkers = true,
|
||||
enableMarkersLinks = true,
|
||||
speed = 0.1,
|
||||
pane = isDev,
|
||||
pane = dev,
|
||||
width,
|
||||
}: {
|
||||
type?: string
|
||||
@@ -81,17 +80,18 @@
|
||||
if (isIntersecting) {
|
||||
update()
|
||||
|
||||
if (isDev) {
|
||||
if (dev) {
|
||||
console.log('globe: render/start')
|
||||
}
|
||||
} else {
|
||||
stop()
|
||||
|
||||
if (isDev) {
|
||||
if (dev) {
|
||||
console.log('globe: render/stop')
|
||||
}
|
||||
}
|
||||
}, { threshold: 0 })
|
||||
|
||||
observer.observe(globeEl)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user