Files
edge-tts/web/styles.css
2025-12-02 12:22:06 +08:00

489 lines
8.3 KiB
CSS

:root {
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--secondary-color: #64748b;
--background: #f8fafc;
--card-background: #ffffff;
--text-primary: #1e293b;
--text-secondary: #64748b;
--border-color: #e2e8f0;
--success-color: #10b981;
--error-color: #ef4444;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: var(--background);
color: var(--text-primary);
line-height: 1.6;
padding: 1rem;
}
.container {
max-width: 800px;
margin: 0 auto;
}
/* Header */
header {
text-align: center;
margin-bottom: 2rem;
padding: 2rem 0;
}
header h1 {
font-size: 2.5rem;
color: var(--primary-color);
margin-bottom: 0.5rem;
}
.subtitle {
color: var(--text-secondary);
font-size: 1.1rem;
}
/* Card */
.card {
background: var(--card-background);
border-radius: 0.75rem;
padding: 1.5rem;
margin-bottom: 1.5rem;
box-shadow: var(--shadow);
border: 1px solid var(--border-color);
}
.card h2 {
font-size: 1.25rem;
color: var(--text-primary);
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 2px solid var(--border-color);
}
/* Form Elements */
.form-group {
margin-bottom: 1rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 600;
color: var(--text-primary);
font-size: 0.9rem;
}
textarea {
width: 100%;
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-family: inherit;
font-size: 1rem;
resize: vertical;
transition: border-color 0.2s;
}
textarea:focus {
outline: none;
border-color: var(--primary-color);
}
select {
width: 100%;
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-family: inherit;
font-size: 1rem;
background: white;
cursor: pointer;
transition: border-color 0.2s;
}
select:focus {
outline: none;
border-color: var(--primary-color);
}
.char-count {
text-align: right;
color: var(--text-secondary);
font-size: 0.875rem;
margin-top: 0.5rem;
}
/* Filters */
.filters {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
/* Test Voice Section */
.test-voice-section {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 1rem;
}
.test-voice-hint {
font-size: 0.875rem;
color: var(--text-secondary);
margin: 0;
}
/* Prosody Controls */
.prosody-controls {
margin-top: 1rem;
}
input[type="range"] {
width: 100%;
height: 6px;
border-radius: 3px;
background: var(--border-color);
outline: none;
-webkit-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--primary-color);
cursor: pointer;
transition: background 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
background: var(--primary-hover);
}
input[type="range"]::-moz-range-thumb {
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--primary-color);
cursor: pointer;
border: none;
transition: background 0.2s;
}
input[type="range"]::-moz-range-thumb:hover {
background: var(--primary-hover);
}
/* Buttons */
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 0.5rem;
font-family: inherit;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.btn-primary {
background: var(--primary-color);
color: white;
}
.btn-primary:hover:not(:disabled) {
background: var(--primary-hover);
transform: translateY(-1px);
box-shadow: var(--shadow-lg);
}
.btn-secondary {
background: var(--secondary-color);
color: white;
}
.btn-secondary:hover:not(:disabled) {
background: #475569;
transform: translateY(-1px);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-icon {
font-size: 1.2rem;
}
.btn-link {
background: none;
border: none;
color: var(--primary-color);
cursor: pointer;
text-decoration: underline;
font-size: inherit;
padding: 0;
}
.btn-link:hover {
color: var(--primary-hover);
}
/* Actions */
.actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
/* Progress Bar */
.progress-bar {
width: 100%;
height: 4px;
background: var(--border-color);
border-radius: 2px;
overflow: hidden;
margin: 1rem 0;
}
.progress-fill {
height: 100%;
background: var(--primary-color);
animation: progress 1.5s ease-in-out infinite;
}
@keyframes progress {
0% {
width: 0%;
margin-left: 0%;
}
50% {
width: 50%;
margin-left: 25%;
}
100% {
width: 0%;
margin-left: 100%;
}
}
/* Status Message */
.status-message {
padding: 0.75rem;
border-radius: 0.5rem;
margin-top: 1rem;
display: none;
}
.status-message.success {
background: #d1fae5;
color: #065f46;
display: block;
}
.status-message.error {
background: #fee2e2;
color: #991b1b;
display: block;
}
.status-message.info {
background: #dbeafe;
color: #1e40af;
display: block;
}
/* Audio Section */
#audioPlayer {
width: 100%;
margin-bottom: 1rem;
}
.audio-actions {
display: flex;
gap: 1rem;
}
/* History */
.history-list {
max-height: 300px;
overflow-y: auto;
}
.history-item {
padding: 1rem;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
margin-bottom: 0.75rem;
cursor: pointer;
transition: all 0.2s;
}
.history-item:hover {
border-color: var(--primary-color);
background: #f1f5f9;
}
.history-item-header {
display: flex;
justify-content: space-between;
align-items: start;
margin-bottom: 0.5rem;
}
.history-item-text {
font-size: 0.9rem;
color: var(--text-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
margin-right: 1rem;
}
.history-item-voice {
font-size: 0.8rem;
color: var(--text-secondary);
}
.history-item-time {
font-size: 0.75rem;
color: var(--text-secondary);
}
.history-item-actions {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}
.history-item-actions button {
padding: 0.25rem 0.75rem;
font-size: 0.875rem;
}
.empty-state {
text-align: center;
color: var(--text-secondary);
padding: 2rem;
}
/* Footer */
footer {
text-align: center;
padding: 2rem 0;
color: var(--text-secondary);
font-size: 0.875rem;
}
footer a {
color: var(--primary-color);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
.status-indicator {
margin-top: 0.5rem;
}
.online {
color: var(--success-color);
}
.offline {
color: var(--error-color);
}
/* Responsive */
@media (max-width: 640px) {
body {
padding: 0.5rem;
}
header h1 {
font-size: 2rem;
}
.card {
padding: 1rem;
}
.actions {
flex-direction: column;
}
.actions .btn {
width: 100%;
}
.filters {
grid-template-columns: 1fr;
}
.test-voice-section {
flex-direction: column;
align-items: stretch;
}
.test-voice-section .btn {
width: 100%;
}
.test-voice-hint {
text-align: center;
}
}
/* Install prompt animation */
#installPrompt {
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Loading animation */
.loading {
display: inline-block;
width: 1rem;
height: 1rem;
border: 2px solid var(--border-color);
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}