Skip to content

Commit b46f5da

Browse files
committed
Deno format
1 parent 4450ec9 commit b46f5da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+457
-391
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ dist-ssr
1313
*.local
1414

1515
# Editor directories and files
16-
.vscode/*
17-
!.vscode/extensions.json
1816
.idea
1917
.DS_Store
2018
*.suo

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"emeraldwalk.runonsave"
4+
]
5+
}

.vscode/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"[astro]": {
4+
"editor.defaultFormatter": "astro-build.astro-vscode"
5+
},
6+
"[typescript]": {
7+
"editor.defaultFormatter": null
8+
},
9+
"[javascript]": {
10+
"editor.defaultFormatter": null
11+
},
12+
"emeraldwalk.runonsave": {
13+
"commands": [
14+
{
15+
"match": ".*",
16+
"cmd": "echo \"Formatting ${relativeFile}\" && deno fmt ./${relativeFile}"
17+
}
18+
]
19+
},
20+
"deno.enable": false,
21+
"typescript.preferences.importModuleSpecifier": "relative"
22+
}

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ Ethical AI upscaling for games. _(formerly "mender")_
1717

1818
## What does it do?
1919

20-
It upscales an image by a factor of $4$ (1K → 4K, etc.) with a minimal hit to performance.
21-
For the renderer implemented in the official example, it produces a $2024\times2024$ image ~12 times faster than targeting $2024\times2024$ directly.
20+
It upscales an image by a factor of $4$ (1K → 4K, etc.) with a minimal hit to
21+
performance. For the renderer implemented in the official example, it produces a
22+
$2024\times2024$ image ~12 times faster than targeting $2024\times2024$
23+
directly.
2224

2325
## Ethical?
2426

25-
The dataset that was used to train the upscaling neural network was generated with Blender's Geometry Nodes. **No artist's work was used in the process**.
27+
The dataset that was used to train the upscaling neural network was generated
28+
with Blender's Geometry Nodes. **No artist's work was used in the process**.
2629

2730
## Roadmap
2831

@@ -33,7 +36,8 @@ The dataset that was used to train the upscaling neural network was generated wi
3336
- [x] Implement inference on the WebGPU.
3437
- [ ] Use multisampling for render passes.
3538
- [ ] Create rasterizing renderer (polygonal geometry).
36-
- [ ] Extract into a separate package, to be used as an upscaling step in other WebGPU projects.
39+
- [ ] Extract into a separate package, to be used as an upscaling step in other
40+
WebGPU projects.
3741

3842
## Development
3943

@@ -42,4 +46,5 @@ The dataset that was used to train the upscaling neural network was generated wi
4246
- Install Node.js
4347
- Install pnpm
4448
- Run `pnpm install` to install all dependencies
45-
- Run `pnpm dev` to run the development server, making the web app available via the web browser.
49+
- Run `pnpm dev` to run the development server, making the web app available via
50+
the web browser.

apps/phoure-www/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ npm create astro@latest -- --template starlight
1515
1616
## 🚀 Project Structure
1717

18-
Inside of your Astro + Starlight project, you'll see the following folders and files:
18+
Inside of your Astro + Starlight project, you'll see the following folders and
19+
files:
1920

2021
```
2122
.
@@ -30,9 +31,11 @@ Inside of your Astro + Starlight project, you'll see the following folders and f
3031
└── tsconfig.json
3132
```
3233

33-
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
34+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory.
35+
Each file is exposed as a route based on its file name.
3436

35-
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
37+
Images can be added to `src/assets/` and embedded in Markdown with a relative
38+
link.
3639

3740
Static assets, like favicons, can be placed in the `public/` directory.
3841

@@ -51,4 +54,6 @@ All commands are run from the root of the project, from a terminal:
5154

5255
## 👀 Want to learn more?
5356

54-
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
57+
Check out [Starlight’s docs](https://starlight.astro.build/), read
58+
[the Astro documentation](https://docs.astro.build), or jump into the
59+
[Astro Discord server](https://astro.build/chat).

apps/phoure-www/deno.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"fmt": {
3+
"singleQuote": true,
4+
"exclude": ["pnpm-lock.yaml"]
5+
}
6+
}

apps/phoure-www/src/components/ControlsSidebar.tsx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CheckedState } from '@radix-ui/react-checkbox';
22
import type { SliderProps } from '@radix-ui/react-slider';
3-
import { type WritableAtom, useAtom, useSetAtom } from 'jotai';
3+
import { useAtom, useSetAtom, type WritableAtom } from 'jotai';
44
import { ChevronDown } from 'lucide-react';
55
import { useCallback, useId } from 'react';
66

@@ -28,15 +28,15 @@ import {
2828
import { Slider } from 'src/components/ui/slider';
2929
import { accumulatedLayersAtom } from 'src/lib/GameEngine/sdfRenderer/sdfRenderer.ts';
3030
import {
31-
type DisplayMode,
32-
DisplayModes,
3331
autoRotateControlAtom,
3432
autoRotateSpeedAtom,
3533
cameraFovControlAtom,
3634
cameraOrientationControlAtom,
3735
cameraYControlAtom,
3836
cameraZoomControlAtom,
37+
type DisplayMode,
3938
displayModeAtom,
39+
DisplayModes,
4040
fixedTimestepAtom,
4141
fixedTimestepEnabledAtom,
4242
targetResolutionAtom,
@@ -45,8 +45,8 @@ import { Separator } from './ui/separator';
4545

4646
function ControlLabel(props: { htmlFor: string; children: string }) {
4747
return (
48-
<div className="min-h-[2rem] flex items-center">
49-
<Label className="text-xs text-slate-500" htmlFor={props.htmlFor}>
48+
<div className='min-h-[2rem] flex items-center'>
49+
<Label className='text-xs text-slate-500' htmlFor={props.htmlFor}>
5050
{props.children}
5151
</Label>
5252
</div>
@@ -75,17 +75,17 @@ function SliderControl(
7575

7676
return (
7777
<>
78-
<div className="px-4 mt-2 mb-4">
78+
<div className='px-4 mt-2 mb-4'>
7979
<ControlLabel htmlFor={id}>{label}</ControlLabel>
80-
<div className="flex justify-self-stretch gap-2">
80+
<div className='flex justify-self-stretch gap-2'>
8181
<Slider
8282
{...rest}
8383
value={[value]}
8484
onValueChange={onValueChange}
85-
className="w-[180px]"
85+
className='w-[180px]'
8686
id={id}
8787
/>
88-
<p className="min-w-12 text-right">{value}</p>
88+
<p className='min-w-12 text-right'>{value}</p>
8989
</div>
9090
</div>
9191
</>
@@ -109,9 +109,9 @@ function CheckboxControl(props: {
109109
);
110110

111111
return (
112-
<div className="px-4 mt-4 flex items-center justify-between">
112+
<div className='px-4 mt-4 flex items-center justify-between'>
113113
<ControlLabel htmlFor={id}>{label}</ControlLabel>
114-
<Checkbox checked={checked} onCheckedChange={onCheckedChange} id="id" />
114+
<Checkbox checked={checked} onCheckedChange={onCheckedChange} id='id' />
115115
</div>
116116
);
117117
}
@@ -129,11 +129,11 @@ function DisplayModeControl() {
129129
);
130130

131131
return (
132-
<div className="px-4 my-2">
133-
<ControlLabel htmlFor="display-mode">Display mode</ControlLabel>
132+
<div className='px-4 my-2'>
133+
<ControlLabel htmlFor='display-mode'>Display mode</ControlLabel>
134134
<Select value={displayMode} onValueChange={onValueChange}>
135-
<SelectTrigger className="w-[180px]" id="display-mode">
136-
<SelectValue placeholder="Display mode" />
135+
<SelectTrigger className='w-[180px]' id='display-mode'>
136+
<SelectValue placeholder='Display mode' />
137137
</SelectTrigger>
138138
<SelectContent>
139139
{DisplayModes.map((mode) => (
@@ -160,11 +160,11 @@ function TargetResolutionControl() {
160160
);
161161

162162
return (
163-
<div className="px-4">
164-
<ControlLabel htmlFor="target-resolution">Target resolution</ControlLabel>
163+
<div className='px-4'>
164+
<ControlLabel htmlFor='target-resolution'>Target resolution</ControlLabel>
165165
<Select value={String(targetResolution)} onValueChange={onValueChange}>
166-
<SelectTrigger className="w-[180px]" id="target-resolution">
167-
<SelectValue placeholder="Target resolution" />
166+
<SelectTrigger className='w-[180px]' id='target-resolution'>
167+
<SelectValue placeholder='Target resolution' />
168168
</SelectTrigger>
169169
<SelectContent>
170170
<SelectItem value={'256'}>256x256</SelectItem>
@@ -190,12 +190,12 @@ function ControlGroup(props: ControlGroupProps) {
190190
const { label, children } = props;
191191

192192
return (
193-
<Collapsible defaultOpen className="group/collapsible">
193+
<Collapsible defaultOpen className='group/collapsible'>
194194
<SidebarGroup>
195195
<SidebarGroupLabel asChild>
196196
<CollapsibleTrigger>
197197
{label}
198-
<ChevronDown className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180" />
198+
<ChevronDown className='ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180' />
199199
</CollapsibleTrigger>
200200
</SidebarGroupLabel>
201201
<CollapsibleContent>
@@ -208,60 +208,60 @@ function ControlGroup(props: ControlGroupProps) {
208208

209209
export function ControlsSidebar() {
210210
return (
211-
<Sidebar side="left" variant="sidebar">
211+
<Sidebar side='left' variant='sidebar'>
212212
<SidebarContent>
213-
<ControlGroup label="Rendering">
213+
<ControlGroup label='Rendering'>
214214
<DisplayModeControl />
215215
<TargetResolutionControl />
216216
</ControlGroup>
217217
<Separator />
218-
<ControlGroup label="Time">
218+
<ControlGroup label='Time'>
219219
<CheckboxControl
220-
label="Fixed timestep"
220+
label='Fixed timestep'
221221
valueAtom={fixedTimestepEnabledAtom}
222222
/>
223223
<SliderControl
224-
label="Seconds per frame"
224+
label='Seconds per frame'
225225
valueAtom={fixedTimestepAtom}
226226
min={0.1}
227227
step={0.1}
228228
max={2}
229229
/>
230230
</ControlGroup>
231231
<Separator />
232-
<ControlGroup label="Camera">
232+
<ControlGroup label='Camera'>
233233
<SliderControl
234-
label="Up/down position"
234+
label='Up/down position'
235235
valueAtom={cameraYControlAtom}
236236
min={-0.2}
237237
step={0.01}
238238
max={1}
239239
/>
240240
<SliderControl
241-
label="Distance from origin"
241+
label='Distance from origin'
242242
valueAtom={cameraZoomControlAtom}
243243
min={1}
244244
step={0.01}
245245
max={4}
246246
/>
247247
<SliderControl
248-
label="Field of view"
248+
label='Field of view'
249249
valueAtom={cameraFovControlAtom}
250250
min={20}
251251
step={1}
252252
max={170}
253253
/>
254254
<SliderControl
255-
label="Yaw angle"
255+
label='Yaw angle'
256256
valueAtom={cameraOrientationControlAtom}
257257
max={360}
258258
/>
259259
<CheckboxControl
260-
label="Auto rotate"
260+
label='Auto rotate'
261261
valueAtom={autoRotateControlAtom}
262262
/>
263263
<SliderControl
264-
label="Auto rotate speed"
264+
label='Auto rotate speed'
265265
valueAtom={autoRotateSpeedAtom}
266266
min={0.5}
267267
step={0.01}

apps/phoure-www/src/components/DemoApp.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ export function DemoApp() {
1313
<SidebarProvider defaultOpen>
1414
<Provider store={store}>
1515
<ControlsSidebar />
16-
<main className="relative flex-1 flex bg-slate-200 min-h-screen justify-center items-center">
17-
<header className="absolute top-2 inset-x-0 h-10 flex justify-center items-center">
16+
<main className='relative flex-1 flex bg-slate-200 min-h-screen justify-center items-center'>
17+
<header className='absolute top-2 inset-x-0 h-10 flex justify-center items-center'>
1818
<img
19-
className="h-8"
20-
src="/phoure/phoure-logo-light.svg"
21-
alt="phoure logo"
19+
className='h-8'
20+
src='/phoure/phoure-logo-light.svg'
21+
alt='phoure logo'
2222
/>
23-
<h1 className="hidden">phoure</h1>
23+
<h1 className='hidden'>phoure</h1>
2424
</header>
25-
<div className="absolute top-2 left-2">
25+
<div className='absolute top-2 left-2'>
2626
<SidebarTrigger />
2727
</div>
2828
<div>
@@ -31,10 +31,10 @@ export function DemoApp() {
3131
</div>
3232
</main>
3333
<NavAside />
34-
<footer className="absolute bottom-2 right-2 text-sm font-poppins">
35-
<p className="whitespace-nowrap text-nowrap">
36-
Made with <HeartIcon className="w-4 h-4 inline-block" /> by Iwo
37-
Plaza
34+
<footer className='absolute bottom-2 right-2 text-sm font-poppins'>
35+
<p className='whitespace-nowrap text-nowrap'>
36+
Made with <HeartIcon className='w-4 h-4 inline-block' />{' '}
37+
by Iwo Plaza
3838
</p>
3939
</footer>
4040
</Provider>

apps/phoure-www/src/components/FpsCounter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function FPSCounter() {
6060
const fps = useSyncExternalStore(subscribe, getFPS);
6161

6262
return (
63-
<p className="text-xl text-white font-light">
64-
<span className="text-white/70">FPS:</span> {fps}
63+
<p className='text-xl text-white font-light'>
64+
<span className='text-white/70'>FPS:</span> {fps}
6565
</p>
6666
);
6767
}

apps/phoure-www/src/components/NavAside.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ import {
88

99
export function NavAside() {
1010
return (
11-
<aside className="absolute top-2 right-2 text-black">
11+
<aside className='absolute top-2 right-2 text-black'>
1212
<nav>
13-
<ul className="flex flex-row gap-2">
13+
<ul className='flex flex-row gap-2'>
1414
<li>
1515
<HoverCard openDelay={200} closeDelay={400}>
1616
<HoverCardTrigger>
1717
<CircleHelpIcon />
1818
</HoverCardTrigger>
1919
<HoverCardContent>
20-
<p className="text-sm text-justify">
21-
The goal of <strong>phoure</strong> is to be an upscaling
22-
solution that does not infringe on the rights of artists. Try
23-
it out in this live demo.
20+
<p className='text-sm text-justify'>
21+
The goal of <strong>phoure</strong>{' '}
22+
is to be an upscaling solution that does not infringe on the
23+
rights of artists. Try it out in this live demo.
2424
</p>
2525
</HoverCardContent>
2626
</HoverCard>
2727
</li>
2828
<li>
2929
<a
30-
href="https://github.com/iwoplaza/phoure"
31-
target="_blank"
32-
rel="noreferrer noopener"
30+
href='https://github.com/iwoplaza/phoure'
31+
target='_blank'
32+
rel='noreferrer noopener'
3333
>
3434
<GithubIcon />
3535
</a>

0 commit comments

Comments
 (0)