feat(wordsearch): плотные градиенты клеток + фиолетовые кнопки
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useRef, useCallback, useEffect, memo, useMemo } from 'react';
|
||||
import { colors, radius, shadows } from '../styles/theme';
|
||||
import { colors, radius, shadows, cellShadows } from '../styles/theme';
|
||||
|
||||
interface CellProps {
|
||||
letter: string;
|
||||
@@ -13,6 +13,8 @@ interface CellProps {
|
||||
}
|
||||
|
||||
const Cell = memo<CellProps>(({ letter, size, fontSize, bg, border, textColor, boxShadow, animation }) => {
|
||||
// 🔧 ФИКС (30.09.2026): градиенты без бордера (или тонкий полупрозрачный)
|
||||
const isGradient = typeof bg === 'string' && bg.startsWith('linear-gradient');
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@@ -23,16 +25,17 @@ const Cell = memo<CellProps>(({ letter, size, fontSize, bg, border, textColor, b
|
||||
justifyContent: 'center',
|
||||
borderRadius: radius.sm,
|
||||
background: bg,
|
||||
border: `2px solid ${border}`,
|
||||
border: isGradient ? 'none' : `2px solid ${border}`,
|
||||
color: textColor,
|
||||
fontSize: `${fontSize}px`,
|
||||
fontWeight: bg !== colors.cellDefault ? 700 : 500,
|
||||
fontWeight: 700,
|
||||
fontFamily: 'Inter, sans-serif',
|
||||
transition: animation ? 'all 0.3s ease' : 'all 0.15s ease',
|
||||
pointerEvents: 'none',
|
||||
boxShadow: boxShadow,
|
||||
animation: animation || undefined,
|
||||
willChange: bg !== colors.cellDefault ? 'transform, box-shadow' : 'auto',
|
||||
willChange: 'transform, box-shadow',
|
||||
textShadow: isGradient ? '0 1px 2px rgba(0,0,0,0.15)' : 'none',
|
||||
}}
|
||||
>
|
||||
{letter}
|
||||
@@ -304,30 +307,29 @@ const LetterGrid: React.FC<LetterGridProps> = ({
|
||||
const found = foundCells.has(key);
|
||||
const newFound = newFoundCells.has(key);
|
||||
|
||||
let bg = colors.cellDefault;
|
||||
let border = colors.border;
|
||||
let textColor = colors.text;
|
||||
// 🔧 ОБНОВЛЕНО (30.09.2026): плотные градиенты + белые буквы.
|
||||
let bg = colors.cellDefault; // фиолетовый градиент
|
||||
let border = 'transparent';
|
||||
let textColor = '#FFFFFF'; // всегда белый
|
||||
let animation = '';
|
||||
let boxShadow = shadows.cell;
|
||||
let boxShadow = cellShadows.default;
|
||||
|
||||
if (found) {
|
||||
bg = colors.cellFound;
|
||||
border = colors.success;
|
||||
textColor = '#1a7a3a';
|
||||
bg = colors.cellFound; // зелёный градиент
|
||||
textColor = '#FFFFFF';
|
||||
boxShadow = cellShadows.found;
|
||||
if (newFound) {
|
||||
animation = 'cellPopIn 0.4s ease, cellGlow 1s ease 0.4s';
|
||||
}
|
||||
} else if (first) {
|
||||
bg = colors.cellFirst;
|
||||
border = colors.gold;
|
||||
textColor = '#b8860b';
|
||||
bg = colors.cellFirst; // золотой градиент
|
||||
textColor = '#FFFFFF';
|
||||
animation = 'firstLetterPulse 1s ease infinite';
|
||||
boxShadow = '0 0 10px rgba(255, 215, 0, 0.5)';
|
||||
boxShadow = cellShadows.first;
|
||||
} else if (selected) {
|
||||
bg = colors.cellSelected;
|
||||
border = colors.accent;
|
||||
textColor = colors.accent;
|
||||
boxShadow = `0 0 8px ${colors.accent}40`;
|
||||
bg = colors.cellSelected; // оранжевый градиент
|
||||
textColor = '#FFFFFF';
|
||||
boxShadow = cellShadows.selected;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -75,8 +75,11 @@ const WordSearchPage: React.FC = () => {
|
||||
|
||||
const confettiColors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F', '#FF8A5C', '#2ECC71'];
|
||||
|
||||
const brandColor = '#2ECC71';
|
||||
const palette = { play: brandColor };
|
||||
// 🔧 ОБНОВЛЕНО (30.09.2026): фиолетовые кнопки, зелёный — только для "найдено"
|
||||
const brandColor = '#2ECC71'; // зелёный (для очков, "найдено")
|
||||
const buttonColor = '#7A3AFF'; // фиолетовый (для кнопок)
|
||||
const buttonGradient = 'linear-gradient(135deg, #7A3AFF 0%, #A86BFF 100%)';
|
||||
const palette = { play: buttonColor };
|
||||
const textColor = '#1A1A2E';
|
||||
const subColor = '#6B7280';
|
||||
const bgColor = '#F4F5F7';
|
||||
@@ -689,15 +692,16 @@ const WordSearchPage: React.FC = () => {
|
||||
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
|
||||
<button onClick={() => navigate('/menu')}
|
||||
style={{
|
||||
...glass({
|
||||
padding: '10px 18px',
|
||||
borderRadius: radius.md,
|
||||
}),
|
||||
color: textColor,
|
||||
padding: '10px 18px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: buttonGradient,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
transition: 'transform 0.2s ease',
|
||||
boxShadow: '0 4px 14px rgba(122, 58, 255, 0.4)',
|
||||
}}
|
||||
onTouchStart={(e) => { e.currentTarget.style.transform = 'scale(0.95)'; }}
|
||||
onTouchEnd={(e) => { e.currentTarget.style.transform = 'scale(1)'; }}
|
||||
@@ -707,20 +711,21 @@ const WordSearchPage: React.FC = () => {
|
||||
<button
|
||||
onClick={() => setShowRules(true)}
|
||||
style={{
|
||||
...glass({
|
||||
width: '40px',
|
||||
height: '40px',
|
||||
borderRadius: radius.md,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}),
|
||||
color: textColor,
|
||||
width: '40px',
|
||||
height: '40px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: buttonGradient,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '18px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
transition: 'transform 0.2s ease',
|
||||
flexShrink: 0,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
boxShadow: '0 4px 14px rgba(122, 58, 255, 0.4)',
|
||||
}}
|
||||
onTouchStart={(e) => { e.currentTarget.style.transform = 'scale(0.95)'; }}
|
||||
onTouchEnd={(e) => { e.currentTarget.style.transform = 'scale(1)'; }}
|
||||
|
||||
+17
-4
@@ -18,10 +18,23 @@ export const colors = {
|
||||
danger: '#FF3B30',
|
||||
border: 'rgba(0,0,0,0.06)',
|
||||
borderStrong: 'rgba(0,0,0,0.12)',
|
||||
cellDefault: '#FFFFFF',
|
||||
cellSelected: 'rgba(108,92,231,0.15)',
|
||||
cellFound: 'rgba(52,199,89,0.2)',
|
||||
cellFirst: 'rgba(249,202,36,0.3)',
|
||||
|
||||
// 🔧 ОБНОВЛЕНО (30.09.2026): плотные градиенты для клеток филвордов.
|
||||
// Фон — градиент, буква — белая.
|
||||
cellDefault: 'linear-gradient(135deg, #7A3AFF 0%, #A86BFF 100%)',
|
||||
cellSelected: 'linear-gradient(135deg, #F9471E 0%, #FF9A3D 100%)',
|
||||
cellFound: 'linear-gradient(135deg, #1FD1A5 0%, #6BF0CB 100%)',
|
||||
cellFirst: 'linear-gradient(135deg, #F9CA24 0%, #FFE066 100%)',
|
||||
cellError: 'linear-gradient(135deg, #F35073 0%, #FF7A94 100%)',
|
||||
};
|
||||
|
||||
// 🔧 НОВОЕ (30.09.2026): тени под градиенты клеток
|
||||
export const cellShadows = {
|
||||
default: '0 4px 12px rgba(122, 58, 255, 0.35)',
|
||||
selected: '0 4px 14px rgba(249, 71, 30, 0.5)',
|
||||
found: '0 4px 14px rgba(31, 209, 165, 0.5)',
|
||||
first: '0 4px 14px rgba(249, 202, 36, 0.5)',
|
||||
error: '0 4px 14px rgba(243, 80, 115, 0.5)',
|
||||
};
|
||||
|
||||
export const fonts = {
|
||||
|
||||
Reference in New Issue
Block a user