Files
p2p-chat/web/style.css

220 lines
4.1 KiB
CSS

:root {
--bg-color: #121212;
--card-bg: #1e1e1e;
--primary-color: #3b82f6;
--danger-color: #ef4444;
--text-color: #e0e0e0;
--control-bg: rgba(30, 30, 30, 0.9);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 0;
overflow: hidden; /* Prevent scrollbar */
height: 100vh;
width: 100vw;
}
#app-container {
position: relative;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
/* Main Video Grid */
#video-grid {
flex: 1;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 16px;
padding: 16px;
align-content: center;
justify-content: center;
}
/* Status Overlay */
.status-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}
.status-content {
text-align: center;
}
.spinner {
border: 4px solid rgba(255, 255, 255, 0.1);
border-left-color: var(--primary-color);
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Peer Card */
.peer-card {
background-color: var(--card-bg);
border-radius: 12px;
overflow: hidden;
position: relative;
aspect-ratio: 16 / 9;
box-shadow: 0 4px 10px rgba(0,0,0,0.5);
display: flex;
justify-content: center;
align-items: center;
}
.peer-card img, .peer-card video, .peer-card canvas {
width: 100%;
height: 100%;
object-fit: contain; /* or cover if preferred */
background: black;
}
.peer-info {
position: absolute;
bottom: 10px;
left: 10px;
background: rgba(0, 0, 0, 0.6);
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8em;
font-weight: bold;
display: flex;
align-items: center;
gap: 6px;
}
.peer-status {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #aaa;
}
.peer-status.speaking {
background-color: #4ade80;
box-shadow: 0 0 8px #4ade80;
}
/* Local Preview (PIP) */
#local-preview {
position: absolute;
bottom: 80px;
right: 20px;
width: 240px;
aspect-ratio: 16 / 9;
background: black;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.6);
overflow: hidden;
border: 2px solid #333;
z-index: 50;
transition: width 0.3s;
}
#local-preview video {
width: 100%;
height: 100%;
object-fit: cover;
transform: scaleX(-1); /* Mirror local video */
}
.local-label {
position: absolute;
bottom: 6px;
left: 8px;
font-size: 0.7em;
background: rgba(0,0,0,0.5);
padding: 2px 6px;
border-radius: 4px;
}
/* Control Bar */
#control-bar {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background: var(--control-bg);
padding: 10px 20px;
border-radius: 50px;
display: flex;
gap: 16px;
align-items: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
z-index: 60;
backdrop-filter: blur(10px);
}
.control-btn {
width: 48px;
height: 48px;
border-radius: 50%;
border: none;
background-color: #333;
color: white;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: all 0.2s;
}
.control-btn:hover {
background-color: #444;
transform: scale(1.05);
}
.control-btn.active {
background-color: var(--primary-color);
}
.control-btn.danger {
background-color: var(--danger-color);
}
.material-icons {
font-size: 24px;
}
#toggle-mic.active .material-icons {
/* mic icon when active */
}
/* Simple logic for toggling icons handled in JS or via classes */
.separator {
width: 1px;
height: 24px;
background: #555;
margin: 0 4px;
}
.status-indicator {
color: #f87171; /* Disconnected red */
}
.status-indicator.connected {
color: #4ade80; /* Connected green */
}