Compact PiP timer with responsive scaling#69
Merged
Conversation
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>
There was a problem hiding this comment.
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 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> | ||
| `); |
There was a problem hiding this comment.
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>
`);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
min(vw, vh)) so text scales proportionally with window resizespace-evenlyTest plan
🤖 Generated with Claude Code