Skip to content

Commit f6fd204

Browse files
committed
extension: Add per-site configuration settings modal
1 parent 6fe83ab commit f6fd204

File tree

2 files changed

+711
-7
lines changed

2 files changed

+711
-7
lines changed

web/packages/extension/assets/css/options.css

Lines changed: 217 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,225 @@
1212
padding: 24px 32px;
1313
}
1414

15-
#advanced-options {
16-
color: var(--ruffle-orange);
17-
font-size: 28px;
18-
margin: 8px auto 0;
15+
hr {
16+
border: none;
17+
height: 1px;
18+
background-color: #546da3;
19+
margin: 20px 0;
20+
width: 100%;
1921
}
2022

2123
#reset-settings {
2224
margin: 0 auto;
2325
}
26+
27+
.option-title {
28+
border-bottom: 2px solid var(--ruffle-light-blue);
29+
padding-bottom: 8px;
30+
margin-block-end: 0;
31+
font-size: 1.2em;
32+
color: var(--ruffle-orange);
33+
}
34+
35+
.option-description {
36+
opacity: 0.8;
37+
margin-block-start: 0.2em;
38+
margin-block-end: 0.2em;
39+
}
40+
41+
42+
/* Per-site settings */
43+
44+
#per-site-list {
45+
display: flex;
46+
flex-direction: column;
47+
gap: 8px;
48+
}
49+
50+
.per-site-entry {
51+
display: flex;
52+
justify-content: space-between;
53+
align-items: center;
54+
padding: 10px;
55+
border-radius: 8px;
56+
background: var(--ruffle-dark-blue);
57+
}
58+
59+
.per-site-entry .site-domain {
60+
font-weight: bold;
61+
}
62+
63+
#site-entry-new {
64+
align-self: flex-start;
65+
}
66+
67+
/* Modal */
68+
69+
.modal-open {
70+
overflow: hidden;
71+
}
72+
73+
.modal-overlay {
74+
position: fixed;
75+
top: 0;
76+
left: 0;
77+
width: 100%;
78+
height: 100%;
79+
background: rgba(0, 0, 0, 0.7);
80+
display: none;
81+
justify-content: center;
82+
align-items: center;
83+
z-index: 1000;
84+
}
85+
86+
.modal-content {
87+
background: var(--ruffle-blue);
88+
border: 2px solid var(--ruffle-light-blue);
89+
padding: 25px;
90+
border-radius: 8px;
91+
width: 90%;
92+
max-width: 800px;
93+
max-height: 90vh;
94+
overflow-y: auto;
95+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
96+
}
97+
98+
.modal-header {
99+
display: flex;
100+
justify-content: space-between;
101+
align-items: center;
102+
}
103+
104+
.modal-header h3 {
105+
margin: 0;
106+
color: var(--ruffle-orange);
107+
}
108+
109+
.modal-close-btn {
110+
font-size: 1.5rem;
111+
cursor: pointer;
112+
border: none;
113+
background: none;
114+
color: #aaa;
115+
}
116+
117+
.modal-body {
118+
margin-top: 20px;
119+
}
120+
121+
.modal-footer {
122+
margin-top: 25px;
123+
display: flex;
124+
gap: 10px;
125+
justify-content: flex-end;
126+
}
127+
128+
129+
130+
/* Modal Scrollbar */
131+
132+
:root {
133+
--scrollbar-width: 8px;
134+
--scrollbar-track: rgba(255, 255, 255, 0.1);
135+
--scrollbar-thumb: rgba(255, 255, 255, 0.3);
136+
--scrollbar-thumb-hover: rgba(255, 255, 255, 0.5);
137+
--scrollbar-border-radius: 4px;
138+
}
139+
140+
/* Firefox */
141+
.modal-content {
142+
scrollbar-width: thin;
143+
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
144+
}
145+
146+
/* Webkit browsers (Chrome, Safari, Edge) */
147+
.modal-content::-webkit-scrollbar {
148+
width: var(--scrollbar-width);
149+
height: var(--scrollbar-width);
150+
}
151+
152+
.modal-content::-webkit-scrollbar-track {
153+
background: var(--scrollbar-track);
154+
border-radius: var(--scrollbar-border-radius);
155+
}
156+
157+
.modal-content::-webkit-scrollbar-thumb {
158+
background: var(--scrollbar-thumb);
159+
border-radius: var(--scrollbar-border-radius);
160+
transition: background-color 0.2s ease;
161+
}
162+
163+
.modal-content::-webkit-scrollbar-thumb:hover {
164+
background: var(--scrollbar-thumb-hover);
165+
}
166+
167+
.modal-content::-webkit-scrollbar-corner {
168+
background: var(--scrollbar-track);
169+
}
170+
171+
.modal-content::-webkit-scrollbar-button {
172+
display: none;
173+
}
174+
175+
/* Sections */
176+
177+
.settings-section > * {
178+
margin-bottom: 20px;
179+
padding-bottom: 15px;
180+
border-bottom: 2px solid var(--ruffle-light-blue);
181+
}
182+
183+
.settings-section > :last-child {
184+
margin-bottom: 0;
185+
padding-bottom: 0;
186+
border-bottom: none;
187+
}
188+
189+
.settings-section-title {
190+
font-size: 1.1em;
191+
font-weight: bold;
192+
color: var(--ruffle-orange);
193+
margin-bottom: 10px;
194+
}
195+
196+
/* Per-site override options */
197+
198+
.settings-option {
199+
display: grid;
200+
grid-template-columns: 40px 1fr;
201+
align-items: start;
202+
gap: 15px;
203+
padding: 12px 0;
204+
border-bottom: 1px solid var(--ruffle-light-blue);
205+
}
206+
207+
.settings-option-toggle {
208+
margin: auto 0;
209+
}
210+
211+
.settings-option:last-child {
212+
border-bottom: none;
213+
}
214+
215+
.settings-option .settings-option-control.settings-option-disabled {
216+
pointer-events: none;
217+
opacity: 0.5;
218+
}
219+
220+
/* Per-site override option label and description */
221+
222+
.settings-option-control {
223+
display: flex;
224+
flex-direction: column;
225+
gap: 5px;
226+
}
227+
228+
.settings-option-control label {
229+
font-weight: bold;
230+
}
231+
232+
.settings-option-control small {
233+
font-size: 0.8em;
234+
color: #ccc;
235+
opacity: 0.8;
236+
}

0 commit comments

Comments
 (0)