diff --git a/packages/website/src/components/Armor/components/ShotDisplay.tsx b/packages/website/src/components/Armor/components/ShotDisplay.tsx index 7cdd9027d..055f6e4fc 100644 --- a/packages/website/src/components/Armor/components/ShotDisplay.tsx +++ b/packages/website/src/components/Armor/components/ShotDisplay.tsx @@ -16,6 +16,7 @@ import { Path, Quaternion, } from 'three'; +import { isHalloween } from '../../../core/blitzkit/isHalloween'; import { LocaleProvider, useLocale } from '../../../hooks/useLocale'; import { TankopediaEphemeral, @@ -72,11 +73,8 @@ export function ShotDisplay() { }); useEffect(() => { - const data = new Date(); - const isHalloween = data.getMonth() === 9 && data.getDate() === 31; - if ( - isHalloween && + isHalloween() && shot?.splashRadius !== undefined && shot.in.status === 'penetration' ) { diff --git a/packages/website/src/components/HelpingSpotLight.tsx b/packages/website/src/components/HelpingSpotLight.tsx index 74451c5e7..375f8b8ed 100644 --- a/packages/website/src/components/HelpingSpotLight.tsx +++ b/packages/website/src/components/HelpingSpotLight.tsx @@ -1,10 +1,17 @@ import type { SpotLightProps } from '@react-three/fiber'; +import { memo } from 'react'; +import { Color } from 'three'; +import { isHalloween } from '../core/blitzkit/isHalloween'; interface Props extends SpotLightProps { debug?: boolean; } -export function HelpingSpotLight({ debug, ...props }: Props) { +export const HelpingSpotLight = memo(({ debug, ...props }) => { + const color = new Color(); + + if (isHalloween()) color.set(1, 0.25, 0.25); + return ( <> {debug && ( @@ -14,7 +21,7 @@ export function HelpingSpotLight({ debug, ...props }: Props) { )} - + ); -} +}); diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx index ea0652314..b344420bf 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/SceneProps/index.tsx @@ -3,7 +3,7 @@ import { clamp } from 'lodash-es'; import { useRef } from 'react'; import { MeshStandardMaterial } from 'three'; -const SIZE = 2 ** 6; +const SIZE = 2 ** 5; export function SceneProps() { const material = useRef(null); diff --git a/packages/website/src/core/blitzkit/isHalloween.ts b/packages/website/src/core/blitzkit/isHalloween.ts new file mode 100644 index 000000000..c05deb5f5 --- /dev/null +++ b/packages/website/src/core/blitzkit/isHalloween.ts @@ -0,0 +1,4 @@ +export function isHalloween() { + const data = new Date(); + return data.getMonth() === 9 && data.getDate() === 31; +}