import handleShowRTPInRulesOption from './handleShowRTPInRulesOption';

/**
 * Inserts the canvas into the DOM and prepares supporting nodes.
 * @param canvas
 */
export default function setupDom(canvas: HTMLCanvasElement): void
{
    document.body.addEventListener('contextmenu', (event) => event.preventDefault());

    const content = document.createElement('div');

    content.classList.add('content');
    document.body.appendChild(content);

    const container = document.createElement('div');

    container.classList.add('canvas-wrapper');
    content.appendChild(container);
    canvas.classList.add('webgl');
    container.appendChild(canvas);

    const spacer = document.createElement('div');

    spacer.classList.add('spacer');
    document.body.appendChild(spacer);

    handleShowRTPInRulesOption();
}
