import { css } from "@linaria/core" import type { CSSProperties, ReactNode } from "react" import React from "react" /** width / heigt */ const hexAspectRatio = 4 / 3 * Math.sqrt(3) / 2 export function HexGrid({ gap, rows, cols, children }: { gap: number, rows: number, cols: number, children: ReactNode }) { return (
{children}
) } export function Hex({ children, row, col }: { children: ReactNode, row: number, col: number }) { const colStyle = css` /* available height minus total y gaps divided by rows */ --hex-height: calc( (100% - (var(--hex-rows) - 1) * var(--hex-y-gap)) / var(--hex-rows) ); position: absolute; width: var(--hex-width); height: var(--hex-height); top: calc((var(--hex-height) + var(--hex-y-gap)) * var(--hex-row)); left: calc((var(--hex-width) * 3 / 4 + var(--hex-x-gap)) * var(--hex-col)); ` return
{children}
}