Skip to content

fix(mockup-phone): make layout responsive with aspect-ratio - #4108

Merged
saadeghi merged 3 commits into
saadeghi:masterfrom
Yeom-JinHo:fix/iphone-mockup-mobile
Sep 17, 2025
Merged

saadeghi merged 3 commits into
saadeghi:masterfrom
Yeom-JinHo:fix/iphone-mockup-mobile

Conversation

@Yeom-JinHo

Copy link
Copy Markdown
Contributor

Description

This PR refactors the mockup-phone component to be responsive and consistent across viewports and browsers.
It removes hard-coded pixel dimensions and invalid grid definitions, replacing them with scalable, ratio-based sizing while preserving the original phone silhouette, notch, and display styling.
fixed #1063

Changes

Wrapper (.mockup-phone)

  • Added aspect-ratio: 390 / 845 for natural scaling without fixed width/height.
  • Children unified via grid-area: 1 / 1 for reliable overlay stacking.

Camera notch (.mockup-phone-camera)

  • Converted fixed px sizing (126脳32px) to proportional values (32.3% 脳 3.8%).
  • Simplified with border-radius: 9999px to always render a pill shape.

Display (.mockup-phone-display)

  • Removed fixed 390脳845px; now width: 100%; height: 100% with responsive scaling.
  • Retains rounded corners (border-radius: 49px) for visual integrity.

Image handling

  • Ensures child fills container with object-fit: cover.

Motivation

  • Responsive integrity: Prevent layout breakage on small viewports (<390px).
  • Cross-browser correctness: Fixes invalid grid-column: 1/1 definitions that caused inconsistent rendering in Safari vs Chrome.
  • Design fidelity: Maintains the intended rounded display and notch regardless of scaling.
  • Minimal risk: Pure CSS update; no markup or API changes required.

Screenshots

iphone SE

ASIS TOBE
釀夅叧釀忈叧釀呩叺釂剦釁a喓 2025-09-10 釀嬦叐釀掅叜 6 59 58 釀夅叧釀忈叧釀呩叺釂剦釁a喓 2025-09-10 釀嬦叐釀掅叜 7 00 13

@Yeom-JinHo

Yeom-JinHo commented Sep 10, 2025 •

Copy link
Copy Markdown
Contributor Author

TOBE

image 釀夅叧釀忈叧釀呩叺釂剦釁a喓 2025-09-10 釀嬦叐釀掅叜 7 04 21

@saadeghi
saadeghi merged commit 863597a into saadeghi:master Sep 17, 2025
1 check failed
@saadeghi

Copy link
Copy Markdown
Owner

Thanks for the PR. I added some modifications. and updated the design based on the latest iPhone.

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.

iPhone mockup text not properly centered on mobile

2 participants