Files
c-relay/api/index.css

747 lines
15 KiB
CSS

:root {
/* Core Variables (7) */
--primary-color: #000000;
--secondary-color: #ffffff;
--accent-color: #ff0000;
--muted-color: #dddddd;
--border-color: var(--muted-color);
--font-family: "Courier New", Courier, monospace;
--border-radius: 15px;
--border-width: 1px;
/* Floating Tab Variables (8) */
--tab-bg-logged-out: #ffffff;
--tab-bg-logged-in: #ffffff;
--tab-bg-opacity-logged-out: 0.9;
--tab-bg-opacity-logged-in: 0.2;
--tab-color-logged-out: #000000;
--tab-color-logged-in: #ffffff;
--tab-border-logged-out: #000000;
--tab-border-logged-in: #ff0000;
--tab-border-opacity-logged-out: 1.0;
--tab-border-opacity-logged-in: 0.1;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font-family);
background-color: var(--secondary-color);
color: var(--primary-color);
/* line-height: 1.4; */
padding: 0;
max-width: none;
margin: 0;
}
/* Header Styles */
.main-header {
background-color: var(--secondary-color);
border-bottom: var(--border-width) solid var(--border-color);
padding: 15px 20px;
position: sticky;
top: 0;
z-index: 100;
max-width: 1200px;
margin: 0 auto;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
.header-title {
margin: 0;
font-size: 24px;
font-weight: normal;
color: var(--primary-color);
border: none;
padding: 0;
text-align: left;
}
.header-user-name {
display: block;
font-weight: 500;
color: var(--primary-color);
font-size: 10px;
text-align: center;
margin-top: 4px;
}
.profile-area {
display: flex;
align-items: center;
position: relative;
cursor: pointer;
padding: 8px 12px;
border-radius: var(--border-radius);
transition: background-color 0.2s ease;
margin-left: auto;
}
.profile-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.profile-area:hover {
background-color: rgba(0, 0, 0, 0.05);
}
.profile-info {
display: flex;
align-items: center;
gap: 10px;
}
.header-user-image {
width: 48px; /* 50% larger than 32px */
height: 48px; /* 50% larger than 32px */
border-radius: var(--border-radius); /* Curved corners like other elements */
object-fit: cover;
border: 2px solid transparent; /* Invisible border */
background-color: var(--secondary-color);
}
.logout-dropdown {
position: absolute;
top: 100%;
right: 0;
background-color: var(--secondary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
min-width: 120px;
z-index: 200;
margin-top: 4px;
}
.logout-btn {
width: 100%;
padding: 10px 15px;
background: none;
border: none;
color: var(--primary-color);
text-align: left;
cursor: pointer;
font-size: 14px;
font-family: var(--font-family);
border-radius: var(--border-radius);
transition: background-color 0.2s ease;
}
.logout-btn:hover {
background-color: rgba(0, 0, 0, 0.1);
}
/* Login Modal Styles */
.login-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.login-modal-content {
background-color: var(--secondary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
padding: 30px;
max-width: 400px;
width: 90%;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
h1 {
border-bottom: var(--border-width) solid var(--border-color);
padding-bottom: 10px;
margin-bottom: 30px;
font-weight: normal;
font-size: 24px;
font-family: var(--font-family);
color: var(--primary-color);
}
h2 {
font-weight: normal;
padding-left: 10px;
font-size: 16px;
font-family: var(--font-family);
color: var(--primary-color);
}
.section {
background: var(--secondary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
padding: 20px;
margin-bottom: 20px;
}
.input-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
font-size: 14px;
font-family: var(--font-family);
color: var(--primary-color);
}
input,
textarea,
select {
width: 100%;
padding: 8px;
background: var(--secondary-color);
color: var(--primary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
font-family: var(--font-family);
font-size: 14px;
box-sizing: border-box;
transition: all 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
border-color: var(--accent-color);
outline: none;
}
button {
width: 100%;
padding: 8px;
background: var(--secondary-color);
color: var(--primary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
font-family: var(--font-family);
font-size: 14px;
cursor: pointer;
margin: 5px 0;
font-weight: bold;
transition: all 0.2s ease;
}
button:hover {
border-color: var(--accent-color);
}
button:active {
background: var(--accent-color);
color: var(--secondary-color);
}
button:disabled {
background-color: #ccc;
color: var(--muted-color);
cursor: not-allowed;
border-color: #ccc;
}
/* Flash animation for refresh button */
@keyframes flash-red {
0% { border-color: var(--border-color); }
50% { border-color: var(--accent-color); }
100% { border-color: var(--border-color); }
}
.flash-red {
animation: flash-red 0.5s ease-in-out;
}
/* Flash animation for updated statistics values */
@keyframes flash-value {
0% { color: var(--primary-color); }
50% { color: var(--accent-color); }
100% { color: var(--primary-color); }
}
.flash-value {
animation: flash-value 0.5s ease-in-out;
}
/* Npub links styling */
.npub-link {
color: var(--primary-color);
text-decoration: none;
font-weight: normal;
transition: color 0.2s ease;
}
.npub-link:hover {
color: var(--accent-color);
}
.status {
padding: 10px;
margin: 10px 0;
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
font-weight: bold;
font-family: var(--font-family);
transition: all 0.2s ease;
}
.status.connected {
background-color: var(--primary-color);
color: var(--secondary-color);
}
.status.disconnected {
background-color: var(--secondary-color);
color: var(--primary-color);
}
.status.authenticated {
background-color: var(--primary-color);
color: var(--secondary-color);
}
.status.error {
background-color: var(--secondary-color);
color: var(--primary-color);
border-color: var(--accent-color);
}
/* Authentication warning message */
.auth-warning-message {
margin-bottom: 15px;
padding: 12px;
background-color: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: var(--border-radius);
color: #856404;
}
.warning-content {
line-height: 1.4;
}
.warning-content strong {
color: #d68910;
}
.config-table {
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
width: 100%;
border-collapse: separate;
border-spacing: 0;
margin: 10px 0;
overflow: hidden;
}
.config-table th,
.config-table td {
border: 0.1px solid var(--muted-color);
padding: 4px;
text-align: left;
font-family: var(--font-family);
font-size: 10px;
}
.config-table-container {
overflow-x: auto;
max-width: 100%;
}
.config-table th {
font-weight: bold;
height: 40px; /* Double the default height */
line-height: 40px; /* Center text vertically */
}
.config-table tr:hover {
background-color: var(--muted-color);
}
/* Inline config value inputs - remove borders and padding to fit seamlessly in table cells */
.config-value-input {
border: none;
padding: 2px 4px;
background: transparent;
width: 100%;
min-height: auto;
font-family: inherit;
font-size: inherit;
color: inherit;
border-radius: 0;
}
.config-value-input:focus {
border: 1px solid var(--accent-color);
background: var(--secondary-color);
outline: none;
}
/* Config actions cell - clickable for saving */
.config-actions-cell {
cursor: pointer;
transition: all 0.2s ease;
text-align: center !important;
font-weight: bold;
vertical-align: middle;
width: 60px;
min-width: 60px;
max-width: 60px;
padding: 8px 4px;
}
.config-actions-cell:hover {
border: 1px solid var(--accent-color);
background-color: var(--muted-color);
}
.json-display {
background-color: var(--secondary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
padding: 10px;
font-family: var(--font-family);
font-size: 12px;
white-space: pre-wrap;
max-height: 300px;
overflow-y: auto;
margin: 10px 0;
}
.log-panel {
height: 200px;
overflow-y: auto;
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
padding: 10px;
font-size: 12px;
background-color: var(--secondary-color);
font-family: var(--font-family);
}
.log-entry {
margin-bottom: 5px;
border-bottom: 1px solid var(--muted-color);
padding-bottom: 5px;
}
.log-timestamp {
font-weight: bold;
font-family: var(--font-family);
}
.inline-buttons {
display: flex;
gap: 10px;
}
.inline-buttons button {
flex: 1;
}
.user-info {
padding: 10px;
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
margin: 10px 0;
background-color: var(--secondary-color);
}
.user-info-container {
display: flex;
flex-direction: column;
gap: 15px;
}
.user-details {
order: -1; /* Show user details first when logged in */
}
.login-section {
text-align: center;
}
.logout-section {
display: flex;
justify-content: flex-end;
}
.login-logout-btn {
width: auto;
min-width: 120px;
padding: 12px 16px;
background: var(--secondary-color);
color: var(--primary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
font-family: var(--font-family);
font-size: 14px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
margin: 0;
flex-shrink: 0;
}
.login-logout-btn:hover {
border-color: var(--accent-color);
}
.login-logout-btn:active {
background: var(--accent-color);
color: var(--secondary-color);
}
.login-logout-btn.logout-state {
background: var(--accent-color);
color: var(--secondary-color);
border-color: var(--accent-color);
}
.login-logout-btn.logout-state:hover {
background: var(--primary-color);
border-color: var(--border-color);
}
.user-pubkey {
font-family: var(--font-family);
font-size: 12px;
word-break: break-all;
margin: 5px 0;
}
/* User profile header with image */
.user-profile-header {
display: flex;
align-items: flex-start;
gap: 15px;
}
.user-image-container {
flex-shrink: 0;
}
.user-profile-image {
width: 60px;
height: 60px;
border-radius: var(--border-radius);
object-fit: cover;
border: 2px solid var(--border-color);
background-color: var(--bg-color);
}
.user-text-info {
flex: 1;
min-width: 0; /* Allow text to wrap */
}
.hidden {
display: none;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
border-bottom: var(--border-width) solid var(--border-color);
padding-bottom: 10px;
}
.countdown-btn {
width: auto;
min-width: 40px;
padding: 8px 12px;
background: var(--secondary-color);
color: var(--primary-color);
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
font-family: var(--font-family);
font-size: 10px;
/* font-weight: bold; */
cursor: pointer;
transition: all 0.2s ease;
margin-left: auto;
position: relative;
}
.countdown-btn:hover::after {
content: "countdown";
position: absolute;
top: -30px;
left: 50%;
transform: translateX(-50%);
background: var(--primary-color);
color: var(--secondary-color);
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: normal;
white-space: nowrap;
z-index: 1000;
border: 1px solid var(--border-color);
}
.auth-rules-controls {
margin-bottom: 15px;
}
.section-header .status {
margin: 0;
padding: 5px 10px;
min-width: auto;
font-size: 12px;
}
/* Auth Rule Input Sections Styling */
.auth-rule-section {
border: var(--border-width) solid var(--border-color);
border-radius: var(--border-radius);
padding: 15px;
margin: 15px 0;
background-color: var(--secondary-color);
}
.auth-rule-section h3 {
margin: 0 0 10px 0;
font-size: 14px;
font-weight: bold;
border-left: 4px solid var(--border-color);
padding-left: 8px;
font-family: var(--font-family);
color: var(--primary-color);
}
.auth-rule-section p {
margin: 0 0 15px 0;
font-size: 13px;
color: var(--muted-color);
font-family: var(--font-family);
}
.rule-status {
margin-top: 10px;
padding: 8px;
border: var(--border-width) solid var(--muted-color);
border-radius: var(--border-radius);
font-size: 12px;
min-height: 20px;
background-color: var(--secondary-color);
font-family: var(--font-family);
transition: all 0.2s ease;
}
.rule-status.success {
border-color: #4CAF50;
background-color: #E8F5E8;
color: #2E7D32;
}
.rule-status.error {
border-color: var(--accent-color);
background-color: #FFEBEE;
color: #C62828;
}
.rule-status.warning {
border-color: #FF9800;
background-color: #FFF3E0;
color: #E65100;
}
.warning-box {
border: var(--border-width) solid #FF9800;
border-radius: var(--border-radius);
background-color: #FFF3E0;
padding: 10px;
margin: 10px 0;
font-size: 13px;
color: #E65100;
font-family: var(--font-family);
}
.warning-box strong {
color: #D84315;
}
#login-section {
text-align: center;
padding: 20px;
}
/* Floating tab styles */
.floating-tab {
font-family: var(--font-family);
border-radius: var(--border-radius);
border: var(--border-width) solid;
transition: all 0.2s ease;
}
.floating-tab--logged-out {
background: rgba(255, 255, 255, var(--tab-bg-opacity-logged-out));
color: var(--tab-color-logged-out);
border-color: rgba(0, 0, 0, var(--tab-border-opacity-logged-out));
}
.floating-tab--logged-in {
background: rgba(0, 0, 0, var(--tab-bg-opacity-logged-in));
color: var(--tab-color-logged-in);
border-color: rgba(255, 0, 0, var(--tab-border-opacity-logged-in));
}
.transition {
transition: all 0.2s ease;
}
/* Main Sections Wrapper */
.main-sections-wrapper {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
display: flex;
flex-wrap: wrap;
gap: var(--border-width);
}
.flex-section {
flex: 1;
min-width: 300px;
}
@media (max-width: 700px) {
body {
padding: 10px;
}
.inline-buttons {
flex-direction: column;
}
h1 {
font-size: 20px;
}
h2 {
font-size: 14px;
}
}