refactor 1: remove unc deop
This commit is contained in:
parent
b3eeef29a7
commit
247d7e37db
@ -1,3 +1,3 @@
|
||||
// export const API_BASE_URL = 'http://localhost:5000'
|
||||
// export const API_BASE_URL = 'http://localhost:18200'
|
||||
export const API_BASE_URL = 'https://gca-api.dustella.net:8443'
|
||||
export const API_BASE_URL = 'http://localhost:18200'
|
||||
// export const API_BASE_URL = 'https://gca-api.dustella.net:8443'
|
||||
|
||||
@ -1,111 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import type { P5I } from 'p5i'
|
||||
import { p5i } from 'p5i'
|
||||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
|
||||
const el = ref<HTMLCanvasElement | null>(null)
|
||||
|
||||
const {
|
||||
mount,
|
||||
unmount,
|
||||
createCanvas,
|
||||
background,
|
||||
noFill,
|
||||
stroke,
|
||||
noise,
|
||||
noiseSeed,
|
||||
resizeCanvas,
|
||||
cos,
|
||||
sin,
|
||||
TWO_PI,
|
||||
} = p5i()
|
||||
|
||||
let w = window.innerWidth
|
||||
let h = window.innerHeight
|
||||
const offsetY = window.scrollY
|
||||
|
||||
const SCALE = 200
|
||||
const LENGTH = 10
|
||||
const SPACING = 15
|
||||
|
||||
function getForceOnPoint(x: number, y: number, z: number) {
|
||||
// https://p5js.org/reference/#/p5/noise
|
||||
return (noise(x / SCALE, y / SCALE, z) - 0.5) * 2 * TWO_PI
|
||||
}
|
||||
|
||||
const existingPoints = new Set<string>()
|
||||
const points: { x: number, y: number, opacity: number }[] = []
|
||||
|
||||
function addPoints() {
|
||||
for (let x = -SPACING / 2; x < w + SPACING; x += SPACING) {
|
||||
for (let y = -SPACING / 2; y < h + offsetY + SPACING; y += SPACING) {
|
||||
const id = `${x}-${y}`
|
||||
if (existingPoints.has(id))
|
||||
continue
|
||||
existingPoints.add(id)
|
||||
points.push({ x, y, opacity: Math.random() * 0.5 + 0.5 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setup() {
|
||||
createCanvas(w, h)
|
||||
background('#ffffff')
|
||||
stroke('#ccc')
|
||||
noFill()
|
||||
|
||||
noiseSeed(+new Date())
|
||||
|
||||
addPoints()
|
||||
}
|
||||
|
||||
function draw({ circle }: P5I) {
|
||||
background('#ffffff')
|
||||
const t = +new Date() / 10000
|
||||
|
||||
for (const p of points) {
|
||||
const { x, y } = p
|
||||
const rad = getForceOnPoint(x, y, t)
|
||||
const length = (noise(x / SCALE, y / SCALE, t * 2) + 0.5) * LENGTH
|
||||
const nx = x + cos(rad) * length
|
||||
const ny = y + sin(rad) * length
|
||||
stroke(180, 180, 180, (Math.abs(cos(rad)) * 0.5 + 0.5) * p.opacity * 255)
|
||||
circle(nx, ny - offsetY, 1)
|
||||
}
|
||||
}
|
||||
|
||||
function restart() {
|
||||
if (el.value)
|
||||
mount(el.value, { setup, draw })
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
restart()
|
||||
|
||||
useEventListener('resize', () => {
|
||||
w = window.innerWidth
|
||||
h = window.innerHeight
|
||||
resizeCanvas(w, h)
|
||||
addPoints()
|
||||
})
|
||||
|
||||
// Uncomment to enable scroll-based animation
|
||||
// Tho there is some lag when scrolling, not sure if it's solvable
|
||||
// useEventListener('scroll', () => {
|
||||
// offsetY = window.scrollY
|
||||
// addPoints()
|
||||
// }, { passive: true })
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
unmount()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- <Paper> -->
|
||||
<div relative h-100 class="overflow-hidden">
|
||||
<div ref="el" pointer-events-none overflow-hidden />
|
||||
</div>
|
||||
<!-- </Paper> -->
|
||||
</template>
|
||||
@ -1,79 +0,0 @@
|
||||
<script setup lang='ts'>
|
||||
import { useEventListener, useFullscreen } from '@vueuse/core'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
const fullscreen = useFullscreen(ref(document.querySelector('html')))
|
||||
|
||||
// const isDark = useDark()
|
||||
|
||||
useEventListener('keydown', (e) => {
|
||||
if (document.activeElement === document.body) {
|
||||
if (e.key === 'f') {
|
||||
if (fullscreen.isFullscreen.value)
|
||||
fullscreen.exit()
|
||||
else
|
||||
fullscreen.enter()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let no = route.path.slice(1)
|
||||
if (no.startsWith('x'))
|
||||
no = no.slice(1)
|
||||
|
||||
const shot = Boolean(route.query.shot)
|
||||
const hideFrame = Boolean(route.query.hideFrame !== undefined || route.query.full !== undefined)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="paper" :class="{ shot }">
|
||||
<div v-if="!shot && !hideFrame" class="nav font-mono">
|
||||
<router-link to="/" class="link block pt-1 text-xl">
|
||||
<carbon-chevron-left />
|
||||
</router-link>
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.nav {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.bottom-nav {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.shot .nav {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.shot .bottom-nav {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
.nav-links .next,
|
||||
.nav-links .prev {
|
||||
opacity: 0;
|
||||
transition: 0.3s all ease-in-out;
|
||||
margin-top: -1.5em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-links:hover .next,
|
||||
.nav-links:hover .prev {
|
||||
opacity: 1;
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
@ -1,150 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
NavigationMenuContent,
|
||||
NavigationMenuIndicator,
|
||||
NavigationMenuItem,
|
||||
NavigationMenuLink,
|
||||
NavigationMenuList,
|
||||
NavigationMenuRoot,
|
||||
NavigationMenuTrigger,
|
||||
NavigationMenuViewport,
|
||||
} from 'radix-vue'
|
||||
import { ref } from 'vue'
|
||||
import NavigationMenuListItem from './NavigationMenuListItem.vue'
|
||||
|
||||
const currentTrigger = ref('')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NavigationMenuRoot
|
||||
v-model="currentTrigger"
|
||||
class="relative z-[1] mx-auto flex justify-center"
|
||||
>
|
||||
<NavigationMenuList class="center shadow-blackA7 m-0 flex list-none rounded-[6px] bg-white p-1 shadow-[0_2px_10px]">
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuTrigger
|
||||
class="group text-grass11 flex select-none items-center justify-between gap-[2px] rounded-[4px] px-3 py-2 text-[15px] font-medium leading-none outline-none hover:bg-green3 focus:shadow-[0_0_0_2px] focus:shadow-green7"
|
||||
>
|
||||
Learn
|
||||
<Icon
|
||||
icon="radix-icons:caret-down"
|
||||
class="text-green10 relative top-[1px] transition-transform duration-[250ms] ease-in group-data-[state=open]:-rotate-180"
|
||||
/>
|
||||
</NavigationMenuTrigger>
|
||||
<NavigationMenuContent
|
||||
class="data-[motion=from-start]:animate-enterFromLeft data-[motion=from-end]:animate-enterFromRight data-[motion=to-start]:animate-exitToLeft data-[motion=to-end]:animate-exitToRight absolute left-0 top-0 w-full sm:w-auto"
|
||||
>
|
||||
<ul class="one grid m-0 list-none gap-x-[10px] p-[22px] sm:grid-cols-[0.75fr_1fr] sm:w-[500px]">
|
||||
<li class="grid row-span-3">
|
||||
<NavigationMenuLink as-child>
|
||||
<a
|
||||
class="h-full w-full flex flex-col select-none justify-end rounded-[6px] from-green9 to-teal9 bg-gradient-to-b p-[25px] no-underline outline-none focus:shadow-[0_0_0_2px] focus:shadow-green7"
|
||||
href="/"
|
||||
>
|
||||
<img
|
||||
class="w-16"
|
||||
src="https://www.radix-vue.com/logo.svg"
|
||||
>
|
||||
<div class="mb-[7px] mt-4 text-[18px] text-white font-medium leading-[1.2]">Radix Primitives</div>
|
||||
<p class="text-mauve4 text-[14px] leading-[1.3]">Unstyled, accessible components for Vue.</p>
|
||||
</a>
|
||||
</NavigationMenuLink>
|
||||
</li>
|
||||
|
||||
<NavigationMenuListItem
|
||||
href="https://stitches.dev/"
|
||||
title="Stitches"
|
||||
>
|
||||
CSS-in-JS with best-in-class developer experience.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
href="/colors"
|
||||
title="Colors"
|
||||
>
|
||||
Beautiful, thought-out palettes with auto dark mode.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
href="https://icons.radix-ui.com/"
|
||||
title="Icons"
|
||||
>
|
||||
A crisp set of 15x15 icons, balanced and consistent.
|
||||
</NavigationMenuListItem>
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuTrigger
|
||||
class="text-grass11 group flex select-none items-center justify-between gap-[2px] rounded-[4px] px-3 py-2 text-[15px] font-medium leading-none outline-none hover:bg-green3 focus:shadow-[0_0_0_2px] focus:shadow-green7"
|
||||
>
|
||||
Overview
|
||||
<Icon
|
||||
icon="radix-icons:caret-down"
|
||||
class="text-green10 relative top-[1px] transition-transform duration-[250ms] ease-in group-data-[state=open]:-rotate-180"
|
||||
/>
|
||||
</NavigationMenuTrigger>
|
||||
<NavigationMenuContent class="data-[motion=from-start]:animate-enterFromLeft data-[motion=from-end]:animate-enterFromRight data-[motion=to-start]:animate-exitToLeft data-[motion=to-end]:animate-exitToRight absolute left-0 top-0 w-full sm:w-auto">
|
||||
<ul class="grid m-0 list-none gap-x-[10px] p-[22px] sm:grid-flow-col sm:grid-rows-3 sm:w-[600px]">
|
||||
<NavigationMenuListItem
|
||||
title="Introduction"
|
||||
href="/docs/primitives/overview/introduction"
|
||||
>
|
||||
Build high-quality, accessible design systems and web apps.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
title="Getting started"
|
||||
href="/docs/primitives/overview/getting-started"
|
||||
>
|
||||
A quick tutorial to get you up and running with Radix Primitives.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
title="Styling"
|
||||
href="/docs/primitives/guides/styling"
|
||||
>
|
||||
Unstyled and compatible with any styling solution.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
title="Animation"
|
||||
href="/docs/primitives/guides/animation"
|
||||
>
|
||||
Use CSS keyframes or any animation library of your choice.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
title="Accessibility"
|
||||
href="/docs/primitives/overview/accessibility"
|
||||
>
|
||||
Tested in a range of browsers and assistive technologies.
|
||||
</NavigationMenuListItem>
|
||||
<NavigationMenuListItem
|
||||
title="Releases"
|
||||
href="/docs/primitives/overview/releases"
|
||||
>
|
||||
Radix Primitives releases and their changelogs.
|
||||
</NavigationMenuListItem>
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuLink
|
||||
class="text-grass11 block select-none rounded-[4px] px-3 py-2 text-[15px] font-medium leading-none no-underline outline-none hover:bg-green3 focus:shadow-[0_0_0_2px] focus:shadow-green7"
|
||||
href="https://github.com/unovue/radix-vue"
|
||||
>
|
||||
Github
|
||||
</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
|
||||
<NavigationMenuIndicator
|
||||
class="transition-[all,transform_250ms_ease] data-[state=visible]:animate-fadeIn data-[state=hidden]:animate-fadeOut top-full z-[1] h-[10px] flex items-end justify-center overflow-hidden duration-200 data-[state=hidden]:opacity-0"
|
||||
>
|
||||
<div class="relative top-[70%] h-[10px] w-[10px] rotate-[45deg] rounded-tl-[2px] bg-white" />
|
||||
</NavigationMenuIndicator>
|
||||
</NavigationMenuList>
|
||||
|
||||
<div class="absolute left-0 top-full w-full flex perspective-[2000px] justify-center">
|
||||
<NavigationMenuViewport
|
||||
class="transition-[width,_height] data-[state=open]:animate-scaleIn data-[state=closed]:animate-scaleOut relative mt-[10px] h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-[10px] bg-white duration-300 sm:w-[var(--radix-navigation-menu-viewport-width)]"
|
||||
/>
|
||||
</div>
|
||||
</NavigationMenuRoot>
|
||||
</template>
|
||||
@ -1,3 +0,0 @@
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
@ -1,78 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
NavigationMenu,
|
||||
NavigationMenuContent,
|
||||
NavigationMenuItem,
|
||||
NavigationMenuLink,
|
||||
NavigationMenuList,
|
||||
NavigationMenuTrigger,
|
||||
navigationMenuTriggerStyle,
|
||||
} from './ui/navigation-menu'
|
||||
|
||||
const header_data: Record<string, { title: string, href: string }[]> = {
|
||||
探空气球: [{
|
||||
title: '重力波单次',
|
||||
href: '/balloon/single',
|
||||
}, {
|
||||
title: '重力波统计',
|
||||
href: '/balloon/year',
|
||||
}],
|
||||
流星雷达: [{
|
||||
title: '潮汐波强度',
|
||||
href: '/radar/v1',
|
||||
}, {
|
||||
title: '潮汐波时空变化',
|
||||
href: '/radar/v2',
|
||||
}],
|
||||
Saber: [
|
||||
{
|
||||
title: '波动拟合图',
|
||||
href: '/saber/plot_wave_fitting',
|
||||
},
|
||||
{
|
||||
title: '日数据傅里叶变换分析',
|
||||
href: '/saber/day_fft_ifft_plot',
|
||||
},
|
||||
{
|
||||
title: '日周期波动能量分析',
|
||||
href: '/saber/day_cycle_power_wave_plot',
|
||||
},
|
||||
{
|
||||
// month_power_wave_plot
|
||||
title: ' 月度波动能量分析',
|
||||
href: '/saber/month_power_wave_plot',
|
||||
},
|
||||
],
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NavigationMenu class="mx-auto">
|
||||
<NavigationMenuList>
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuLink href="/" :class="navigationMenuTriggerStyle()">
|
||||
主页
|
||||
</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
<NavigationMenuItem v-for="(thisHeader, headers) in header_data" :key="headers">
|
||||
<NavigationMenuTrigger>{{ headers }}</NavigationMenuTrigger>
|
||||
<NavigationMenuContent>
|
||||
<ul class="w-60 flex flex-col gap-3 p-6">
|
||||
<li v-for="header in thisHeader" :key="header.href" class="row-span-3">
|
||||
<NavigationMenuLink as-child>
|
||||
<a
|
||||
class="block select-none rounded-md p-3 leading-none no-underline outline-none transition-colors space-y-1 focus:bg-accent hover:bg-accent focus:text-accent-foreground hover:text-accent-foreground"
|
||||
:href="header.href"
|
||||
>
|
||||
<div class="text-sm font-medium leading-none">
|
||||
{{ header.title }}
|
||||
</div>
|
||||
</a>
|
||||
</NavigationMenuLink>
|
||||
</li>
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
</NavigationMenuList>
|
||||
</NavigationMenu>
|
||||
</template>
|
||||
@ -1,123 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Menubar,
|
||||
MenubarCheckboxItem,
|
||||
MenubarContent,
|
||||
MenubarItem,
|
||||
MenubarMenu,
|
||||
MenubarRadioGroup,
|
||||
MenubarRadioItem,
|
||||
MenubarSeparator,
|
||||
MenubarShortcut,
|
||||
MenubarSub,
|
||||
MenubarSubContent,
|
||||
MenubarSubTrigger,
|
||||
MenubarTrigger,
|
||||
} from '~/components/ui/menubar'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Menubar>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>File</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarItem>
|
||||
New Tab <MenubarShortcut>⌘T</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarItem>
|
||||
New Window <MenubarShortcut>⌘N</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarItem disabled>
|
||||
New Incognito Window
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarSub>
|
||||
<MenubarSubTrigger>Share</MenubarSubTrigger>
|
||||
<MenubarSubContent>
|
||||
<MenubarItem>Email link</MenubarItem>
|
||||
<MenubarItem>Messages</MenubarItem>
|
||||
<MenubarItem>Notes</MenubarItem>
|
||||
</MenubarSubContent>
|
||||
</MenubarSub>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem>
|
||||
Print... <MenubarShortcut>⌘P</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>Edit</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarItem>
|
||||
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarItem>
|
||||
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarSub>
|
||||
<MenubarSubTrigger>Find</MenubarSubTrigger>
|
||||
<MenubarSubContent>
|
||||
<MenubarItem>Search the web</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem>Find...</MenubarItem>
|
||||
<MenubarItem>Find Next</MenubarItem>
|
||||
<MenubarItem>Find Previous</MenubarItem>
|
||||
</MenubarSubContent>
|
||||
</MenubarSub>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem>Cut</MenubarItem>
|
||||
<MenubarItem>Copy</MenubarItem>
|
||||
<MenubarItem>Paste</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>View</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarCheckboxItem>Always Show Bookmarks Bar</MenubarCheckboxItem>
|
||||
<MenubarCheckboxItem checked>
|
||||
Always Show Full URLs
|
||||
</MenubarCheckboxItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem inset>
|
||||
Reload <MenubarShortcut>⌘R</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarItem disabled inset>
|
||||
Force Reload <MenubarShortcut>⇧⌘R</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem inset>
|
||||
Toggle Fullscreen
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem inset>
|
||||
Hide Sidebar
|
||||
</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>Profiles</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarRadioGroup value="benoit">
|
||||
<MenubarRadioItem value="andy">
|
||||
Andy
|
||||
</MenubarRadioItem>
|
||||
<MenubarRadioItem value="benoit">
|
||||
Benoit
|
||||
</MenubarRadioItem>
|
||||
<MenubarRadioItem value="Luis">
|
||||
Luis
|
||||
</MenubarRadioItem>
|
||||
</MenubarRadioGroup>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem inset>
|
||||
Edit...
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem inset>
|
||||
Add Profile...
|
||||
</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
</Menubar>
|
||||
</template>
|
||||
Loading…
x
Reference in New Issue
Block a user