2022-09-07 17:33:54 +00:00
|
|
|
import react from 'react';
|
|
|
|
|
|
|
|
import '../theme/background.css';
|
|
|
|
|
2022-09-07 19:44:59 +00:00
|
|
|
const Background: react.FC<{ shift: { x: number; y: number } }> = (props: {
|
|
|
|
shift: { x: number; y: number };
|
|
|
|
}) => {
|
2022-09-08 13:00:36 +00:00
|
|
|
console.log(`--- Rendering background, props: ${JSON.stringify(props)} ---`);
|
2022-09-07 21:19:42 +00:00
|
|
|
|
2022-09-07 17:33:54 +00:00
|
|
|
return (
|
2022-09-07 19:44:59 +00:00
|
|
|
<div
|
|
|
|
className='background'
|
|
|
|
style={{
|
|
|
|
transform: `translate(${-props.shift.x}px, ${-props.shift.y}px)`,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<img src='/assets/background.jpg' alt='' />
|
2022-09-07 17:33:54 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Background;
|