Completely purge CursorFire component and cursor digit/particle trails from Layout
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -348,10 +348,9 @@ export default function Layout({ children }: LayoutProps) {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`layout${isMobile ? ' layout--mobile' : ''}${othersOnline ? ' layout--comrades-online' : ''}${!isMobile && glowParticles ? ' layout--hacker-cursor' : ''}`}
|
||||
className={`layout${isMobile ? ' layout--mobile' : ''}${othersOnline ? ' layout--comrades-online' : ''}`}
|
||||
data-operator-deck={operatorDeckId(location.pathname)}
|
||||
>
|
||||
{!isMobile && glowParticles && <CursorFire />}
|
||||
<AmbientBackground weather={pageWeather} />
|
||||
{glowParticles && <SacredGeometryLayer />}
|
||||
<nav className="sidebar sidebar--desktop desktop-only">
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import { useRef } from 'react';
|
||||
import './CursorFire.css';
|
||||
|
||||
export default function CursorFire() {
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
return <canvas ref={canvasRef} className="cursor-hacker-fx" aria-hidden="true" />;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -907,29 +907,10 @@ describe('AmbientBackground', () => {
|
||||
describe('CursorFire', () => {
|
||||
afterEach(() => cleanup());
|
||||
|
||||
it('mounts fullscreen hacker-trail canvas', () => {
|
||||
it('returns null as cursor particle effects are disabled', () => {
|
||||
const { container } = render(<CursorFire />);
|
||||
const canvas = container.querySelector('canvas.cursor-hacker-fx');
|
||||
expect(canvas).toBeTruthy();
|
||||
expect(canvas).toHaveAttribute('aria-hidden', 'true');
|
||||
});
|
||||
|
||||
it('skips animation loop when prefers-reduced-motion', () => {
|
||||
const rafSpy = vi.spyOn(window, 'requestAnimationFrame');
|
||||
const matchMediaSpy = vi.spyOn(window, 'matchMedia').mockReturnValue({
|
||||
matches: true,
|
||||
media: '(prefers-reduced-motion: reduce)',
|
||||
onchange: null,
|
||||
addListener: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
});
|
||||
render(<CursorFire />);
|
||||
expect(rafSpy).not.toHaveBeenCalled();
|
||||
matchMediaSpy.mockRestore();
|
||||
rafSpy.mockRestore();
|
||||
expect(canvas).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -990,7 +971,7 @@ describe('Layout', () => {
|
||||
expect(screen.getByRole('link', { name: /Onion/i })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('mounts MatrixRain on Command Deck only and CursorFire on all desktop deck pages', async () => {
|
||||
it('mounts MatrixRain on Command Deck only', async () => {
|
||||
const { container: deck } = render(
|
||||
<MemoryRouter initialEntries={['/dashboard']} future={routerFuture}>
|
||||
<Layout>
|
||||
@@ -1000,7 +981,6 @@ describe('Layout', () => {
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(deck.querySelector('.matrix-rain-canvas')).toBeTruthy();
|
||||
expect(deck.querySelector('.cursor-hacker-fx')).toBeTruthy();
|
||||
});
|
||||
cleanup();
|
||||
|
||||
@@ -1015,7 +995,5 @@ describe('Layout', () => {
|
||||
expect(screen.getByText('crucible')).toBeInTheDocument();
|
||||
});
|
||||
expect(crucible.querySelector('.matrix-rain-canvas')).toBeNull();
|
||||
expect(crucible.querySelector('.cursor-hacker-fx')).toBeTruthy();
|
||||
expect(crucible.querySelector('.layout--hacker-cursor')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user