apple2js/js/components/Screen.tsx
Will Scullin 4a188a9a5c
Preact UI (#106)
First pass at a Preact UI, still short some major features but full proof of concept.
2022-05-10 06:52:06 -07:00

26 lines
531 B
TypeScript

import { h, Ref } from 'preact';
/**
* Screen properties
*/
export interface ScreenProps {
screen: Ref<HTMLCanvasElement>;
}
/**
* Styled canvas element that the Apple II display is
* rendered to by VideoModes.
*
* @param screen Canvas element reference
* @returns
*/
export const Screen = ({ screen }: ScreenProps) => {
return (
<div id="display">
<div class="overscan">
<canvas id="screen" width="592" height="416" ref={screen} />
</div>
</div>
);
};