diff --git a/examples/web/index.ts b/examples/web/index.ts index b5286b248ccd144e25de034f9c2c9ed353586eda..e8e3ff62e21268ceac08cffa754f14c76886bdfb 100644 --- a/examples/web/index.ts +++ b/examples/web/index.ts @@ -17,19 +17,12 @@ import info from "./package.json"; declare const require: any; -const PIXEL_UNSET_COLOR = 0x1b1a17ff; - const LOGIC_HZ = 600; const VISUAL_HZ = 60; -const TIMER_HZ = 60; const IDLE_HZ = 10; const FREQUENCY_DELTA = 60; -const DISPLAY_WIDTH = 160; -const DISPLAY_HEIGHT = 144; -const DISPLAY_RATIO = DISPLAY_WIDTH / DISPLAY_HEIGHT; - const SAMPLE_RATE = 2; const BACKGROUNDS = [ @@ -82,7 +75,6 @@ class GameboyEmulator extends Observable implements Emulator { private logicFrequency: number = LOGIC_HZ; private visualFrequency: number = VISUAL_HZ; - private timerFrequency: number = TIMER_HZ; private idleFrequency: number = IDLE_HZ; private toastTimeout: number | null = null; @@ -800,7 +792,7 @@ class GameboyEmulator extends Observable implements Emulator { return { name: this.romName || undefined, data: this.romData || undefined, - size: this.romData?.length, + size: this.romSize, extra: { romType: this.cartridge?.rom_type_s(), romSize: this.cartridge?.rom_size_s(), diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx index 82446e8e1e44c3296e3a6365df4ef3d051a89fec..6cc0fba4e5024022c51559e4c54d7e6f31fdca2d 100644 --- a/examples/web/react/app.tsx +++ b/examples/web/react/app.tsx @@ -254,6 +254,7 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { "Are you sure you want to start a benchmark?\nThe benchmark is considered an expensive operation!", "Confirm" ); + alert(`Will run it as ${result}`); }; const onFullscreenClick = () => { setFullscreen(!fullscreen); diff --git a/examples/web/react/components/index.ts b/examples/web/react/components/index.ts index b37d84ce9f58cff8ce8dc97d02df2866035ac841..447bf8507fa98c09ca9c56998c0d9421e9cc48af 100644 --- a/examples/web/react/components/index.ts +++ b/examples/web/react/components/index.ts @@ -12,3 +12,4 @@ export * from "./panel-split/panel-split"; export * from "./paragraph/paragraph"; export * from "./section/section"; export * from "./title/title"; +export * from "./toast/toast"; diff --git a/examples/web/react/components/modal/modal.tsx b/examples/web/react/components/modal/modal.tsx index 0f632a0b02a8274043922da45aea04e953ceaf81..15040026843d3e7a642da9de54869e6fa7541731 100644 --- a/examples/web/react/components/modal/modal.tsx +++ b/examples/web/react/components/modal/modal.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, FC, ButtonHTMLAttributes, useEffect } from "react"; +import React, { FC, useEffect } from "react"; import Button from "../button/button"; import "./modal.css"; diff --git a/examples/web/react/components/toast/toast.css b/examples/web/react/components/toast/toast.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/examples/web/react/components/toast/toast.tsx b/examples/web/react/components/toast/toast.tsx new file mode 100644 index 0000000000000000000000000000000000000000..5f0efbe8daa070d6a8fd8b5d58bb53786036ff66 --- /dev/null +++ b/examples/web/react/components/toast/toast.tsx @@ -0,0 +1,14 @@ +import React, { FC } from "react"; + +import "./toast.css"; + +type ToastProps = { + style?: string[]; +}; + +export const Toast: FC<ToastProps> = ({ style = [] }) => { + const classes = () => ["toast", ...style].join(" "); + return <div className={classes()}></div>; +}; + +export default Toast; diff --git a/examples/web/tsconfig.json b/examples/web/tsconfig.json index 8f83dd8e31c5ab0b458c75bafaedad1b74ca9698..d38b2b510692a48dc85856135ce5d04fd93c0faa 100644 --- a/examples/web/tsconfig.json +++ b/examples/web/tsconfig.json @@ -7,6 +7,7 @@ "target": "es6", "noImplicitAny": true, "noImplicitThis": true, + "noUnusedLocals": true, "alwaysStrict": true, "strictBindCallApply": true, "strictNullChecks": true,