Skip to content

Commit 404026b

Browse files
committed
docs: new style
1 parent 34900cd commit 404026b

9 files changed

Lines changed: 355 additions & 114 deletions

File tree

‎vitepress/docs/.vitepress/theme/index.ts‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,51 @@ const ETVRWordmark = () =>
2020
' Docs'
2121
])
2222

23+
/**
24+
* Pointer highlight for the "frosted" controls, ported from the landing page's
25+
* script.js: a small radial gradient follows the cursor inside the surface via
26+
* --pointer-x / --pointer-y. Delegated from the document so it keeps working
27+
* after client-side navigation, and skipped for touch and reduced motion.
28+
*/
29+
function setupFrostedGlow() {
30+
const FROSTED = '.VPButton.alt, .VPSocialLink'
31+
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)')
32+
let frame = 0
33+
34+
const surfaceOf = (target: EventTarget | null) =>
35+
target instanceof Element ? target.closest<HTMLElement>(FROSTED) : null
36+
37+
document.addEventListener('pointermove', (event) => {
38+
const surface = surfaceOf(event.target)
39+
if (!surface || event.pointerType === 'touch' || reducedMotion.matches) {
40+
return
41+
}
42+
const bounds = surface.getBoundingClientRect()
43+
cancelAnimationFrame(frame)
44+
frame = requestAnimationFrame(() => {
45+
surface.style.setProperty('--pointer-x', `${event.clientX - bounds.left}px`)
46+
surface.style.setProperty('--pointer-y', `${event.clientY - bounds.top}px`)
47+
})
48+
})
49+
50+
document.addEventListener('pointerout', (event) => {
51+
const surface = surfaceOf(event.target)
52+
if (!surface || surface.contains(event.relatedTarget as Node)) {
53+
return
54+
}
55+
surface.style.removeProperty('--pointer-x')
56+
surface.style.removeProperty('--pointer-y')
57+
})
58+
}
59+
2360
const CustomTheme = {
2461
...DefaultTheme,
62+
enhanceApp(ctx) {
63+
DefaultTheme.enhanceApp?.(ctx)
64+
if (inBrowser) {
65+
setupFrostedGlow()
66+
}
67+
},
2568
setup() {
2669
const { lang } = useData()
2770
watchEffect(() => {

‎vitepress/docs/src/custom/theme/index.ts‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ const theme = {
3030
copyright: "Copyright © 2022-present ETVR",
3131
},
3232
nav: [
33-
{
34-
text: "About",
35-
items: [
36-
{ text: "About Us", link: "/about" },
37-
{ text: "Development Road Map", link: "/dev_roadmap" },
38-
],
39-
},
33+
{ text: "About", link: "/about" },
4034
{ text: "Contact", link: "/contact" },
4135
],
4236
sidebar: [
@@ -179,9 +173,23 @@ const theme = {
179173
],
180174
},
181175
],
176+
/* Line icons from /icons.svg - the landing page draws its brand marks with
177+
* the same stroke style, instead of VitePress' filled glyphs. */
182178
socialLinks: [
183-
{ icon: "github", link: "https://github.com/EyeTrackVR" },
184-
{ icon: "discord", link: "https://discord.gg/kkXYbVykZX" },
179+
{
180+
icon: {
181+
svg: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#github"></use></svg>',
182+
},
183+
link: "https://github.com/EyeTrackVR",
184+
ariaLabel: "GitHub",
185+
},
186+
{
187+
icon: {
188+
svg: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#discord"></use></svg>',
189+
},
190+
link: "https://discord.gg/kkXYbVykZX",
191+
ariaLabel: "Discord",
192+
},
185193
],
186194
};
187195

‎vitepress/docs/src/pages/dev_roadmap.md‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎vitepress/docs/src/pages/firmware_guide/firmware.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ This tool relies on our own solution called `OpenIris`, [found here](https://git
2323
You **do not** need to download OpenIris separately. The flashing tool will download it for you.
2424
:::
2525

26-
To check the status of the project, please visit the [Development Road Map](/dev_roadmap)
27-
2826
::: details I want to use VSCode - How would I do this?
2927
[Follow the steps described here](./setup_vscode)
3028
:::

‎vitepress/docs/src/pages/index.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ hero:
2525
text: View on GitHub
2626
link: https://github.com/EyeTrackVR/EyeTrackVR
2727
features:
28-
- icon: ⚡️
28+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#code"></use></svg>'
2929
title: Source First
3030
details: open and free to use.
31-
- icon: 🎉
31+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#discord"></use></svg>'
3232
title: Community Driven
3333
details: built by you for you.
34-
- icon: 💰
34+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#store"></use></svg>'
3535
title: Affordable
3636
details: affordable and easy to use.
37-
- icon: 🎮
37+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#headset"></use></svg>'
3838
title: Nearly All VR Headsets
3939
details: EyeTrackVR works with nearly all VR headsets.
40-
- icon: 🔨
40+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#chip"></use></svg>'
4141
title: Completely DIY
4242
details: completely DIY and easy to build.
43-
- icon: 🌐
43+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#globe"></use></svg>'
4444
title: Open Platform
4545
details: open platform and works with any Social VR game.
46-
- icon: 🔏
46+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#shield"></use></svg>'
4747
title: Privacy Focused
4848
details: privacy focused and does not collect any data, hosted on your own PC.
49-
- icon: 📡
49+
- icon: '<svg class="etvr-icon" aria-hidden="true"><use href="/icons.svg#broadcast"></use></svg>'
5050
title: Open Protocol
5151
details: EyeTrackVR uses the Open Sound Control (OSC) protocol.
5252
---
Lines changed: 22 additions & 0 deletions
Loading

‎vitepress/docs/src/static/dev_roadmap/index.ts‎

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎vitepress/docs/src/static/members/index.ts‎

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ const members: IMembers[] = [
1212
},
1313
]
1414
},
15-
{
16-
name: 'Summer',
17-
avatar: 'https://avatars.githubusercontent.com/u/115666235?v=4',
18-
title: 'ML Engineer / Data Scientist / App Developer',
19-
links: [
20-
{
21-
icon: 'github',
22-
link: 'https://github.com/Summer404NotFound'
23-
},
24-
]
25-
},
2615
{
2716
name: 'lorow',
2817
avatar: 'https://avatars.githubusercontent.com/u/14099558?v=4',
@@ -45,6 +34,26 @@ const members: IMembers[] = [
4534
},
4635
]
4736
},
37+
{
38+
name: 'DenTechs',
39+
avatar: 'https://avatars.githubusercontent.com/u/48604154?v=4',
40+
links: [
41+
{
42+
icon: 'github',
43+
link: 'https://github.com/DenTechs'
44+
},
45+
]
46+
},
47+
{
48+
name: 'dubnubdubnub',
49+
avatar: 'https://avatars.githubusercontent.com/u/62734255?v=4',
50+
links: [
51+
{
52+
icon: 'github',
53+
link: 'https://github.com/dubnubdubnub'
54+
},
55+
]
56+
},
4857

4958

5059

@@ -81,6 +90,13 @@ const contributors: IMembers[] = [
8190
links: [
8291
{ icon: 'github', link: 'https://github.com/PallasNeko' },
8392
]
93+
},
94+
{
95+
name: 'Summer',
96+
avatar: 'https://avatars.githubusercontent.com/u/115666235?v=4',
97+
links: [
98+
{ icon: 'github', link: 'https://github.com/Summer404NotFound' },
99+
]
84100
}
85101
]
86102

0 commit comments

Comments
 (0)