Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions chessClient/README_MOBILE_RESPONSIVE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Mobile Responsive Chess Client

## Overview
The static chess client webpages have been enhanced with comprehensive mobile responsive design to provide an optimal user experience across all device sizes.

## Files Modified

### 1. `index.html` - Main Chess Board
- Added proper HTML5 doctype and meta viewport tag
- Implemented responsive CSS with mobile-first approach
- Chessboard now scales appropriately on mobile devices (95vw on tablets, 98vw on phones)
- Enhanced cursor element for better mobile interaction
- Added centering and proper spacing for mobile layouts

### 2. `parent.html` - Parent Window with Controls
- Complete mobile responsive redesign
- Bootstrap grid system optimized for mobile stacking
- Form controls enhanced with better touch targets
- Responsive chessboard iframe sizing
- Improved button layout for mobile interaction
- Added iOS-specific fixes (font-size 16px to prevent zoom)
- Landscape orientation support

### 3. `both.html` - Dual View Layout
- Responsive dual-pane layout
- Mobile: Stacks vertically (50vh each pane)
- Tablet: Maintains side-by-side layout
- Landscape mobile: Reverts to horizontal layout
- Enhanced visual styling with gradients and shadows
- Proper iframe scaling and minimum heights

### 4. `css/chessboard-1.0.0.css` - Chessboard Styling
- Added mobile-specific breakpoints
- Responsive board sizing using viewport units
- Optimized touch targets for mobile interaction
- Landscape orientation handling
- Improved notation font sizes for smaller screens

### 5. `html/index.html` - HTML Subdirectory Version
- Added HTML5 doctype and responsive meta tags
- Mobile-first CSS approach
- Proper viewport scaling for chessboard

## Responsive Breakpoints

### Desktop (Default)
- Full-size chessboard and controls
- Standard Bootstrap grid layout

### Tablet (≤768px)
- Chessboard scales to 95vw
- Form elements stack appropriately
- Buttons maintain full width for better touch interaction

### Mobile (≤480px)
- Chessboard scales to 98vw with maximum 350px
- Optimized padding and margins
- Smaller font sizes for better fit
- Enhanced touch targets

### Landscape Mobile
- Special handling for landscape orientation
- Maintains usability in both orientations

## Features Added

1. **Touch-Friendly Design**
- Larger touch targets for mobile interaction
- Proper touch-action CSS properties
- iOS-specific optimizations

2. **Flexible Layouts**
- Viewport-based sizing (vw/vh units)
- Flexbox layouts for better responsive behavior
- Bootstrap grid enhancements

3. **Cross-Device Compatibility**
- Works on phones, tablets, and desktops
- Handles both portrait and landscape orientations
- Maintains functionality across all screen sizes

4. **Visual Enhancements**
- Modern gradient backgrounds
- Subtle shadows and rounded corners
- Improved typography scaling

## Testing

To test the responsive design:

1. Start the HTTP server: `python3 -m http.server 8080`
2. Visit the following URLs:
- `http://localhost:8080/index.html` - Main chessboard
- `http://localhost:8080/parent.html` - Parent window with controls
- `http://localhost:8080/both.html` - Dual view layout
- `http://localhost:8080/html/index.html` - HTML subdirectory version

3. Test on various screen sizes using browser developer tools
4. Test on actual mobile devices for touch interaction

## Browser Support

- Chrome/Safari/Firefox on desktop
- Mobile Safari (iOS)
- Chrome Mobile (Android)
- Responsive design works across all modern browsers

## Next Steps

The static webpages are now fully mobile responsive. Consider:
1. Testing on actual mobile devices
2. Performance optimization for slower mobile connections
3. Adding PWA features for mobile app-like experience
4. Implementing touch gestures for enhanced mobile interaction
89 changes: 87 additions & 2 deletions chessClient/both.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,109 @@
height: 100%;
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
}

.container-fluid {
height: 100%;
padding: 0;
}

.row {
height: 100%;
margin: 0;
}

.col-md-6 {
height: 100%;
padding: 5px;
display: flex;
flex-direction: column;
}

h3 {
/* No background property defined */
}

iframe {
width: 100%;
height: 100%;
border: 1px solid #ccc;
flex-grow: 1;
border: 2px solid #ddd;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
min-height: 400px;
}

/* Mobile responsive styles */
@media screen and (max-width: 768px) {
.container-fluid {
height: 100vh;
overflow-y: auto;
}

.row {
flex-direction: column;
height: auto;
min-height: 100vh;
margin: 0;
}

.col-md-6 {
height: 50vh;
min-height: 400px;
padding: 2px;
overflow: visible;
display: flex;
flex-direction: column;
}

h3 {
font-size: 1rem;
margin: 0;
padding: 8px;
flex-shrink: 0;
}

iframe {
height: calc(50vh - 40px);
min-height: 350px;
border-width: 1px;
flex-grow: 1;
}
}

@media screen and (max-width: 480px) {
.col-md-6 {
height: 50vh;
padding: 0;
}

h3 {
font-size: 0.9rem;
margin: 0;
padding: 6px;
}

iframe {
height: calc(50vh - 30px);
}
}

/* Landscape orientation on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
.row {
flex-direction: row;
height: 100vh;
}

.col-md-6 {
height: 100vh;
width: 50%;
}

iframe {
min-height: 200px;
}
}
</style>
</head>
Expand Down
17 changes: 17 additions & 0 deletions chessClient/css/chessboard-1.0.0.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@
.hightlight-red {
color: red;
}

/* Mobile responsive enhancements */
@media screen and (max-width: 768px) {
.board-b72b1 {
border-width: 1px;
}

.notation-322f9 {
font-size: 14px;
}
}

@media screen and (max-width: 480px) {
.notation-322f9 {
font-size: 12px;
}
}
Loading