theme fix
This commit is contained in:
+21
-16
@@ -28,7 +28,6 @@
|
|||||||
background-image: var(--background-image);
|
background-image: var(--background-image);
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
transition: background-image 350ms ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.app::after {
|
.app::after {
|
||||||
@@ -63,11 +62,14 @@
|
|||||||
--accent: #a84524;
|
--accent: #a84524;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app.theme-black .orb,
|
.app .orb {
|
||||||
.app.theme-white .orb {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app.theme-violet .orb {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.app.theme-light::after {
|
.app.theme-light::after {
|
||||||
background: rgb(0 0 0 / var(--light-overlay-opacity, 0.07));
|
background: rgb(0 0 0 / var(--light-overlay-opacity, 0.07));
|
||||||
}
|
}
|
||||||
@@ -168,12 +170,6 @@
|
|||||||
animation: liquid-float 22s ease-in-out infinite alternate;
|
animation: liquid-float 22s ease-in-out infinite alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app.theme-motion-lava .orb,
|
|
||||||
.app.theme-motion-liquid .orb {
|
|
||||||
opacity: 0.38;
|
|
||||||
animation: orb-breathe 14s ease-in-out infinite alternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
.topbar {
|
.topbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -264,11 +260,25 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
display: grid;
|
display: flex;
|
||||||
place-items: center;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 1.1rem;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.focus-mode-phase {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--clock-color, currentColor);
|
||||||
|
font-family: var(--app-font, 'Space Grotesk', sans-serif);
|
||||||
|
font-size: clamp(0.75rem, 1.8vw, 1rem);
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.18em;
|
||||||
|
opacity: 0.72;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
.focus-mode-time {
|
.focus-mode-time {
|
||||||
color: var(--clock-color, currentColor);
|
color: var(--clock-color, currentColor);
|
||||||
font-family: var(--app-font, 'Space Grotesk', sans-serif);
|
font-family: var(--app-font, 'Space Grotesk', sans-serif);
|
||||||
@@ -882,11 +892,6 @@ h1 {
|
|||||||
100% { background-position: 35% 55%; transform: scale(1.04) rotate(-1deg); }
|
100% { background-position: 35% 55%; transform: scale(1.04) rotate(-1deg); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes orb-breathe {
|
|
||||||
0% { transform: translate3d(-4%, 2%, 0) scale(0.9); }
|
|
||||||
100% { transform: translate3d(8%, -7%, 0) scale(1.18); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from { opacity: 0; }
|
from { opacity: 0; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ describe('Pomodoro app', () => {
|
|||||||
const focusModeTrigger = screen.getByRole('button', { name: 'Enter focus mode' })
|
const focusModeTrigger = screen.getByRole('button', { name: 'Enter focus mode' })
|
||||||
fireEvent.click(focusModeTrigger)
|
fireEvent.click(focusModeTrigger)
|
||||||
expect(screen.getByLabelText('Current time with seconds')).toHaveTextContent('10:08:09')
|
expect(screen.getByLabelText('Current time with seconds')).toHaveTextContent('10:08:09')
|
||||||
|
expect(screen.getByText('Focus session')).toBeInTheDocument()
|
||||||
expect(screen.queryByRole('button', { name: 'Customize' })).not.toBeInTheDocument()
|
expect(screen.queryByRole('button', { name: 'Customize' })).not.toBeInTheDocument()
|
||||||
expect(screen.queryByLabelText('Time remaining')).not.toBeInTheDocument()
|
expect(screen.queryByLabelText('Time remaining')).not.toBeInTheDocument()
|
||||||
|
|
||||||
@@ -181,6 +182,7 @@ describe('Pomodoro app', () => {
|
|||||||
fireEvent.click(screen.getByRole('button', { name: 'Enter focus mode' }))
|
fireEvent.click(screen.getByRole('button', { name: 'Enter focus mode' }))
|
||||||
|
|
||||||
expect(screen.getByLabelText('Short break time remaining')).toHaveTextContent('05:00')
|
expect(screen.getByLabelText('Short break time remaining')).toHaveTextContent('05:00')
|
||||||
|
expect(screen.getByText('Short break')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('starts, pauses, resumes, and resets the countdown', async () => {
|
it('starts, pauses, resumes, and resets the countdown', async () => {
|
||||||
@@ -345,13 +347,31 @@ describe('Pomodoro app', () => {
|
|||||||
fireEvent.click(screen.getByRole('radio', { name: 'Lava bloom' }))
|
fireEvent.click(screen.getByRole('radio', { name: 'Lava bloom' }))
|
||||||
const app = screen.getByTestId('app')
|
const app = screen.getByTestId('app')
|
||||||
expect(app).toHaveClass('theme-motion-lava')
|
expect(app).toHaveClass('theme-motion-lava')
|
||||||
|
expect(app.style.getPropertyValue('--background-image')).not.toMatch(/,\s*#[0-9a-f]{6}$/i)
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole('radio', { name: 'Liquid aurora' }))
|
fireEvent.click(screen.getByRole('radio', { name: 'Liquid aurora' }))
|
||||||
expect(app).toHaveClass('theme-motion-liquid')
|
expect(app).toHaveClass('theme-motion-liquid')
|
||||||
|
expect(app.style.getPropertyValue('--background-image')).not.toMatch(/,\s*#[0-9a-f]{6}$/i)
|
||||||
expect(appCss).toMatch(/@keyframes lava-drift/)
|
expect(appCss).toMatch(/@keyframes lava-drift/)
|
||||||
expect(appCss).toMatch(/@keyframes liquid-float/)
|
expect(appCss).toMatch(/@keyframes liquid-float/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('shows the decorative color orbs only on Violet haze', async () => {
|
||||||
|
await renderHydratedApp()
|
||||||
|
expect(appCss).toMatch(/\.app \.orb\s*{[\s\S]*display:\s*none/)
|
||||||
|
expect(appCss).toMatch(/\.app\.theme-violet \.orb\s*{[\s\S]*display:\s*block/)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('applies a valid green background to Quiet aurora', async () => {
|
||||||
|
await renderHydratedApp()
|
||||||
|
fireEvent.click(screen.getByRole('button', { name: 'Customize' }))
|
||||||
|
fireEvent.click(screen.getByRole('radio', { name: 'Quiet aurora' }))
|
||||||
|
|
||||||
|
const background = screen.getByTestId('app').style.getPropertyValue('--background-image')
|
||||||
|
expect(background).toContain('#2e9f83')
|
||||||
|
expect(background).not.toMatch(/,\s*#[0-9a-f]{6}$/i)
|
||||||
|
})
|
||||||
|
|
||||||
it('keeps a custom clock color behind a separate control when themes change', async () => {
|
it('keeps a custom clock color behind a separate control when themes change', async () => {
|
||||||
const store = new MemorySettingsStore()
|
const store = new MemorySettingsStore()
|
||||||
await renderHydratedApp(store)
|
await renderHydratedApp(store)
|
||||||
|
|||||||
@@ -455,6 +455,7 @@ function App({
|
|||||||
|
|
||||||
{focusMode && (
|
{focusMode && (
|
||||||
<section className="focus-mode-view">
|
<section className="focus-mode-view">
|
||||||
|
<p className="focus-mode-phase">{PHASE_LABELS[timer.phase]}</p>
|
||||||
{timer.status === 'idle' ? (
|
{timer.status === 'idle' ? (
|
||||||
<time aria-label="Current time with seconds" className="focus-mode-time">
|
<time aria-label="Current time with seconds" className="focus-mode-time">
|
||||||
{formatClock(currentTime, true)}
|
{formatClock(currentTime, true)}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const BACKGROUND_OPTIONS: Array<{
|
|||||||
{
|
{
|
||||||
id: 'aurora',
|
id: 'aurora',
|
||||||
label: 'Quiet aurora',
|
label: 'Quiet aurora',
|
||||||
css: 'radial-gradient(circle at 28% 72%, #2e9f83 0%, transparent 38%), radial-gradient(circle at 78% 18%, #5755a8 0%, transparent 42%), #101e2d',
|
css: 'radial-gradient(circle at 28% 72%, #2e9f83 0%, transparent 38%), radial-gradient(circle at 78% 18%, #216d64 0%, transparent 42%), linear-gradient(145deg, #0a1f23, #123d35)',
|
||||||
preview: 'linear-gradient(135deg, #183244, #2e9f83)',
|
preview: 'linear-gradient(135deg, #183244, #2e9f83)',
|
||||||
clockColor: '#effffb',
|
clockColor: '#effffb',
|
||||||
foregroundColor: '#effffb',
|
foregroundColor: '#effffb',
|
||||||
@@ -85,7 +85,7 @@ export const BACKGROUND_OPTIONS: Array<{
|
|||||||
{
|
{
|
||||||
id: 'lava',
|
id: 'lava',
|
||||||
label: 'Lava bloom',
|
label: 'Lava bloom',
|
||||||
css: 'radial-gradient(circle at 18% 28%, #ff4d6d 0%, transparent 34%), radial-gradient(circle at 78% 70%, #ff9f1c 0%, transparent 38%), radial-gradient(circle at 62% 18%, #8338ec 0%, transparent 32%), #210b2c',
|
css: 'radial-gradient(circle at 18% 28%, #ff4d6d 0%, transparent 34%), radial-gradient(circle at 78% 70%, #ff9f1c 0%, transparent 38%), radial-gradient(circle at 62% 18%, #8338ec 0%, transparent 32%), linear-gradient(145deg, #210b2c, #12081d)',
|
||||||
preview: 'linear-gradient(135deg, #ff4d6d, #ff9f1c 54%, #6f2dbd)',
|
preview: 'linear-gradient(135deg, #ff4d6d, #ff9f1c 54%, #6f2dbd)',
|
||||||
clockColor: '#fff7ee',
|
clockColor: '#fff7ee',
|
||||||
foregroundColor: '#fff7ee',
|
foregroundColor: '#fff7ee',
|
||||||
@@ -95,7 +95,7 @@ export const BACKGROUND_OPTIONS: Array<{
|
|||||||
{
|
{
|
||||||
id: 'liquid',
|
id: 'liquid',
|
||||||
label: 'Liquid aurora',
|
label: 'Liquid aurora',
|
||||||
css: 'radial-gradient(circle at 20% 72%, #00d4a6 0%, transparent 38%), radial-gradient(circle at 82% 24%, #6c63ff 0%, transparent 36%), radial-gradient(circle at 46% 42%, #0088ff 0%, transparent 42%), #07182b',
|
css: 'radial-gradient(circle at 20% 72%, #00d4a6 0%, transparent 38%), radial-gradient(circle at 82% 24%, #6c63ff 0%, transparent 36%), radial-gradient(circle at 46% 42%, #0088ff 0%, transparent 42%), linear-gradient(145deg, #07182b, #071126)',
|
||||||
preview: 'linear-gradient(135deg, #00c9a7, #0088ff 54%, #6c63ff)',
|
preview: 'linear-gradient(135deg, #00c9a7, #0088ff 54%, #6c63ff)',
|
||||||
clockColor: '#efffff',
|
clockColor: '#efffff',
|
||||||
foregroundColor: '#efffff',
|
foregroundColor: '#efffff',
|
||||||
|
|||||||
Reference in New Issue
Block a user