myroom-react
Version:
React component wrapper for MyRoom 3D scene
427 lines (363 loc) • 7.02 kB
CSS
/* MyRoom Demo Component Styles */
.myroom-demo {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.demo-header {
text-align: center;
color: white;
margin-bottom: 30px;
}
.demo-header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.demo-header p {
font-size: 1.1rem;
opacity: 0.9;
}
.demo-content {
display: grid;
grid-template-columns: 350px 1fr;
gap: 20px;
margin-bottom: 20px;
}
/* Controls Panel */
.controls-panel {
background: white;
border-radius: 12px;
padding: 24px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
height: fit-content;
max-height: 800px;
overflow-y: auto;
}
.control-section {
margin-bottom: 24px;
}
.control-section:last-child {
margin-bottom: 0;
}
.control-section h3 {
color: #333;
margin-bottom: 12px;
font-size: 1.1rem;
font-weight: 600;
}
.control-section h4 {
color: #555;
margin-bottom: 8px;
font-size: 0.9rem;
font-weight: 500;
}
/* Room Buttons */
.room-buttons {
display: flex;
flex-direction: column;
gap: 8px;
}
.room-btn {
background: #f8f9fa;
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 12px 16px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
text-align: left;
}
.room-btn:hover {
background: #e9ecef;
border-color: #dee2e6;
}
.room-btn.active {
background: #007bff;
border-color: #007bff;
color: white;
}
/* Gender Buttons */
.gender-buttons {
display: flex;
gap: 8px;
}
.gender-btn {
flex: 1;
background: #f8f9fa;
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 12px 16px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
}
.gender-btn:hover {
background: #e9ecef;
border-color: #dee2e6;
}
.gender-btn.active {
background: #28a745;
border-color: #28a745;
color: white;
}
/* Item Controls */
.item-controls {
display: flex;
gap: 8px;
margin-bottom: 16px;
}
.item-controls select {
flex: 1;
padding: 8px 12px;
border: 2px solid #e9ecef;
border-radius: 6px;
font-size: 14px;
background: white;
}
.add-item-btn {
background: #28a745;
border: none;
border-radius: 6px;
padding: 8px 16px;
color: white;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background 0.2s ease;
}
.add-item-btn:hover {
background: #218838;
}
/* Item List */
.item-list {
background: #f8f9fa;
border-radius: 8px;
padding: 16px;
}
.item-entry {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid #e9ecef;
}
.item-entry:last-child {
border-bottom: none;
}
.item-entry span {
font-size: 14px;
color: #333;
}
.remove-item-btn {
background: #dc3545;
border: none;
border-radius: 4px;
color: white;
cursor: pointer;
font-size: 16px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s ease;
}
.remove-item-btn:hover {
background: #c82333;
}
.clear-all-btn {
background: #6c757d;
border: none;
border-radius: 6px;
padding: 8px 16px;
color: white;
cursor: pointer;
font-size: 14px;
font-weight: 500;
margin-top: 12px;
width: 100%;
transition: background 0.2s ease;
}
.clear-all-btn:hover {
background: #5a6268;
}
/* Gizmo Buttons */
.gizmo-buttons {
display: flex;
gap: 8px;
}
.gizmo-btn {
flex: 1;
background: #f8f9fa;
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 10px 12px;
cursor: pointer;
font-size: 12px;
font-weight: 500;
transition: all 0.2s ease;
}
.gizmo-btn:hover {
background: #e9ecef;
border-color: #dee2e6;
}
.gizmo-btn.active {
background: #ffc107;
border-color: #ffc107;
color: #212529;
}
/* Action Buttons */
.action-buttons {
display: flex;
flex-direction: column;
gap: 8px;
}
.action-btn {
background: #007bff;
border: none;
border-radius: 8px;
padding: 12px 16px;
color: white;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background 0.2s ease;
}
.action-btn:hover {
background: #0056b3;
}
/* Status Display */
.status-display {
background: #e7f3ff;
border: 1px solid #b3d9ff;
border-radius: 8px;
padding: 12px;
}
.status-display p {
margin: 0;
font-size: 14px;
color: #0056b3;
font-weight: 500;
}
/* Scene Container */
.scene-container {
background: white;
border-radius: 12px;
padding: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
}
.demo-scene {
border-radius: 8px;
overflow: hidden;
}
/* Demo Footer */
.demo-footer {
background: white;
border-radius: 12px;
padding: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
text-align: center;
}
.demo-footer p {
margin: 0;
color: #666;
font-size: 14px;
}
/* Responsive Design */
@media (max-width: 1200px) {
.demo-content {
grid-template-columns: 300px 1fr;
}
}
@media (max-width: 768px) {
.demo-content {
grid-template-columns: 1fr;
gap: 16px;
}
.controls-panel {
order: 2;
max-height: none;
}
.scene-container {
order: 1;
}
.demo-header h1 {
font-size: 2rem;
}
.gender-buttons,
.gizmo-buttons {
flex-direction: column;
}
.item-controls {
flex-direction: column;
}
}
@media (max-width: 480px) {
.myroom-demo {
padding: 16px;
}
.controls-panel {
padding: 16px;
}
.scene-container {
padding: 16px;
}
.demo-header h1 {
font-size: 1.5rem;
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.controls-panel,
.scene-container,
.demo-footer {
background: #2d3748;
color: white;
}
.control-section h3,
.control-section h4 {
color: #e2e8f0;
}
.room-btn,
.gender-btn,
.gizmo-btn {
background: #4a5568;
border-color: #718096;
color: #e2e8f0;
}
.room-btn:hover,
.gender-btn:hover,
.gizmo-btn:hover {
background: #718096;
}
.item-list {
background: #4a5568;
}
.item-entry {
border-bottom-color: #718096;
}
.item-entry span {
color: #e2e8f0;
}
.item-controls select {
background: #4a5568;
border-color: #718096;
color: #e2e8f0;
}
.status-display {
background: #2c5282;
border-color: #4299e1;
}
.status-display p {
color: #bee3f8;
}
}