import { type Component, For } from 'solid-js';
const browsers: ReadonlyArray<{ name: string; version: string }> = [
{ name: 'Chrome', version: '113+' },
{ name: 'Edge', version: '113+' },
{ name: 'Safari', version: '18+' },
{ name: 'Firefox', version: 'stable (2025+)' },
];
export const NoWebGPUScreen: Component = () => {
return (
<div
style={{
position: 'absolute',
inset: '0',
display: 'grid',
'place-items': 'center',
background: 'var(--surface-vault)',
padding: '32px',
}}
>
<div style={{ 'max-width': '480px', 'text-align': 'center' }}>
<div
style={{
'font-family': 'var(--font-display)',
'font-size': 'var(--text-2xl)',
'font-weight': '600',
'letter-spacing': 'var(--tracking-tight)',
color: 'var(--fg-primary)',
'margin-bottom': '12px',
}}
>
Your browser is too old for Physarum.
</div>
<div
style={{
'font-family': 'var(--font-body)',
'font-size': 'var(--text-base)',
'line-height': 'var(--leading-relaxed)',
color: 'var(--fg-secondary)',
'margin-bottom': '24px',
}}
>
Physarum runs on WebGPU. Most modern browsers support it. Update or switch to one of
these:
</div>
<div
style={{
display: 'grid',
'grid-template-columns': '1fr 1fr',
gap: '8px',
'margin-bottom': '24px',
}}
>
<For each={browsers}>
{(b) => (
<div
style={{
padding: '12px',
background: 'var(--surface-raised)',
border: '1px solid var(--border-subtle)',
'border-radius': 'var(--radius-md)',
display: 'flex',
'flex-direction': 'column',
gap: '4px',
}}
>
<span
style={{
'font-family': 'var(--font-body)',
'font-size': 'var(--text-sm)',
'font-weight': '500',
color: 'var(--fg-primary)',
}}
>
{b.name}
</span>
<span
style={{
'font-family': 'var(--font-mono)',
'font-size': 'var(--text-xs)',
color: 'var(--fg-tertiary)',
'letter-spacing': '0.08em',
}}
>
{b.version}
</span>
</div>
)}
</For>
</div>
<a
href="https://webgpureport.org"
target="_blank"
rel="noopener noreferrer"
style={{
'font-family': 'var(--font-mono)',
'font-size': 'var(--text-xs)',
color: 'var(--signal-circuit)',
'letter-spacing': '0.08em',
'text-decoration': 'none',
}}
>
Check WebGPU support →
</a>
</div>
</div>
);
};