-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
217 lines (188 loc) · 4.92 KB
/
popup.html
File metadata and controls
217 lines (188 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MR Guard Settings</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
width: 340px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #1a1a2e;
color: #e2e8f0;
font-size: 13px;
}
header {
background: #7f1d1d;
padding: 14px 16px;
display: flex;
align-items: center;
gap: 10px;
border-bottom: 3px solid #ef4444;
}
header .logo { font-size: 1.4rem; }
header h1 {
font-size: 0.95rem;
font-weight: 700;
letter-spacing: 0.5px;
color: #fff;
}
header p {
font-size: 0.7rem;
color: #fca5a5;
margin-top: 1px;
}
main { padding: 14px 16px; display: flex; flex-direction: column; gap: 18px; }
.section-label {
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
color: #94a3b8;
margin-bottom: 6px;
}
/* Number input */
.number-row {
display: flex;
align-items: center;
gap: 10px;
}
.number-row input[type="number"] {
width: 70px;
padding: 6px 8px;
background: #0f172a;
border: 1px solid #334155;
border-radius: 6px;
color: #e2e8f0;
font-size: 0.9rem;
text-align: center;
outline: none;
}
.number-row input[type="number"]:focus { border-color: #ef4444; }
/* Tag input */
.tag-box {
background: #0f172a;
border: 1px solid #334155;
border-radius: 6px;
padding: 6px 8px;
display: flex;
flex-wrap: wrap;
gap: 5px;
min-height: 38px;
cursor: text;
transition: border-color 0.15s;
}
.tag-box:focus-within { border-color: #ef4444; }
.tag {
display: inline-flex;
align-items: center;
gap: 4px;
background: #7f1d1d;
color: #fca5a5;
border-radius: 4px;
padding: 2px 7px;
font-size: 0.75rem;
font-weight: 600;
}
.tag button {
background: none;
border: none;
color: #fca5a5;
cursor: pointer;
font-size: 0.85rem;
line-height: 1;
padding: 0 1px;
opacity: 0.7;
transition: opacity 0.1s;
}
.tag button:hover { opacity: 1; }
.tag-input {
border: none;
outline: none;
background: transparent;
color: #e2e8f0;
font-size: 0.8rem;
flex: 1;
min-width: 90px;
}
.tag-hint {
font-size: 0.67rem;
color: #64748b;
margin-top: 4px;
}
/* Save button */
.btn-save {
width: 100%;
padding: 9px;
background: #ef4444;
color: #fff;
border: none;
border-radius: 6px;
font-size: 0.85rem;
font-weight: 700;
cursor: pointer;
letter-spacing: 0.5px;
transition: background 0.15s;
}
.btn-save:hover { background: #dc2626; }
/* Toast */
#toast {
display: none;
background: #166534;
color: #bbf7d0;
border-radius: 6px;
padding: 8px 12px;
font-size: 0.78rem;
font-weight: 600;
text-align: center;
}
footer a {
padding: 10px 16px;
border-top: 1px solid #1e293b;
text-align: center;
font-size: 0.65rem;
color: #475569;
}
</style>
</head>
<body>
<header>
<div class="logo">🛡️</div>
<div>
<h1>MR Guard</h1>
<p>Configure merge protection rules</p>
</div>
</header>
<main>
<!-- Required Approvals -->
<div>
<div class="section-label">Required Approvals</div>
<div class="number-row">
<input type="number" id="required-approvals" min="1" max="99" value="1" />
<span id="approvals-label" style="color:#94a3b8; font-size:0.78rem;">approval before merge</span>
</div>
</div>
<!-- Critical Branches -->
<div>
<div class="section-label">Critical Branches</div>
<div class="tag-box" id="branches-box">
<input class="tag-input" id="branch-input" type="text" placeholder="Add branch…" />
</div>
<div class="tag-hint">Press Enter or comma to add</div>
</div>
<!-- Required Actions (checklist items) -->
<div>
<div class="section-label">Required Actions Checklist</div>
<div class="tag-box" id="actions-box">
<input class="tag-input" id="action-input" type="text" placeholder="Add action…" />
</div>
<div class="tag-hint">Press Enter or comma to add</div>
</div>
<div id="toast">✅ Settings saved!</div>
<button class="btn-save" id="save-btn">Save Settings</button>
</main>
<footer><a href="https://github.com/CodeWithEmad/gitlab-mr-approval-extension">GitLab MR Approval Guard</a></footer>
<script src="popup.js"></script>
</body>
</html>