Skip to content

Compact PiP timer with responsive scaling#69

Merged
fatherlinux merged 1 commit into
mainfrom
feature/compact-pip-timer
Mar 28, 2026
Merged

Compact PiP timer with responsive scaling#69
fatherlinux merged 1 commit into
mainfrom
feature/compact-pip-timer

Conversation

@fatherlinux
Copy link
Copy Markdown
Member

Summary

  • Shrinks PiP window default size from 300×160 to 192×42 (browser minimum)
  • Switches layout from vertical stack to horizontal (timer + status side-by-side)
  • Uses viewport-relative font sizing (min(vw, vh)) so text scales proportionally with window resize
  • Equal spacing around elements via space-evenly

Test plan

  • Open PiP timer at minimum size — text fills the strip
  • Stretch PiP window larger — text scales proportionally without overflowing
  • Verify timer updates and break/focus color changes still work in PiP

🤖 Generated with Claude Code

Opens at browser minimum (192×42) instead of 300×160, uses horizontal
layout with viewport-relative font sizing that scales proportionally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fatherlinux fatherlinux merged commit 855dec4 into main Mar 28, 2026
3 checks passed
@fatherlinux fatherlinux deleted the feature/compact-pip-timer branch March 28, 2026 00:44
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Picture-in-Picture (PiP) window settings, reducing its default dimensions and changing the layout from a vertical column to a horizontal row. It also introduces responsive font sizing for the timer and status text. A review comment suggests refactoring the inline CSS into a <style> block to improve code readability and maintainability.

Comment thread templates/index.html
Comment on lines 2407 to 2415
pipWindow.document.write(`
<html>
<head><title>Acquacotta Timer</title></head>
<body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;background:#1a1a2e;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;flex-direction:column;">
<div id="pip-time" style="font-size:4rem;font-weight:700;font-variant-numeric:tabular-nums;color:${textColor};">${timeText}</div>
<div id="pip-status" style="color:#a0a0a0;text-transform:uppercase;letter-spacing:0.1em;font-size:0.875rem;">${statusText}</div>
<head><title>Acquacotta</title></head>
<body style="margin:0;display:flex;align-items:center;justify-content:space-evenly;height:100vh;background:#1a1a2e;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;flex-direction:row;overflow:hidden;">
<div id="pip-time" style="font-size:min(22vw, 85vh);font-weight:700;font-variant-numeric:tabular-nums;color:${textColor};line-height:1;">${timeText}</div>
<div id="pip-status" style="color:#a0a0a0;text-transform:uppercase;letter-spacing:0.05em;font-size:min(8vw, 40vh);">${statusText}</div>
</body>
</html>
`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and maintainability, it's a good practice to separate CSS from HTML structure. You can move the inline styles into a <style> block in the <head> of the PiP window's document. This makes the code cleaner and easier to manage.

                pipWindow.document.write(`
                    <html>
                    <head>
                        <title>Acquacotta</title>
                        <style>
                            body {
                                margin: 0;
                                display: flex;
                                align-items: center;
                                justify-content: space-evenly;
                                height: 100vh;
                                background: #1a1a2e;
                                font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
                                flex-direction: row;
                                overflow: hidden;
                            }
                            #pip-time {
                                font-size: min(22vw, 85vh);
                                font-weight: 700;
                                font-variant-numeric: tabular-nums;
                                color: ${textColor};
                                line-height: 1;
                            }
                            #pip-status {
                                color: #a0a0a0;
                                text-transform: uppercase;
                                letter-spacing: 0.05em;
                                font-size: min(8vw, 40vh);
                            }
                        </style>
                    </head>
                    <body>
                        <div id="pip-time">${timeText}</div>
                        <div id="pip-status">${statusText}</div>
                    </body>
                    </html>
                `);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant