myroom-react
Version:
React component wrapper for MyRoom 3D scene
228 lines (201 loc) • 4.47 kB
CSS
/* MyRoomScene Component Styles */
.myroom-scene {
position: relative;
display: block;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
overflow: hidden;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}
.myroom-scene canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
touch-action: none;
border-radius: 8px;
}
/* Loading State */
.myroom-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
color: white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 16px;
z-index: 1000;
text-align: center;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 3px solid rgba(255, 255, 255, 0.3);
border-top: 3px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.myroom-loading p {
margin: 0;
font-weight: 500;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
/* Error State */
.myroom-error {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
color: #ff6b6b;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 14px;
text-align: center;
z-index: 1000;
background: rgba(0, 0, 0, 0.9);
padding: 24px;
border-radius: 12px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 107, 107, 0.3);
max-width: 300px;
}
.error-icon {
font-size: 24px;
margin-bottom: 8px;
}
.myroom-error p {
margin: 0;
line-height: 1.4;
font-weight: 500;
}
/* Controls Overlay */
.myroom-controls {
position: absolute;
top: 16px;
right: 16px;
z-index: 1000;
display: flex;
gap: 8px;
flex-direction: column;
}
.control-btn {
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 8px;
padding: 12px;
cursor: pointer;
font-size: 16px;
transition: all 0.2s ease;
backdrop-filter: blur(10px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
min-width: 44px;
min-height: 44px;
display: flex;
align-items: center;
justify-content: center;
}
.control-btn:hover {
background: rgba(255, 255, 255, 1);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.control-btn:active {
transform: translateY(0);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Placeholder for IntegratedBabylonScene */
.integrated-babylon-scene-placeholder {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.8);
color: white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
text-align: center;
padding: 20px;
z-index: 500;
}
.integrated-babylon-scene-placeholder p {
margin: 8px 0;
font-size: 14px;
opacity: 0.8;
}
/* Responsive Design */
@media (max-width: 768px) {
.myroom-controls {
top: 12px;
right: 12px;
}
.control-btn {
padding: 10px;
font-size: 14px;
min-width: 40px;
min-height: 40px;
}
.myroom-loading {
font-size: 14px;
}
.loading-spinner {
width: 32px;
height: 32px;
}
}
@media (max-width: 480px) {
.myroom-controls {
top: 8px;
right: 8px;
}
.control-btn {
padding: 8px;
font-size: 12px;
min-width: 36px;
min-height: 36px;
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.myroom-scene {
background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
}
.control-btn {
background: rgba(255, 255, 255, 0.1);
color: white;
}
.control-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
}
/* High contrast mode support */
@media (prefers-contrast: high) {
.myroom-scene {
border: 2px solid #000;
}
.control-btn {
border: 2px solid #000;
background: white;
color: black;
}
.myroom-loading,
.myroom-error {
background: white;
color: black;
border: 2px solid #000;
}
}