mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
9173bff1ba
Restrict element types and global styling to improve embedability
33 lines
723 B
TypeScript
33 lines
723 B
TypeScript
import { h, Ref } from 'preact';
|
|
|
|
import styles from './css/Screen.module.scss';
|
|
|
|
/**
|
|
* Screen properties
|
|
*/
|
|
export interface ScreenProps {
|
|
screenRef: Ref<HTMLCanvasElement>;
|
|
}
|
|
|
|
/**
|
|
* Styled canvas element that the Apple II display is
|
|
* rendered to by VideoModes.
|
|
*
|
|
* @param screen Canvas element reference
|
|
* @returns
|
|
*/
|
|
export const Screen = ({ screenRef }: ScreenProps) => {
|
|
return (
|
|
<div className={styles.display}>
|
|
<div className={styles.overscan}>
|
|
<canvas
|
|
className={styles.screen}
|
|
width="592"
|
|
height="416"
|
|
ref={screenRef}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|