BinCode/public/style.css

619 lines
9.8 KiB
CSS
Raw Normal View History

2025-01-17 20:05:21 +00:00
:root {
--primary: #63DEAB;
--primary-dark: #48de9f;
--primary-light: rgba(26, 115, 232, 0.1);
--border: #e1e4e8;
--text: #000000;
--text-light: #6a737d;
--background: #ffffff;
--editor-bg: #fafbfc;
--tab-bg: #f6f8fa;
--tab-active: #ffffff;
--danger: #d73a49;
--success: #28a745;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 4px;
height: 4px;
}
::-webkit-scrollbar-track {
background: var(--background);
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: var(--text-light);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(#cacaca);
}
::-webkit-scrollbar-thumb:window-inactive {
background: var(--primary-light);
2025-01-17 20:05:21 +00:00
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: var(--text);
line-height: 1.5;
height: 100vh;
overflow: hidden;
}
#app {
height: 100vh;
display: flex;
flex-direction: column;
}
/* Navbar */
nav {
background: var(--tab-bg);
border-bottom: 1px solid var(--border);
padding: 0.20rem 1rem;
2025-01-17 20:05:21 +00:00
display: flex;
align-items: center;
gap: 1rem;
}
.brand {
font-weight: 600;
font-size: 1.1rem;
color: var(--text);
flex-shrink: 0;
}
.title-input {
flex: 1;
}
.title-input input {
width: 100%;
max-width: 300px;
padding: 0.4rem 0.75rem;
border: 1px solid var(--border);
border-radius: 6px;
font-size: 0.9rem;
background: var(--background);
}
.title-input input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}
.nav-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
/* Main container */
.editor-container {
flex: 1;
display: flex;
overflow: hidden;
background: var(--editor-bg);
}
/* Editor group */
.editor-group {
display: flex;
flex-direction: column;
min-width: 250px;
background: var(--background);
transition: width 0.2s ease;
}
/* Tab bar */
.tab-bar {
display: flex;
background: var(--tab-bg);
padding: 0 0.5rem;
border-bottom: 1px solid var(--border);
height: 40px;
align-items: flex-end;
user-select: none;
overflow-x: auto;
overflow-y: hidden;
}
.tab {
padding: 0.6rem 1.2rem;
font-size: 0.9rem;
color: var(--text-light);
cursor: pointer;
border: 1px solid transparent;
border-bottom: none;
margin-bottom: -1px;
border-radius: 6px 6px 0 0;
background: transparent;
position: relative;
display: flex;
align-items: center;
gap: 0.5rem;
}
.tab:hover {
color: var(--text);
background: rgba(0, 0, 0, 0.02);
}
.tab.active {
background: var(--tab-active);
color: var(--text);
border-color: var(--border);
border-bottom-color: var(--tab-active);
font-weight: 500;
}
.tab-icon {
height: 18px;
width: 18px;
2025-01-17 20:05:21 +00:00
line-height: 1;
}
/* Editor content */
.editor-content {
position: relative;
flex: 1;
overflow: hidden;
background: var(--background);
}
.editor-content textarea,
.editor-content pre {
box-sizing: border-box;
padding: 1rem;
margin: 0;
border: 0;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: auto;
white-space: pre;
font-family: Monaco, 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
}
.editor-content textarea {
color: transparent;
background: transparent;
caret-color: black;
z-index: 2;
resize: none;
}
.editor-content pre {
z-index: 1;
pointer-events: none;
background: transparent;
}
.editor-content pre code {
display: block;
font-family: inherit;
}
textarea:focus {
outline: none;
}
textarea::placeholder {
color: var(--text-light);
opacity: 0.6;
}
/* Resize handle */
.resize-handle {
width: 6px;
background: var(--tab-bg);
cursor: col-resize;
position: relative;
z-index: 10;
flex-shrink: 0;
}
.resize-handle::after {
content: '';
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 2px;
background: var(--border);
transform: translateX(-50%);
transition: background-color 0.2s;
}
body.resizing {
cursor: col-resize !important;
user-select: none;
}
body.resizing * {
cursor: col-resize !important;
}
body.resizing .resize-handle {
background: var(--primary-light);
}
body.resizing .resize-handle::after {
background: var(--primary);
}
/* Preview panel */
.preview {
flex: 1;
min-width: 250px;
background: var(--background);
border-left: 1px solid var(--border);
transition: width 0.2s ease;
}
iframe {
width: 100%;
height: 100%;
border: none;
background: white;
}
/* Keyboard shortcuts */
kbd {
padding: 0.1rem 0.4rem;
font-size: 0.75rem;
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
border: 1px solid var(--border);
border-bottom-width: 2px;
border-radius: 4px;
background: var(--background);
color: var(--text-light);
margin-left: 0.5rem;
}
/* Buttons */
button {
padding: 0.4rem 0.75rem;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--background);
color: var(--text);
font-size: 0.9rem;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.5rem;
transition: all 0.2s;
}
button:hover {
background: var(--tab-bg);
}
button.primary {
background: var(--primary);
border-color: var(--primary);
color: white;
}
button.primary:hover {
background: var(--primary-dark);
border-color: var(--primary-dark);
}
/* Modals */
.modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
form {
padding: 1rem;
margin-bottom: 0.5rem;
}
form > input {
margin:0.5rem auto;
}
form > button {
margin-top: 0.25rem;
}
.modal-content {
background: var(--background);
border-radius: 8px;
padding: 1.5rem;
width: 90%;
max-width: 400px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
position: relative;
display: flex;
}
.modal h2 {
margin-bottom: 0;
font-size: 1.25rem;
font-weight: 600;
}
.modal input:not([type="submit"]) {
width: 100%;
padding: 0.6rem 0.75rem;
border: 1px solid var(--border);
border-radius: 6px;
margin-bottom: 0;
font-size: 0.9rem;
}
.modal input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}
.close {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-light);
padding: 0;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.close:hover {
color: var(--text);
background: none;
}
/* Share URL */
.share-url {
display: flex;
gap: 0.5rem;
align-items: center;
flex-direction: row;
padding: 1rem;
}
.share-url > button {
height: 40px;
padding: 0.6rem 0.75rem;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--primary);
color: white;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s;
}
.share-url input {
margin-bottom: 0;
flex: 1;
}
/* View toggles */
.view-toggles {
display: flex;
gap: 0.5rem;
margin-right: 1rem;
}
.view-toggles button {
background: var(--tab-bg);
border: 1px solid var(--border);
padding: 0.4rem 0.75rem;
font-size: 0.9rem;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-light);
transition: all 0.2s;
}
.view-toggles button:hover {
background: var(--background);
color: var(--text);
}
.view-toggles button.active {
background: var(--background);
color: var(--primary);
border-color: var(--primary);
}
.icon {
font-size: 1.1em;
line-height: 1;
}
/* Main container */
.editor-container {
flex: 1;
display: flex;
overflow: hidden;
background: var(--editor-bg);
position: relative;
}
/* Editor group */
.editor-group {
display: flex;
flex-direction: column;
background: var(--background);
transition: all 0.2s ease;
2025-01-17 20:05:21 +00:00
width: 100%;
}
.editor-group.hidden {
display: none;
}
/* Preview panel */
.preview {
flex: 1;
background: var(--background);
border-left: 1px solid var(--border);
transition: all 0.3s ease;
}
.preview.hidden {
display: none;
}
.preview.full-screen {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
border: none;
}
.user-menu > button {
margin-left: 10px;
}
.toggle-container {
display: flex;
flex-direction: row;
}
2025-01-17 20:05:21 +00:00
.toggle-icon {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 8px;
background: none;
border: none;
2025-01-17 20:05:21 +00:00
cursor: pointer;
padding: 8px;
font-size: 14px;
color: #5f6368;
}
.toggle-icon span,
.toggle-icon svg {
display: inline-flex;
align-items: center;
}
.toggle-icon svg {
width: 15px;
height: 15px;
}
.toggle-label {
margin-left: 4px;
2025-01-17 20:05:21 +00:00
}
.toggle-icon:hover {
color: #000;
}
2025-01-17 20:05:21 +00:00
/* Responsive */
@media (max-width: 768px) {
.user-menu {
display: flex;
flex-direction: column;
align-content: center;
justify-content: center;
gap: 4px;
}
button {
padding: 0.25rem 0.30rem;
gap: 0;
}
.user-menu > button {
margin-left: 0;
}
.editor-container {
flex-direction: column;
}
.editor-group,
.preview {
width: 100% !important;
height: 50%;
min-width: 0;
}
.resize-handle {
display: none;
}
.title-input {
display: none;
}
}
@media (prefers-color-scheme: dark) {
:root {
--primary: #63DEAB;
--primary-dark: #63DEAB;
--primary-light: rgba(77, 159, 255, 0.1);
--border: #30363d;
--text: #ffffff;
--text-light: #8b949e;
--background: #0d1117;
--editor-bg: #161b22;
--tab-bg: #21262d;
--tab-active: #0d1117;
}
input, .toggle-icon {
color: white;
}
::selection {
background: var(--primary-light);
color: var(--text);
}
}