This commit is contained in:
sakrecoer 2026-08-18 22:28:19 +02:00
parent 2df4e35320
commit 98ba3d0230
5 changed files with 566 additions and 470 deletions

View file

@ -1,348 +0,0 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: #f5f5f5;
color: #333;
}
.app {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.app-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 0;
border-bottom: 2px solid #e0e0e0;
margin-bottom: 30px;
}
.app-header h1 {
font-size: 24px;
}
.app-header nav {
display: flex;
gap: 20px;
}
.app-header nav a {
color: #666;
text-decoration: none;
transition: color 0.2s;
}
.app-header nav a:hover {
color: #000;
}
.user-badge {
background: #e8f5e9;
padding: 8px 12px;
border-radius: 20px;
font-size: 14px;
color: #2e7d32;
}
main {
min-height: 400px;
}
footer {
margin-top: 50px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
text-align: center;
color: #999;
font-size: 14px;
}
/* Form Styles */
.form-group {
margin-bottom: 20px;
margin-top: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #555;
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: #7c4dff;
}
/* Button Styles */
.btn-primary {
background: #7c4dff;
color: white;
border: none;
padding: 12px 24px;
border-radius: 6px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
width: 100%;
}
.btn-primary:hover:not(:disabled) {
background: #6c3fdb;
}
.btn-primary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-secondary {
background: #e0e0e0;
color: #333;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
margin-top: 8px;
}
.btn-secondary:hover {
background: #d0d0d0;
}
.btn-danger {
background: #ff5252;
color: white;
border: none;
padding: 4px 8px;
border-radius: 4px;
cursor: pointer;
}
.btn-danger:hover:not(:disabled) {
background: #d32f2f;
}
.btn-danger:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.btn-nostr {
background: #ff6b00;
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
}
.btn-nostr:hover:not(:disabled) {
background: #e85a00;
}
/* Relay List */
.relay-list {
margin-bottom: 10px;
}
.relay-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px;
background: white;
border: 1px solid #e0e0e0;
border-radius: 6px;
margin-bottom: 8px;
}
.relay-item .relay-input {
flex: 1;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
.relay-item label {
display: flex;
align-items: center;
gap: 4px;
font-size: 14px;
font-weight: normal;
}
/* Share Box */
.share-box {
margin-top: 20px;
padding: 20px;
background: #e8f5e9;
border-radius: 8px;
border-left: 4px solid #4caf50;
}
.share-box input {
width: 100%;
padding: 8px;
margin: 8px 0;
border: 1px solid #ddd;
border-radius: 4px;
}
.share-box button {
background: #4caf50;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
/* Template Applier */
.template-preview {
background: white;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
border: 1px solid #e0e0e0;
}
.template-preview h3 {
margin-bottom: 8px;
}
.relay-preview ul {
list-style: none;
padding: 0;
}
.relay-preview li {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
}
.relay-url {
font-family: monospace;
}
.relay-permissions {
font-size: 18px;
}
.error-box, .warning {
padding: 20px;
background: #ffebee;
border-radius: 8px;
border-left: 4px solid #f44336;
color: #c62828;
}
.warning {
background: #fff3e0;
border-left-color: #ff9800;
color: #e65100;
}
.success-box {
margin-top: 20px;
padding: 20px;
background: #e8f5e9;
border-radius: 8px;
border-left: 4px solid #4caf50;
}
.loading {
text-align: center;
padding: 40px;
color: #999;
}
/* Responsive */
@media (max-width: 600px) {
.app-header {
flex-direction: column;
gap: 10px;
text-align: center;
}
.app-header nav {
flex-wrap: wrap;
justify-content: center;
}
.relay-item {
flex-wrap: wrap;
}
.relay-item label {
font-size: 12px;
}
}
/* Connection status */
.connection-status {
margin: 16px 0;
}
.connection-status .warning {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}
.connection-status .warning .btn-nostr {
flex-shrink: 0;
}
/* Info box for connection status */
.info-box {
background: #e3f2fd;
border-left: 4px solid #2196f3;
color: #0d47a1;
padding: 12px 16px;
border-radius: var(--radius);
}
.info-box code {
background: rgba(0,0,0,0.08);
padding: 2px 8px;
border-radius: 4px;
font-size: 13px;
}
/* Community Templates */
.active-template {
background: #f0ebff !important;
border-color: #7c4dff !important;
color: #7c4dff !important;
}
.active-template:hover {
background: #e8e0ff !important;
}

View file

@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { HashRouter, Routes, Route, Link } from 'react-router-dom'; import { HashRouter, Routes, Route, Link } from 'react-router-dom';
import TemplateCreator from './components/TemplateCreator'; import TemplateCreator from './components/TemplateCreator';
import TemplateApplier from './components/TemplateApplier'; import TemplateApplier from './components/TemplateApplier';
import './App.css'; // Remove this line: import './App.css';
function App() { function App() {
const [connectedPubkey, setConnectedPubkey] = useState(null); const [connectedPubkey, setConnectedPubkey] = useState(null);

View file

@ -6,16 +6,16 @@ const TemplateCreator = () => {
const [templateName, setTemplateName] = useState(''); const [templateName, setTemplateName] = useState('');
const [description, setDescription] = useState(''); const [description, setDescription] = useState('');
const [relays, setRelays] = useState([ const [relays, setRelays] = useState([
{ url: 'wss://your-cool.relay', read: true, write: true } { url: 'wss://your.relay', read: true, write: true }
]); ]);
const [blossomServers, setBlossomServers] = useState([ const [blossomServers, setBlossomServers] = useState([
{ url: 'https://your-blossom.server' } { url: 'https://your.blossom' }
]); ]);
const [showBlossom, setShowBlossom] = useState(true); const [showBlossom, setShowBlossom] = useState(true);
const [dmRelays, setDmRelays] = useState([ const [dmRelays, setDmRelays] = useState([
{ url: 'wss://your-dm.relay' } { url: 'wss://dm.relay' }
]); ]);
const [showDmRelays, setShowDmRelays] = useState(true); const [showDmRelays, setShowDmRelays] = useState(true);
@ -128,37 +128,25 @@ const TemplateCreator = () => {
<div className="template-creator"> <div className="template-creator">
<h2>Create Relay Template</h2> <h2>Create Relay Template</h2>
<div className="form-group" style={{ {/* ✅ MOVED INLINE STYLES TO CSS CLASS */}
background: '#f8f9fa', <div className="community-templates-section">
padding: '16px',
borderRadius: '8px',
border: '1px solid #e9ecef',
marginBottom: '24px'
}}>
<label style={{ display: 'flex', alignItems: 'center', gap: '8px' }}> <label style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<span style={{ fontSize: '18px' }}>📚</span> <span style={{ fontSize: '18px' }}>📚</span>
Community Templates Community Templates
</label> </label>
<p style={{ fontSize: '13px', color: '#666', marginBottom: '10px' }}> <p className="community-templates-description">
Load a pre-configured template from popular communities Load a pre-configured template from popular communities
</p> </p>
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}> <div className="community-templates-buttons">
{Object.entries(communityTemplates).map(([key, template]) => ( {Object.entries(communityTemplates).map(([key, template]) => (
<button <button
key={key} key={key}
onClick={() => loadCommunityTemplate(key)} onClick={() => loadCommunityTemplate(key)}
className={`btn-secondary ${selectedTemplate === key ? 'active-template' : ''}`} className={`btn-secondary community-template-btn ${selectedTemplate === key ? 'active-template' : ''}`}
style={{
padding: '8px 16px',
border: selectedTemplate === key ? '2px solid #7c4dff' : '1px solid #ddd',
background: selectedTemplate === key ? '#f0ebff' : 'white',
fontWeight: selectedTemplate === key ? '600' : 'normal',
transition: 'all 0.2s'
}}
> >
{template.name} {template.name}
<span style={{ fontSize: '11px', color: '#999', marginLeft: '4px' }}> <span className="relay-count">
({template.relays.length} relays) ({template.relays.length} relays)
</span> </span>
</button> </button>
@ -166,15 +154,7 @@ const TemplateCreator = () => {
</div> </div>
{selectedTemplate && ( {selectedTemplate && (
<div style={{ <div className="community-template-info">
marginTop: '10px',
fontSize: '13px',
color: '#666',
padding: '8px 12px',
background: 'white',
borderRadius: '4px',
border: '1px solid #e9ecef'
}}>
💡 <strong>{communityTemplates[selectedTemplate].name}:</strong> {communityTemplates[selectedTemplate].description} 💡 <strong>{communityTemplates[selectedTemplate].name}:</strong> {communityTemplates[selectedTemplate].description}
</div> </div>
)} )}
@ -194,8 +174,7 @@ const TemplateCreator = () => {
setShowBlossom(true); setShowBlossom(true);
setShowDmRelays(true); setShowDmRelays(true);
}} }}
className="btn-secondary" className="btn-secondary clear-template-btn"
style={{ marginTop: '8px', fontSize: '12px' }}
> >
Clear Template Clear Template
</button> </button>
@ -230,35 +209,31 @@ const TemplateCreator = () => {
onRemove={removeRelay} onRemove={removeRelay}
/> />
<div style={{ marginTop: '10px', display: 'flex', gap: '8px', flexWrap: 'wrap' }}> <div className="common-relay-buttons">
<button onClick={addRelay} className="btn-secondary"> <button onClick={addRelay} className="btn-secondary">
+ Add Custom Relay + Add Custom Relay
</button> </button>
<button <button
onClick={() => addCommonRelay('wss://relay.primal.net')} onClick={() => addCommonRelay('wss://relay.primal.net')}
className="btn-secondary" className="btn-secondary common-relay-btn"
style={{ fontSize: '12px' }}
> >
+ Primal + Primal
</button> </button>
<button <button
onClick={() => addCommonRelay('wss://relay.damus.io')} onClick={() => addCommonRelay('wss://relay.damus.io')}
className="btn-secondary" className="btn-secondary common-relay-btn"
style={{ fontSize: '12px' }}
> >
+ Damus + Damus
</button> </button>
<button <button
onClick={() => addCommonRelay('wss://nos.lol')} onClick={() => addCommonRelay('wss://nos.lol')}
className="btn-secondary" className="btn-secondary common-relay-btn"
style={{ fontSize: '12px' }}
> >
+ Nos.lol + Nos.lol
</button> </button>
<button <button
onClick={() => addCommonRelay('wss://relay.snort.social')} onClick={() => addCommonRelay('wss://relay.snort.social')}
className="btn-secondary" className="btn-secondary common-relay-btn"
style={{ fontSize: '12px' }}
> >
+ Snort + Snort
</button> </button>
@ -270,8 +245,7 @@ const TemplateCreator = () => {
<label style={{ marginBottom: 0 }}>🌺 Blossom Servers (kind 10063)</label> <label style={{ marginBottom: 0 }}>🌺 Blossom Servers (kind 10063)</label>
<button <button
onClick={() => setShowBlossom(!showBlossom)} onClick={() => setShowBlossom(!showBlossom)}
className="btn-secondary" className="btn-secondary toggle-btn"
style={{ fontSize: '12px', padding: '4px 10px' }}
> >
{showBlossom ? 'Hide' : 'Show'} {showBlossom ? 'Hide' : 'Show'}
</button> </button>
@ -279,7 +253,7 @@ const TemplateCreator = () => {
{showBlossom && ( {showBlossom && (
<> <>
<p style={{ fontSize: '13px', color: '#666', marginBottom: '10px' }}> <p className="helper-text">
Servers used to host your blobs/images. Order determines trust/reliability. Servers used to host your blobs/images. Order determines trust/reliability.
</p> </p>
{blossomServers.map((server, index) => ( {blossomServers.map((server, index) => (
@ -301,7 +275,7 @@ const TemplateCreator = () => {
</button> </button>
</div> </div>
))} ))}
<button onClick={addBlossomServer} className="btn-secondary" style={{ marginTop: '4px' }}> <button onClick={addBlossomServer} className="btn-secondary add-btn">
+ Add Blossom Server + Add Blossom Server
</button> </button>
</> </>
@ -313,8 +287,7 @@ const TemplateCreator = () => {
<label style={{ marginBottom: 0 }}>💬 DM Relays (kind 10050)</label> <label style={{ marginBottom: 0 }}>💬 DM Relays (kind 10050)</label>
<button <button
onClick={() => setShowDmRelays(!showDmRelays)} onClick={() => setShowDmRelays(!showDmRelays)}
className="btn-secondary" className="btn-secondary toggle-btn"
style={{ fontSize: '12px', padding: '4px 10px' }}
> >
{showDmRelays ? 'Hide' : 'Show'} {showDmRelays ? 'Hide' : 'Show'}
</button> </button>
@ -322,7 +295,7 @@ const TemplateCreator = () => {
{showDmRelays && ( {showDmRelays && (
<> <>
<p style={{ fontSize: '13px', color: '#666', marginBottom: '10px' }}> <p className="helper-text">
Relays used for private messages. Relays used for private messages.
</p> </p>
{dmRelays.map((relay, index) => ( {dmRelays.map((relay, index) => (
@ -344,7 +317,7 @@ const TemplateCreator = () => {
</button> </button>
</div> </div>
))} ))}
<button onClick={addDmRelay} className="btn-secondary" style={{ marginTop: '4px' }}> <button onClick={addDmRelay} className="btn-secondary add-btn">
+ Add DM Relay + Add DM Relay
</button> </button>
</> </>
@ -366,11 +339,11 @@ const TemplateCreator = () => {
<h3> Template Created!</h3> <h3> Template Created!</h3>
<p>Share this link with your community:</p> <p>Share this link with your community:</p>
<input type="text" value={shareUrl} readOnly /> <input type="text" value={shareUrl} readOnly />
<button onClick={() => navigator.clipboard?.writeText(shareUrl)}> <button onClick={() => navigator.clipboard?.writeText(shareUrl)} className="btn-success">
Copy Link Copy Link
</button> </button>
<p style={{ fontSize: '12px', color: '#666', marginTop: '8px' }}> <p className="helper-text" style={{ marginTop: '8px' }}>
🔒 Template will be published to blast relays (configured in code) 💡 Send this link to a friend. When they visit that page, they can apply these settings and blast them to many relays, so other npubs can find them
</p> </p>
</div> </div>
)} )}

View file

@ -1,4 +1,6 @@
/* Reset and base styles */ /* ============================================
* RESET & BASE STYLES
* ============================================ */
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -8,17 +10,27 @@
:root { :root {
--primary: #7c4dff; --primary: #7c4dff;
--primary-dark: #6c3fdb; --primary-dark: #6c3fdb;
--primary-light: #f0ebff;
--secondary: #e0e0e0; --secondary: #e0e0e0;
--success: #4caf50; --success: #4caf50;
--success-light: #e8f5e9;
--danger: #ff5252; --danger: #ff5252;
--warning: #ff9800; --warning: #ff9800;
--warning-light: #fff3e0;
--info: #2196f3;
--info-light: #e3f2fd;
--nostr: #ff6b00;
--nostr-dark: #e85a00;
--text: #333; --text: #333;
--text-light: #666; --text-light: #666;
--text-muted: #999;
--background: #f5f5f5; --background: #f5f5f5;
--white: #ffffff; --white: #ffffff;
--border: #e0e0e0; --border: #e0e0e0;
--border-light: #f0f0f0;
--shadow: 0 2px 4px rgba(0, 0, 0, 0.1); --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
--radius: 8px; --radius: 8px;
--radius-sm: 4px;
} }
body { body {
@ -28,7 +40,9 @@ body {
line-height: 1.6; line-height: 1.6;
} }
/* App Layout */ /* ============================================
* APP LAYOUT
* ============================================ */
.app { .app {
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
@ -38,7 +52,9 @@ body {
flex-direction: column; flex-direction: column;
} }
/* Header */ /* ============================================
* HEADER
* ============================================ */
.app-header { .app-header {
display: flex; display: flex;
align-items: center; align-items: center;
@ -76,7 +92,7 @@ body {
} }
.user-badge { .user-badge {
background: #e8f5e9; background: var(--success-light);
padding: 6px 14px; padding: 6px 14px;
border-radius: 20px; border-radius: 20px;
font-size: 14px; font-size: 14px;
@ -84,22 +100,38 @@ body {
font-family: monospace; font-family: monospace;
} }
/* Main content */ /* ============================================
* MAIN CONTENT
* ============================================ */
main { main {
flex: 1; flex: 1;
min-height: 400px;
} }
/* Footer */ /* ============================================
* FOOTER
* ============================================ */
footer { footer {
margin-top: 50px; margin-top: 50px;
padding-top: 20px; padding-top: 20px;
border-top: 1px solid var(--border); border-top: 1px solid var(--border);
text-align: center; text-align: center;
color: #999; color: var(--text-muted);
font-size: 14px; font-size: 14px;
} }
/* Form elements */ footer a {
color: inherit;
text-decoration: underline;
}
footer a:hover {
color: var(--primary);
}
/* ============================================
* FORM ELEMENTS
* ============================================ */
.form-group { .form-group {
margin-bottom: 24px; margin-bottom: 24px;
} }
@ -135,7 +167,9 @@ footer {
min-height: 60px; min-height: 60px;
} }
/* Buttons */ /* ============================================
* BUTTONS
* ============================================ */
.btn-primary { .btn-primary {
background: var(--primary); background: var(--primary);
color: white; color: white;
@ -184,7 +218,7 @@ footer {
color: white; color: white;
border: none; border: none;
padding: 4px 10px; padding: 4px 10px;
border-radius: 4px; border-radius: var(--radius-sm);
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
transition: background 0.2s; transition: background 0.2s;
@ -200,7 +234,7 @@ footer {
} }
.btn-nostr { .btn-nostr {
background: #ff6b00; background: var(--nostr);
color: white; color: white;
border: none; border: none;
padding: 10px 20px; padding: 10px 20px;
@ -211,7 +245,7 @@ footer {
} }
.btn-nostr:hover:not(:disabled) { .btn-nostr:hover:not(:disabled) {
background: #e85a00; background: var(--nostr-dark);
} }
.btn-success { .btn-success {
@ -229,7 +263,9 @@ footer {
background: #388e3c; background: #388e3c;
} }
/* Relay List */ /* ============================================
* RELAY LIST
* ============================================ */
.relay-list { .relay-list {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -254,7 +290,7 @@ footer {
flex: 1; flex: 1;
padding: 8px 10px; padding: 8px 10px;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 4px; border-radius: var(--radius-sm);
font-size: 13px; font-size: 13px;
font-family: monospace; font-family: monospace;
} }
@ -282,7 +318,9 @@ footer {
accent-color: var(--primary); accent-color: var(--primary);
} }
/* Template Creator */ /* ============================================
* TEMPLATE CREATOR
* ============================================ */
.template-creator { .template-creator {
background: var(--white); background: var(--white);
padding: 30px; padding: 30px;
@ -295,7 +333,9 @@ footer {
font-size: 22px; font-size: 22px;
} }
/* Template Applier */ /* ============================================
* TEMPLATE APPLIER
* ============================================ */
.template-applier { .template-applier {
background: var(--white); background: var(--white);
padding: 30px; padding: 30px;
@ -341,7 +381,7 @@ footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 8px 0; padding: 8px 0;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid var(--border-light);
} }
.relay-preview li:last-child { .relay-preview li:last-child {
@ -357,7 +397,20 @@ footer {
font-size: 16px; font-size: 16px;
} }
/* Status boxes */ /* ============================================
* AUTH SECTION
* ============================================ */
.auth-section {
padding: 20px;
background: #f8f9fa;
border-radius: var(--radius);
border: 1px solid #e9ecef;
margin-bottom: 16px;
}
/* ============================================
* STATUS BOXES
* ============================================ */
.error-box, .error-box,
.warning, .warning,
.success-box, .success-box,
@ -374,28 +427,37 @@ footer {
} }
.warning { .warning {
background: #fff3e0; background: var(--warning-light);
border-left: 4px solid var(--warning); border-left: 4px solid var(--warning);
color: #e65100; color: #e65100;
} }
.success-box { .success-box {
background: #e8f5e9; background: var(--success-light);
border-left: 4px solid var(--success); border-left: 4px solid var(--success);
color: #2e7d32; color: #2e7d32;
} }
.info-box { .info-box {
background: #e3f2fd; background: var(--info-light);
border-left: 4px solid #2196f3; border-left: 4px solid var(--info);
color: #0d47a1; color: #0d47a1;
} }
/* Share Box */ .info-box code {
background: rgba(0, 0, 0, 0.08);
padding: 2px 8px;
border-radius: var(--radius-sm);
font-size: 13px;
}
/* ============================================
* SHARE BOX
* ============================================ */
.share-box { .share-box {
margin-top: 24px; margin-top: 24px;
padding: 20px; padding: 20px;
background: #e8f5e9; background: var(--success-light);
border-radius: var(--radius); border-radius: var(--radius);
border-left: 4px solid var(--success); border-left: 4px solid var(--success);
} }
@ -415,7 +477,7 @@ footer {
padding: 10px; padding: 10px;
margin: 8px 0; margin: 8px 0;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 4px; border-radius: var(--radius-sm);
font-size: 13px; font-size: 13px;
font-family: monospace; font-family: monospace;
background: var(--white); background: var(--white);
@ -425,12 +487,14 @@ footer {
width: auto; width: auto;
} }
/* Nostr Connect */ /* ============================================
* NOSTR CONNECT
* ============================================ */
.nostr-connected { .nostr-connected {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
background: #e8f5e9; background: var(--success-light);
padding: 8px 16px; padding: 8px 16px;
border-radius: 20px; border-radius: 20px;
font-size: 14px; font-size: 14px;
@ -438,7 +502,116 @@ footer {
font-family: monospace; font-family: monospace;
} }
/* Loading */ .connection-status {
margin: 16px 0;
}
.connection-status .warning {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}
.connection-status .warning .btn-nostr {
flex-shrink: 0;
}
/* ============================================
* COMMUNITY TEMPLATES
* ============================================ */
.community-templates-section {
background: #f8f9fa;
padding: 16px;
border-radius: var(--radius);
border: 1px solid #e9ecef;
margin-bottom: 24px;
}
.community-templates-description {
font-size: 13px;
color: var(--text-light);
margin-bottom: 10px;
}
.community-templates-buttons {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.community-template-btn {
padding: 8px 16px;
border: 1px solid var(--border);
background: var(--white);
font-weight: normal;
transition: all 0.2s;
}
.community-template-btn .relay-count {
font-size: 11px;
color: var(--text-muted);
margin-left: 4px;
}
.community-template-info {
margin-top: 10px;
font-size: 13px;
color: var(--text-light);
padding: 8px 12px;
background: var(--white);
border-radius: var(--radius-sm);
border: 1px solid var(--border);
}
.clear-template-btn {
margin-top: 8px;
font-size: 12px;
}
/* Common relay buttons */
.common-relay-buttons {
margin-top: 10px;
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.common-relay-btn {
font-size: 12px;
}
/* Toggle and add buttons */
.toggle-btn {
font-size: 12px;
padding: 4px 10px;
}
.add-btn {
margin-top: 4px;
}
.helper-text {
font-size: 13px;
color: var(--text-light);
margin-bottom: 10px;
}
/* Active template state */
.active-template {
background: var(--primary-light) !important;
border-color: var(--primary) !important;
color: var(--primary) !important;
}
.active-template:hover {
background: #e8e0ff !important;
}
/* ============================================
* LOADING
* ============================================ */
.loading { .loading {
text-align: center; text-align: center;
padding: 40px; padding: 40px;
@ -446,18 +619,65 @@ footer {
} }
.loading::after { .loading::after {
content: '...'; content: '';
animation: dots 1.5s steps(4, end) infinite; display: inline-block;
width: 24px;
height: 24px;
margin-left: 8px;
border: 2px solid var(--border);
border-top-color: var(--primary);
border-radius: 50%;
animation: spin 0.8s linear infinite;
} }
@keyframes dots { @keyframes spin {
0% { content: ''; } to { transform: rotate(360deg); }
25% { content: '.'; }
50% { content: '..'; }
75% { content: '...'; }
} }
/* Responsive Design */ /* ============================================
* UTILITY CLASSES
* ============================================ */
.text-center {
text-align: center;
}
.mt-10 {
margin-top: 10px;
}
.mt-20 {
margin-top: 20px;
}
.mb-10 {
margin-bottom: 10px;
}
.mb-20 {
margin-bottom: 20px;
}
.flex {
display: flex;
}
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.gap-10 {
gap: 10px;
}
.gap-20 {
gap: 20px;
}
/* ============================================
* RESPONSIVE DESIGN
* ============================================ */
@media (max-width: 768px) { @media (max-width: 768px) {
.app { .app {
padding: 12px; padding: 12px;
@ -507,6 +727,37 @@ footer {
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
} }
.connection-status .warning {
flex-direction: column;
align-items: stretch;
}
.connection-status .warning .btn-nostr {
width: 100%;
}
.community-templates-section {
padding: 12px;
}
.community-templates-buttons {
gap: 6px;
}
.community-template-btn {
font-size: 13px;
padding: 6px 12px;
}
.common-relay-buttons {
gap: 6px;
}
.common-relay-btn {
font-size: 11px;
padding: 6px 10px;
}
} }
@media (max-width: 480px) { @media (max-width: 480px) {
@ -527,43 +778,263 @@ footer {
.share-box input { .share-box input {
font-size: 12px; font-size: 12px;
} }
.community-template-btn {
font-size: 12px;
padding: 4px 10px;
} }
/* Utility classes */ .community-template-btn .relay-count {
.text-center { font-size: 10px;
text-align: center; }
} }
.mt-10 { /* ============================================
margin-top: 10px; * DARK MODE SUPPORT
* ============================================ */
@media (prefers-color-scheme: dark) {
:root {
--text: #e0e0e0;
--text-light: #aaa;
--background: #1a1a1a;
--white: #2d2d2d;
--border: #444;
--border-light: #3a3a3a;
--shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
--secondary: #444;
} }
.mt-20 { body {
margin-top: 20px; background: var(--background);
color: var(--text);
} }
.mb-10 { .template-creator,
margin-bottom: 10px; .template-applier {
background: var(--white);
} }
.mb-20 { .template-preview {
margin-bottom: 20px; background: #252525;
} }
.flex { .auth-section {
display: flex; background: #252525;
border-color: #333;
} }
.flex-center { .relay-item {
display: flex; background: #252525;
align-items: center;
justify-content: center;
} }
.gap-10 { .relay-item:hover {
gap: 10px; border-color: #666;
} }
.gap-20 { /* Form elements */
gap: 20px; .form-group input,
.form-group textarea {
background: #252525;
color: var(--text);
border-color: var(--border);
}
.form-group input:focus,
.form-group textarea:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
}
.form-group label {
color: var(--text-light);
}
/* Share box */
.share-box input {
background: #252525;
color: var(--text);
border-color: var(--border);
}
.share-box {
background: #1a2a1a;
}
.share-box h3 {
color: #81c784;
}
.share-box p {
color: #a5d6a7;
}
/* Buttons */
.btn-secondary {
background: #444;
color: var(--text);
}
.btn-secondary:hover {
background: #555;
}
/* Status boxes */
.info-box {
background: #1a2a3a;
color: #90caf9;
}
.success-box {
background: #1a2a1a;
color: #81c784;
}
.error-box {
background: #2a1a1a;
color: #ef9a9a;
}
.warning {
background: #2a1a0a;
color: #ffcc80;
}
/* User badge */
.user-badge {
background: #1a2a1a;
color: #81c784;
}
/* Nostr connected */
.nostr-connected {
background: #1a2a1a;
color: #81c784;
}
/* Connection status */
.connection-status .info-box {
background: #1a2a3a;
color: #90caf9;
border-color: #2196f3;
}
.connection-status .info-box code {
background: rgba(255, 255, 255, 0.1);
color: #90caf9;
}
/* Header */
.app-header {
border-bottom-color: var(--border);
}
.app-header nav a {
color: var(--text-light);
}
.app-header nav a:hover {
color: var(--primary);
}
/* Footer */
footer {
border-top-color: var(--border);
color: var(--text-muted);
}
/* Share box button */
.share-box .btn-success {
background: var(--success);
}
.share-box .btn-success:hover {
background: #388e3c;
}
/* Auth section text */
.auth-section h4 {
color: var(--text);
}
.auth-section p {
color: var(--text-light);
}
/* Relay preview */
.relay-preview li {
border-bottom-color: var(--border-light);
}
.relay-preview h4 {
color: var(--text-light);
}
.template-preview > p {
color: var(--text-light);
}
.template-preview h3 {
color: var(--text);
}
/* Error text in share box */
.share-box .error {
color: var(--danger);
}
/* ============================================
* DARK MODE - COMMUNITY TEMPLATES
* ============================================ */
.community-templates-section {
background: #252525;
border-color: #333;
}
.community-templates-description {
color: var(--text-light);
}
.community-template-btn {
background: #2d2d2d;
border-color: var(--border);
color: var(--text);
}
.community-template-btn:hover {
background: #3a3a3a;
}
.community-template-btn .relay-count {
color: var(--text-muted);
}
.community-template-info {
background: #1a1a1a;
border-color: #333;
color: var(--text-light);
}
.common-relay-buttons .btn-secondary {
background: #2d2d2d;
color: var(--text);
border-color: var(--border);
}
.common-relay-buttons .btn-secondary:hover {
background: #3a3a3a;
}
.helper-text {
color: var(--text-light);
}
.active-template {
background: var(--primary-light) !important;
border-color: var(--primary) !important;
color: var(--primary) !important;
}
.active-template:hover {
background: #2a1a4a !important;
}
} }