Spaces:
Running
Running
/* coder.css */ | |
/* Define CSS Variables at the Root */ | |
:root { | |
/* Colors */ | |
--primary-color: #00796B; | |
--primary-gradient: linear-gradient(135deg, #00796B, #004D40); | |
--primary-hover-gradient: linear-gradient(135deg, #005D56, #00332E); | |
--secondary-color: #E53935; | |
--secondary-gradient: linear-gradient(135deg, #FF5252, #E53935); | |
--secondary-hover-gradient: linear-gradient(135deg, #E53935, #D32F2F); | |
--disabled-gradient: linear-gradient(135deg, #A5D6A7, #81C784); | |
--background-color: #ffffff; | |
--hover-background-color: #f9f9f9; | |
--text-color: #333333; | |
--border-color: #cccccc; | |
/* Existing Spacing Variables */ | |
--padding: 20px; | |
--padding-small: 15px; | |
--gap: 15px; | |
--gap-large: 25px; | |
/* New Reduced Spacing Variables */ | |
--padding-compact: 10px; | |
--gap-compact: 10px; | |
/* Font Sizes */ | |
--font-size-base: 1em; | |
--font-size-small: 0.85em; | |
--font-size-large: 1.2em; | |
/* Border Radius */ | |
--border-radius: 12px; | |
/* Box Shadows */ | |
--box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.05); | |
--box-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2); | |
} | |
/* Reset and Base Styles */ | |
#coder * { | |
box-sizing: border-box; | |
font-family: Arial, sans-serif; | |
} | |
/* Card Styling */ | |
.coder-card { | |
display: flex; | |
flex-direction: column; /* Stack options and main content vertically */ | |
gap: var(--gap-large); /* Large gap between sections */ | |
background: var(--background-color); | |
border-radius: var(--border-radius); | |
box-shadow: var(--box-shadow-base); | |
padding: var(--padding); | |
margin: 25px auto; | |
transition: transform 0.3s, box-shadow 0.3s, background 0.3s; | |
} | |
.coder-card:hover { | |
transform: translateY(-5px); | |
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1); | |
background: linear-gradient(135deg, #e0f7fa, #ffffff); | |
} | |
/* Flex Layout for Coder Options */ | |
.coder-options { | |
width: 100%; /* Full width */ | |
display: flex; | |
flex-direction: row; /* Arrange options side by side */ | |
flex-wrap: wrap; /* Allow wrapping on smaller screens */ | |
gap: var(--gap-compact); /* Reduced gap for compactness */ | |
} | |
/* Option Sections Styling */ | |
.option-section { | |
background-color: var(--background-color); | |
padding: var(--padding-compact); /* Reduced padding */ | |
border-radius: var(--border-radius); | |
box-shadow: var(--box-shadow-base); | |
transition: background 0.3s, box-shadow 0.3s; | |
flex: 1 1 200px; /* Flexible basis */ | |
display: flex; | |
flex-direction: column; /* Stack labels and inputs vertically */ | |
gap: var(--gap-compact); /* Reduced gap */ | |
} | |
.option-section:hover { | |
background-color: var(--hover-background-color); | |
} | |
/* Labels Styling */ | |
.option-section label { | |
font-size: 0.95em; /* Slightly reduced font size */ | |
color: var(--text-color); | |
font-weight: 600; | |
margin-bottom: 3px; /* Reduced margin */ | |
} | |
/* Select Dropdown Styling */ | |
.option-section select { | |
width: 100%; | |
padding: 8px 12px; /* Reduced padding */ | |
border: 1px solid var(--border-color); | |
border-radius: 8px; | |
font-size: 0.95em; /* Slightly reduced font size */ | |
background-color: var(--background-color); | |
transition: border-color 0.3s, box-shadow 0.3s; | |
} | |
.option-section select:focus { | |
border-color: var(--primary-color); | |
box-shadow: 0 0 5px rgba(0, 121, 107, 0.5); | |
outline: none; | |
} | |
/* Grouped Controls Styling */ | |
.option-control-group { | |
display: flex; | |
flex-direction: row; | |
gap: 10px; | |
align-items: center; | |
} | |
/* Range Inputs Styling */ | |
.option-section input[type="range"] { | |
width: 100%; | |
margin: 5px 0; /* Reduced margin */ | |
} | |
/* Button Styling within Option Sections */ | |
.option-section button { | |
background: var(--primary-gradient); | |
border: none; | |
color: white; | |
padding: 8px 12px; /* Reduced padding */ | |
font-size: 0.9em; /* Slightly reduced font size */ | |
border-radius: 8px; | |
cursor: pointer; | |
transition: background 0.3s, transform 0.2s, box-shadow 0.3s; | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
} | |
.option-section button:hover:not(:disabled) { | |
background: var(--primary-hover-gradient); | |
transform: translateY(-1px); /* Slightly less translate */ | |
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); | |
} | |
.option-section button:disabled { | |
background: var(--disabled-gradient); | |
cursor: not-allowed; | |
box-shadow: none; | |
} | |
/* Logs Container Styling */ | |
#coder-logs-container { | |
display: flex; | |
flex-direction: column; | |
gap: var(--gap-small); /* Small gap */ | |
max-height: 150px; /* Fixed height to prevent infinite expansion */ | |
overflow: hidden; /* Hide overflow to maintain layout */ | |
} | |
/* Logs Content Styling */ | |
#coder-logs { | |
flex: 1; | |
max-height: 200px; /* Adjust based on container height */ | |
border: 1px solid #e0e0e0; | |
border-radius: var(--border-radius); | |
overflow-y: auto; /* Enable vertical scrolling */ | |
padding: 10px; | |
background-color: #f9f9f9; | |
font-size: var(--font-size-small); | |
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05); | |
} | |
/* Clear Logs Button Styling */ | |
#coder-clear-logs { | |
align-self: flex-end; | |
background: var(--secondary-gradient); | |
border: none; | |
color: white; | |
padding: 6px 12px; /* Reduced padding */ | |
font-size: 0.85em; /* Reduced font size */ | |
cursor: pointer; | |
border-radius: 8px; | |
transition: background 0.3s, transform 0.2s, box-shadow 0.3s; | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
} | |
#coder-clear-logs:hover { | |
background: var(--secondary-hover-gradient); | |
transform: scale(1.01); /* Less scaling */ | |
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); | |
} | |
/* Chat Box Styling */ | |
#coder-chat-box { | |
height: 500px; | |
border: 1px solid #e0e0e0; | |
border-radius: var(--border-radius); | |
overflow-y: auto; | |
padding: 15px; /* Reduced padding */ | |
background-color: var(--background-color); | |
position: relative; | |
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05); | |
margin-bottom: 15px; /* Reduced margin */ | |
} | |
/* Message Styling */ | |
#coder .message-container { | |
margin-bottom: 15px; /* Reduced margin */ | |
display: flex; | |
} | |
#coder .message { | |
padding: 10px 14px; /* Reduced padding */ | |
border-radius: 18px; /* Slightly smaller border radius */ | |
max-width: 75%; | |
position: relative; | |
word-wrap: break-word; | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); | |
font-size: var(--font-size-base); | |
line-height: 1.4; | |
background-color: #f1f8e9; | |
transition: background-color 0.3s, box-shadow 0.3s; | |
} | |
#coder .user .message { | |
background: #DCF8C6; | |
border-bottom-right-radius: 0; | |
} | |
#coder .assistant .message { | |
background: #e3f2fd; | |
border-bottom-left-radius: 0; | |
} | |
/* Chat Input Container Styling */ | |
#coder-text-input-container { | |
display: flex; | |
gap: 8px; /* Reduced gap */ | |
} | |
#coder-text-input { | |
flex: 1; | |
padding: 8px 12px; /* Reduced padding */ | |
border: 1px solid var(--border-color); | |
border-radius: 8px; | |
font-size: var(--font-size-base); | |
background-color: var(--background-color); | |
transition: border-color 0.3s, box-shadow 0.3s; | |
} | |
#coder-text-input:focus { | |
border-color: var(--primary-color); | |
box-shadow: 0 0 5px rgba(0, 121, 107, 0.5); | |
outline: none; | |
} | |
#coder-submit-button { | |
background: var(--primary-gradient); | |
border: none; | |
color: white; | |
padding: 8px 16px; /* Reduced padding */ | |
font-size: 0.95em; /* Slightly reduced font size */ | |
border-radius: 8px; | |
cursor: pointer; | |
transition: background 0.3s, transform 0.2s, box-shadow 0.3s; | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
} | |
#coder-submit-button:hover:not(:disabled) { | |
background: var(--primary-hover-gradient); | |
transform: translateY(-1px); /* Less translate */ | |
box-shadow: var(--box-shadow-hover); | |
} | |
#coder-submit-button:disabled { | |
background: var(--disabled-gradient); | |
cursor: not-allowed; | |
box-shadow: none; | |
} | |
/* Microphone and Stop Buttons Styling */ | |
#coder-mic-container { | |
display: flex; | |
justify-content: center; | |
gap: 10px; /* Reduced gap */ | |
margin-top: 15px; /* Reduced margin */ | |
} | |
#coder-start_button, | |
#coder-stop_button { | |
background: var(--primary-gradient); | |
border: none; | |
color: white; | |
padding: 12px; /* Reduced padding */ | |
border-radius: 50%; | |
cursor: pointer; | |
transition: background 0.3s, transform 0.2s, box-shadow 0.3s; | |
width: 50px; /* Reduced size */ | |
height: 50px; /* Reduced size */ | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
position: relative; | |
overflow: hidden; | |
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); | |
} | |
#coder-stop_button { | |
background: var(--secondary-gradient); | |
} | |
#coder-start_button::before, | |
#coder-stop_button::before { | |
content: ''; | |
position: absolute; | |
width: 200%; | |
height: 200%; | |
background: rgba(255, 255, 255, 0.3); | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%) scale(0); | |
border-radius: 50%; | |
transition: transform 0.5s ease-out; | |
} | |
#coder-start_button:active::before, | |
#coder-stop_button:active::before { | |
transform: translate(-50%, -50%) scale(1); | |
} | |
#coder-start_button:disabled, | |
#coder-stop_button:disabled { | |
background: var(--disabled-gradient); | |
cursor: not-allowed; | |
box-shadow: none; | |
} | |
#coder-start_button:hover:not(:disabled), | |
#coder-stop_button:hover:not(:disabled) { | |
transform: scale(1.03); /* Slightly less scaling */ | |
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
} | |
#coder-stop_button:hover:not(:disabled) { | |
background: var(--secondary-hover-gradient); | |
} | |
/* Icon Styling */ | |
#coder .mic-icon, | |
#coder .stop-icon { | |
width: 24px; /* Reduced size */ | |
height: 24px; /* Reduced size */ | |
transition: transform 0.3s; | |
fill: #ffffff; | |
} | |
/* Animation for Mic Icon */ | |
#coder .mic-animate { | |
animation: pulse 2s infinite; | |
} | |
@keyframes pulse { | |
0% { | |
transform: scale(1); | |
} | |
50% { | |
transform: scale(1.2); | |
} | |
100% { | |
transform: scale(1); | |
} | |
} | |
/* Chat Stats */ | |
#coder-chat-stats { | |
font-size: var(--font-size-small); | |
color: #555555; | |
text-align: center; | |
margin-top: 10px; | |
} | |
/* Hidden Class */ | |
#coder .hidden { | |
display: none; | |
} | |
/* Scrollbar Styling for Logs and Chat */ | |
#coder-chat-box::-webkit-scrollbar, | |
#coder-logs::-webkit-scrollbar { | |
width: 8px; | |
} | |
#coder-chat-box::-webkit-scrollbar-track, | |
#coder-logs::-webkit-scrollbar-track { | |
background: #f1f1f1; | |
border-radius: 4px; | |
} | |
#coder-chat-box::-webkit-scrollbar-thumb, | |
#coder-logs::-webkit-scrollbar-thumb { | |
background: #cccccc; | |
border-radius: 4px; | |
} | |
#coder-chat-box::-webkit-scrollbar-thumb:hover, | |
#coder-logs::-webkit-scrollbar-thumb:hover { | |
background: #a8a8a8; | |
} | |
/* Initialize Button Styling */ | |
#coder-download { | |
background: var(--primary-gradient); | |
border: none; | |
color: white; | |
padding: 8px 16px; /* Reduced padding */ | |
font-size: 0.95em; /* Slightly reduced font size */ | |
border-radius: 8px; | |
cursor: pointer; | |
transition: background 0.3s, transform 0.2s, box-shadow 0.3s; | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
} | |
#coder-download:hover:not(:disabled) { | |
background: var(--primary-hover-gradient); | |
transform: translateY(-1px); /* Less translate */ | |
box-shadow: var(--box-shadow-hover); | |
} | |
#coder-download:disabled { | |
background: var(--disabled-gradient); | |
cursor: not-allowed; | |
box-shadow: none; | |
} | |
/* Configuration Info Styling */ | |
#coder-configuration { | |
margin-top: 15px; | |
font-size: var(--font-size-small); | |
color: #555555; | |
} | |
/* Responsive Grid Adjustments */ | |
@media (max-width: 1200px) { | |
.coder-options { | |
flex-direction: row; /* Ensure row direction on larger screens */ | |
} | |
} | |
@media (max-width: 800px) { | |
.coder-card { | |
flex-direction: column; | |
padding: 20px; | |
margin: 20px auto; | |
} | |
.coder-options { | |
gap: var(--gap-compact); | |
} | |
.chat-window { | |
flex-direction: column; /* Stack chat sections vertically on small screens */ | |
gap: var(--gap-compact); | |
} | |
/* Adjust Logs Container Height for Smaller Screens */ | |
#coder-logs-container { | |
max-height: 200px; | |
} | |
#coder-logs { | |
max-height: 150px; | |
} | |
/* Adjust Image Section for Smaller Screens */ | |
/* If applicable */ | |
} | |
/* Additional Styles for Option Control Group */ | |
.option-control-group { | |
display: flex; | |
flex-direction: row; | |
gap: 10px; | |
align-items: center; | |
} | |