Skip to content

Dedupe repeated CSS declarations and form-message JS in index.html - #8

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787085056-dedupe-shared-styles
Open

Dedupe repeated CSS declarations and form-message JS in index.html#8
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787085056-dedupe-shared-styles

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

index.html is the only source file in the repo; its <style> block repeated the same declaration groups across unrelated selectors, and the submit handler toggled the two status paragraphs by hand. Consolidated the repeats into grouped rules plus tokens, and the JS toggling into one helper.

Shared rules added (each selector keeps its own radius/padding/colors):

.eyebrow, .stat, .work-item      { background: var(--surface); border: 1px solid var(--border); }
.hero-card, .contact, .contact-card { border: 1px solid var(--border); border-radius: var(--radius-lg); }
.nav-inner, .section-head, .work-item { display: flex; justify-content: space-between; }
.avatar, .avatar-inner           { display: grid; place-items: center; }

New tokens replace repeated literals: --surface (rgba(255,255,255,0.05)), --radius-lg (28px), --radius-pill (999px), --ease (0.2s ease, used by both the .btn and .field input/textarea transitions).

JS: successMsg/errorMsg were each toggled in three places; now

showFormMessage(msgOrNull)  // hides both, un-hides the one passed

with the non-ok response funnelled into the existing catch via throw, so there is a single error path.

Verified with headless-Chrome screenshots before/after: the only pixel difference is the contact card's hairline border, whose alpha is normalized from 0.12 to the shared --border (0.1) — intentional, and visually indistinguishable.

Not touched: zipper-unzipper.zip contains a vendored third-party zipper-unzipper.php with its own duplication (the $GLOBALS['status'] = array(...) assignment appears 10x, and the readable/writable guard pairs are near-identical between the zip and rar extractors). Refactoring it would mean rewriting a GPL upstream file that only exists as a binary zip in the repo, so I left it alone — happy to unpack it into a real source file and clean it up if you want.

Link to Devin session: https://app.devin.ai/sessions/23935b53eab346a1ad66bbb9e806a836
Requested by: @liikane

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@liikane liikane self-assigned this Aug 18, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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