A web application demonstrating two different approaches to distributing items across two horizontal rows:
- UI-driven: Uses actual pixel width measurements to balance items across rows
- BE-driven: Uses character count to balance items (simulating backend logic)
- Live input editing with localStorage persistence
- Phone screen overlay showing mobile viewport
- Real-time width/character sum statistics
- Responsive pill-based layout
Follow these steps to deploy this project to GitHub Pages:
Open your terminal, navigate to this directory, and run:
cd ~/masonry-pills
git init
git add .
git commit -m "Initial commit: Masonry pills layout"- Go to https://github.com/new
- Repository name:
masonry-pills(or your preferred name) - Leave it public
- Do NOT initialize with README, .gitignore, or license
- Click "Create repository"
Replace YOUR_USERNAME with your GitHub username:
git remote add origin https://github.com/YOUR_USERNAME/masonry-pills.git
git branch -M main
git push -u origin main- Go to your repository on GitHub
- Click "Settings" tab
- Click "Pages" in the left sidebar
- Under "Source", select "Deploy from a branch"
- Under "Branch", select
mainand/ (root) - Click "Save"
After a few minutes, your site will be available at:
https://YOUR_USERNAME.github.io/masonry-pills/
Simply open index.html in your browser:
open index.htmlindex.html- Main HTML structurestyles.css- All styling including phone frame overlayscript.js- JavaScript logic for both layout algorithms