2022-05-10 13:52:06 +00:00
|
|
|
import { h, Ref } from 'preact';
|
|
|
|
|
2022-06-03 22:30:39 +00:00
|
|
|
import styles from './css/Screen.module.css';
|
|
|
|
|
2022-05-10 13:52:06 +00:00
|
|
|
/**
|
|
|
|
* 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 (
|
2022-06-03 22:30:39 +00:00
|
|
|
<div className={styles.display}>
|
|
|
|
<div className={styles.overscan}>
|
|
|
|
<canvas
|
|
|
|
className={styles.screen}
|
|
|
|
width="592"
|
|
|
|
height="416"
|
|
|
|
ref={screen}
|
|
|
|
/>
|
2022-05-10 13:52:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|