Files
remoteturtle/client/src/components/ControlPanel.css

712 lines
12 KiB
CSS

.control-panel {
height: 100%;
display: flex;
flex-direction: column;
background: #111827;
color: #e5e7eb;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.5rem;
background: #1f2937;
border-bottom: 1px solid #374151;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.panel-header h1 {
font-size: 1.25rem;
font-weight: 600;
color: #f9fafb;
letter-spacing: -0.025em;
}
.connection-status {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-weight: 600;
font-size: 0.875rem;
}
.connection-status.connected {
background: #064e3b;
color: #6ee7b7;
}
.connection-status.disconnected {
background: #7f1d1d;
color: #fca5a5;
}
.status-dot {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
animation: pulse 2s infinite;
}
.connected .status-dot {
background: #10b981;
}
.disconnected .status-dot {
background: #ef4444;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.panel-content {
display: flex;
flex: 1;
overflow: hidden;
flex-direction: column;
}
.turtle-list {
width: 100%;
border-bottom: 1px solid #374151;
display: flex;
flex-direction: row;
background: #1f2937;
overflow-x: auto;
padding: 0.75rem;
gap: 0.75rem;
flex-shrink: 0;
}
.turtle-list h2 {
display: none;
}
.turtle-cards {
display: flex;
flex-direction: row;
gap: 0.75rem;
overflow-x: auto;
}
.turtle-cards::-webkit-scrollbar {
height: 6px;
}
.turtle-cards::-webkit-scrollbar-track {
background: #1f2937;
border-radius: 3px;
}
.turtle-cards::-webkit-scrollbar-thumb {
background: #4b5563;
border-radius: 3px;
}
.turtle-cards::-webkit-scrollbar-thumb:hover {
background: #6b7280;
}
.empty-state {
padding: 3rem 2rem;
text-align: center;
color: #6b7280;
}
.empty-state::before {
content: '🔍';
display: block;
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.5;
}
.empty-state .hint {
margin-top: 1rem;
font-size: 0.875rem;
color: #4b5563;
font-style: italic;
}
.turtle-card {
background: #1f2937;
border: 2px solid #374151;
border-radius: 0.5rem;
padding: 0.875rem;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
min-width: 200px;
flex-shrink: 0;
}
.turtle-card::before {
display: none;
}
.turtle-card:hover {
border-color: #60a5fa;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.turtle-card:hover::before {
display: none;
}
.turtle-card.selected {
border-color: #60a5fa;
background: #1e3a5f;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.turtle-card.selected::before {
display: none;
}
.turtle-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.625rem;
padding-bottom: 0.625rem;
border-bottom: 1px solid #374151;
}
.turtle-header h3 {
font-size: 0.875rem;
font-weight: 700;
color: #f9fafb;
display: flex;
align-items: center;
gap: 0.375rem;
}
.turtle-header h3::before {
content: '🐢';
font-size: 1rem;
}
.mode-badge {
padding: 0.25rem 0.75rem;
border-radius: 1rem;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
color: white;
}
.turtle-stats {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.turtle-stats .stat {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.75rem;
padding: 0.375rem;
background: #111827;
border-radius: 0.25rem;
border: 1px solid #374151;
}
.turtle-stats .label {
color: #9ca3af;
font-weight: 500;
display: flex;
align-items: center;
gap: 0.25rem;
}
.turtle-stats .value {
color: #f9fafb;
font-weight: 600;
font-family: 'Courier New', monospace;
font-size: 0.75rem;
}
.turtle-details {
flex: 1;
padding: 1.5rem;
overflow-y: auto;
background: #111827;
}
.turtle-details::-webkit-scrollbar {
width: 8px;
}
.turtle-details::-webkit-scrollbar-track {
background: #1f2937;
border-radius: 4px;
}
.turtle-details::-webkit-scrollbar-thumb {
background: #4b5563;
border-radius: 4px;
}
.turtle-details::-webkit-scrollbar-thumb:hover {
background: #6b7280;
}
.turtle-details.empty {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
color: #9ca3af;
font-size: 1rem;
gap: 0.75rem;
}
.turtle-details.empty::before {
content: '☝️';
font-size: 3rem;
opacity: 0.5;
animation: bounce-up 2s infinite;
}
@keyframes bounce-up {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
@keyframes bounce {
0%, 100% {
transform: translateX(0);
}
50% {
transform: translateX(-10px);
}
}
.turtle-details h2 {
font-size: 1.25rem;
margin-bottom: 1.5rem;
color: #f9fafb;
font-weight: 700;
display: flex;
align-items: center;
gap: 0.5rem;
padding-bottom: 0.75rem;
border-bottom: 2px solid #374151;
}
.turtle-details h2::before {
content: '🐢';
font-size: 1.25rem;
}
.detail-section {
margin-bottom: 1.25rem;
padding: 1rem;
background: #1f2937;
border-radius: 0.5rem;
border: 1px solid #374151;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
transition: all 0.2s ease;
}
.detail-section:hover {
border-color: #4b5563;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.detail-section h3 {
font-size: 1rem;
margin-bottom: 1rem;
color: #60a5fa;
font-weight: 700;
display: flex;
align-items: center;
gap: 0.5rem;
}
.detail-section h4 {
font-size: 0.875rem;
margin: 1rem 0 0.75rem;
color: #d1d5db;
font-weight: 600;
}
.status-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0.75rem;
}
.status-item {
display: flex;
flex-direction: column;
gap: 0.375rem;
padding: 0.75rem;
background: #111827;
border-radius: 0.375rem;
border: 1px solid #374151;
transition: all 0.2s ease;
}
.status-item:hover {
background: #1f2937;
border-color: #60a5fa;
}
.status-item .label {
color: #9ca3af;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.status-item .value {
color: #f9fafb;
font-weight: 700;
font-family: 'Courier New', monospace;
font-size: 0.95rem;
}
.command-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0.5rem;
margin-bottom: 1rem;
}
.command-btn {
padding: 0.75rem;
border: none;
border-radius: 0.5rem;
font-size: 0.8125rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
color: white;
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
white-space: nowrap;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.command-btn:hover {
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.command-btn:active {
transform: translateY(0);
}
.command-btn.explore {
background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.command-btn.mine {
background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
.command-btn.return {
background: linear-gradient(135deg, #f59e0b, #d97706);
}
.command-btn.stop {
background: linear-gradient(135deg, #ef4444, #dc2626);
}
.command-btn.manual {
background: linear-gradient(135deg, #a855f7, #9333ea);
}
.command-btn.setHome {
background: linear-gradient(135deg, #06b6d4, #0891b2);
}
.command-btn.refuel {
background: linear-gradient(135deg, #10b981, #059669);
}
.command-btn.status {
background: linear-gradient(135deg, #64748b, #475569);
}
/* Movement Controls */
.movement-controls {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
padding: 1rem;
background: #1f2937;
border-radius: 0.5rem;
border: 1px solid #374151;
}
.movement-row {
display: flex;
gap: 0.5rem;
justify-content: center;
}
.movement-row.vertical {
gap: 0.75rem;
}
.movement-controls button {
width: 3rem;
height: 3rem;
border: 2px solid #374151;
background: #111827;
color: #60a5fa;
border-radius: 0.5rem;
font-size: 1.25rem;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.movement-controls button:hover {
background: #1f2937;
border-color: #60a5fa;
box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
transform: scale(1.05);
}
.movement-controls button:active {
transform: scale(0.95);
}
/* Action Grid */
.action-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0.5rem;
}
.action-btn {
padding: 0.75rem;
border: 2px solid #374151;
background: #1f2937;
color: #60a5fa;
border-radius: 0.5rem;
font-size: 0.8125rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
white-space: nowrap;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.action-btn:hover {
border-color: #60a5fa;
background: #111827;
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(96, 165, 250, 0.2);
}
.action-btn.dig {
border-color: #f59e0b;
color: #f59e0b;
}
.action-btn.dig:hover {
background: rgba(245, 158, 11, 0.1);
border-color: #f59e0b;
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.action-btn.digup,
.action-btn.digdown {
border-color: #f59e0b;
color: #f59e0b;
}
.action-btn.digup:hover,
.action-btn.digdown:hover {
background: rgba(245, 158, 11, 0.1);
border-color: #f59e0b;
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.action-btn.place {
border-color: #10b981;
color: #10b981;
}
.action-btn.place:hover {
background: rgba(16, 185, 129, 0.1);
border-color: #10b981;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
/* Inventory Grid */
.inventory-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 0.5rem;
max-height: 400px;
overflow-y: auto;
padding: 0.5rem;
background: #0f172a;
border-radius: 0.5rem;
border: 1px solid #1e293b;
}
.inventory-slot {
aspect-ratio: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #1e293b;
border: 2px solid #334155;
border-radius: 0.375rem;
padding: 0.5rem;
transition: all 0.2s;
cursor: pointer;
position: relative;
overflow: hidden;
}
.inventory-slot.empty {
background: #0f172a;
border-style: dashed;
border-color: #1e293b;
}
.inventory-slot.filled {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #3b82f6;
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.inventory-slot.filled:hover {
border-color: #60a5fa;
background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
transform: translateY(-2px);
}
.slot-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
}
.slot-item .item-icon {
font-size: 1.5rem;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.slot-item .item-count {
position: absolute;
bottom: 0.25rem;
right: 0.25rem;
background: rgba(0, 0, 0, 0.8);
color: #fff;
font-size: 0.625rem;
font-weight: 700;
padding: 0.125rem 0.375rem;
border-radius: 0.25rem;
font-family: 'Courier New', monospace;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.slot-name {
position: absolute;
top: 0.25rem;
left: 0.25rem;
right: 0.25rem;
font-size: 0.5rem;
color: #94a3b8;
font-weight: 600;
text-transform: uppercase;
text-align: center;
line-height: 1.1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.slot-number {
font-size: 0.75rem;
color: #475569;
font-weight: 600;
}
/* Responsive Design */
@media (max-width: 1024px) {
.command-grid {
grid-template-columns: 1fr;
}
.action-grid {
grid-template-columns: 1fr;
}
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
}
}
@media (max-width: 768px) {
.turtle-grid {
grid-template-columns: 1fr;
}
.panel-content {
flex-direction: column;
}
.turtle-list {
border-bottom: 1px solid #374151;
border-right: none;
}
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
}
}
@media (max-width: 480px) {
.inventory-grid {
grid-template-columns: repeat(4, 1fr);
gap: 0.375rem;
}
.inventory-slot {
padding: 0.375rem;
}
.slot-item .item-icon {
font-size: 1.25rem;
}
}