Kokoro-FastAPI/web/styles/forms.css

689 lines
13 KiB
CSS
Raw Normal View History

.text-editor {
display: flex;
flex-direction: column;
gap: 0.5rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1rem;
overflow: hidden;
}
.editor-view {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
min-height: 0;
}
.page-content {
flex: 1;
width: 100%;
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
background: rgba(15, 23, 42, 0.3);
color: var(--text);
font-family: var(--font-family);
font-size: 1rem;
resize: none;
transition: border-color 0.2s ease;
min-height: 300px;
}
.page-content:focus {
outline: none;
border-color: var(--fg-color);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.page-navigation {
display: flex;
justify-content: center;
align-items: center;
padding: 0.25rem;
border-bottom: 1px solid var(--border);
margin-bottom: 0.5rem;
background: rgba(15, 23, 42, 0.3);
border-radius: 0.5rem 0.5rem 0 0;
}
.page-navigation .pagination {
transform: scale(0.9);
}
.page-navigation .pagination button {
padding: 0.25rem 0.75rem;
}
.editor-footer {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
padding: 0.5rem 0;
}
.chars-per-page {
display: flex;
align-items: center;
gap: 0.5rem;
}
.format-btn {
background: transparent;
border: 1px solid var(--border);
color: var(--text-light);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s ease;
width: auto;
font-size: 0.875rem;
}
.format-btn:hover {
background: rgba(99, 102, 241, 0.1);
border-color: var(--fg-color);
transform: none;
box-shadow: none;
}
.chars-input {
width: 70px;
padding: 0.25rem 0.5rem;
border: 1px solid var(--border);
border-radius: 0.25rem;
background: rgba(15, 23, 42, 0.3);
color: var(--text);
font-size: 0.875rem;
text-align: center;
}
.chars-input:focus {
outline: none;
border-color: var(--fg-color);
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.chars-label {
color: var(--text-light);
font-size: 0.875rem;
}
.pagination {
display: flex;
align-items: center;
gap: 0.75rem;
}
.pagination button {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s ease;
width: auto;
}
.pagination button:hover:not(:disabled) {
background: rgba(99, 102, 241, 0.1);
border-color: var(--fg-color);
transform: none;
box-shadow: none;
}
.pagination button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.page-info {
color: var(--text-light);
font-size: 0.875rem;
min-width: 100px;
text-align: center;
}
.char-count {
color: var(--text-light);
font-size: 0.875rem;
min-width: 100px;
text-align: right;
}
.file-controls {
display: flex;
gap: 0.5rem;
}
.upload-btn,
.clear-btn {
background: transparent;
border: 1px solid var(--border);
color: var(--text-light);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s ease;
width: auto;
font-size: 0.875rem;
}
.upload-btn:hover,
.clear-btn:hover {
background: rgba(99, 102, 241, 0.1);
border-color: var(--fg-color);
transform: none;
box-shadow: none;
}
.help-icon {
position: absolute;
top: 1rem;
right: 1rem;
color: var(--text-light);
cursor: pointer;
z-index: 2;
opacity: 0.7;
transition: opacity 0.3s ease;
}
.help-icon:hover {
opacity: 1;
}
.tooltip-content {
visibility: hidden;
opacity: 0;
position: absolute;
top: calc(100% + 10px);
right: 0;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1rem;
width: 300px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
z-index: 1000;
transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}
.help-icon:hover .tooltip-content {
visibility: visible;
opacity: 1;
transition: visibility 0s linear 0.2s, opacity 0.3s ease 0.2s;
}
.tooltip-content h4 {
margin: 0 0 0.5rem 0;
color: var(--text);
}
.tooltip-content ul {
margin: 0;
padding-left: 1.25rem;
color: var(--text-light);
}
.tooltip-content code {
background: rgba(99, 102, 241, 0.1);
padding: 0.125rem 0.25rem;
border-radius: 0.25rem;
font-family: monospace;
}
main {
display: grid;
grid-template-columns: 1fr 300px;
grid-template-rows: 1fr auto;
gap: 1.25rem;
height: auto;
min-height: calc(100vh - 3rem);
max-width: 1200px;
margin: 0 auto;
padding: 1rem 1rem 2rem 1rem;
align-items: start;
}
.text-editor,
.controls,
.player-container {
margin-bottom: 0.5rem;
}
.generation-progress {
width: 100%;
height: 4px;
background: rgba(99, 102, 241, 0.1);
border-radius: 2px;
margin: 0.75rem 0;
overflow: hidden;
position: relative;
}
.generation-progress::after {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 30%;
background: var(--fg-color);
border-radius: 2px;
animation: progress 1.5s ease-in-out infinite;
}
@keyframes progress {
0% {
left: -30%;
}
100% {
left: 100%;
}
}
/* Custom scrollbar styles */
::-webkit-scrollbar {
width: 8px;
height: 8px;
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(99, 102, 241, 0.2);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(99, 102, 241, 0.3);
}
::-webkit-scrollbar-track {
background: transparent;
}
.text-editor {
grid-column: 1;
grid-row: 1;
min-height: 0;
height: calc(100vh - 14rem);
overflow: auto;
scrollbar-width: thin;
scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
margin: 0;
}
.controls {
grid-column: 2;
grid-row: 1;
min-height: 0;
height: calc(100vh - 14rem);
display: flex;
flex-direction: column;
gap: 1.25rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1.25rem;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
margin: 0;
position: relative;
}
.voice-select-container {
position: relative;
display: flex;
flex-direction: column;
gap: 0.75rem;
background: rgba(15, 23, 42, 0.3);
border-radius: 0.5rem;
padding: 1rem;
height: auto;
min-height: 120px;
max-height: 200px;
flex-shrink: 0;
margin: 0.5rem 0;
overflow: visible;
}
.selected-voices {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 0.5rem;
margin-top: 0.25rem;
height: auto;
min-height: 60px;
max-height: none;
overflow-y: visible;
padding: 0.75rem;
background: rgba(15, 23, 42, 0.3);
border-radius: 0.25rem;
scrollbar-width: thin;
scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
}
.voice-search {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
background: rgba(15, 23, 42, 0.3);
color: var(--text);
font-size: 1rem;
transition: all 0.2s ease;
}
.voice-search:focus {
outline: none;
border-color: var(--fg-color);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.voice-search::placeholder {
color: var(--text-light);
}
.voice-dropdown {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
max-height: 400px;
overflow-y: auto;
z-index: 1002;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
scrollbar-width: thin;
scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
padding: 0.25rem;
margin-top: 0.5rem;
}
.voice-select-container:focus-within .voice-dropdown,
.voice-dropdown:hover {
display: block;
}
.voice-option {
display: flex;
align-items: center;
padding: 0.875rem 1rem;
cursor: pointer;
transition: background-color 0.2s ease;
color: var(--text);
border-radius: 0.25rem;
}
.voice-option:hover {
background: rgba(99, 102, 241, 0.1);
}
.selected-voice-tag {
background: rgba(99, 102, 241, 0.2);
padding: 0.375rem 0.75rem;
border-radius: 1rem;
font-size: 0.75rem;
display: inline-flex;
align-items: center;
gap: 0.375rem;
border: 1px solid rgba(99, 102, 241, 0.3);
white-space: nowrap;
flex-shrink: 0;
}
.selected-voice-tag input {
width: 2.5em;
padding: 0.1rem;
min-height: 1.25em;
background: transparent;
border: none;
color: inherit;
font-size: inherit;
}
.remove-voice {
cursor: pointer;
opacity: 0.7;
transition: opacity 0.2s ease;
}
.remove-voice:hover {
opacity: 1;
}
.options {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
flex-wrap: wrap;
padding: 0.5rem;
border-top: 1px solid var(--border);
border-bottom: 1px solid var(--border);
margin: 0.5rem 0;
}
.option-group {
display: flex;
align-items: center;
gap: 1rem;
}
.speed-control {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.speed-control label {
color: var(--text-light);
font-size: 0.875rem;
}
.speed-control input[type="range"] {
width: 150px;
height: 4px;
-webkit-appearance: none;
background: rgba(99, 102, 241, 0.2);
border-radius: 2px;
outline: none;
}
.speed-control input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
background: var(--fg-color);
border-radius: 50%;
cursor: pointer;
transition: transform 0.2s ease;
}
.speed-control input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.1);
}
.speed-control input[type="range"]::-moz-range-thumb {
width: 16px;
height: 16px;
background: var(--fg-color);
border: none;
border-radius: 50%;
cursor: pointer;
transition: transform 0.2s ease;
}
.speed-control input[type="range"]::-moz-range-thumb:hover {
transform: scale(1.1);
}
.options label {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-light);
cursor: pointer;
}
.format-select {
background: rgba(15, 23, 42, 0.3);
color: var(--text);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 0.5rem 1rem;
font-family: var(--font-family);
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s ease;
min-width: 100px;
}
.format-select:hover {
border-color: var(--fg-color);
}
.format-select:focus {
outline: none;
border-color: var(--fg-color);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.format-select option {
background: var(--surface);
color: var(--text);
}
.container {
display: flex;
flex-direction: column;
height: 100vh;
padding: 0.75rem 1.25rem 1.5rem 1.25rem;
gap: 1rem;
}
.player-container {
grid-column: 1 / -1;
grid-row: 2;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1.25rem 1.5rem;
height: auto;
min-height: 90px;
display: flex;
flex-direction: column;
justify-content: center;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
margin: 1rem 0;
align-self: start;
width: 100%;
position: relative;
z-index: 1;
}
.options {
margin: 1rem 0;
padding: 1rem 0;
border-top: 1px solid var(--border);
border-bottom: 1px solid var(--border);
}
.button-group {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.generation-options {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
padding: 0.5rem 0;
margin-top: 0.5rem;
border-top: 1px solid var(--border);
}
.generation-options label {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-light);
cursor: pointer;
font-size: 0.875rem;
}
.button-group {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1rem;
}
button {
background: var(--fg-color);
color: var(--text);
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
border: none;
font-weight: 500;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
width: 100%;
}
button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
button:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.cancel-btn {
background: var(--error);
margin-top: 0.75rem;
}
.loader {
display: none;
width: 16px;
height: 16px;
border: 2px solid var(--text);
border-radius: 50%;
border-top-color: transparent;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.loading .loader {
display: inline-block;
}
.loading .btn-text {
display: none;
}