-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.html
130 lines (117 loc) · 3.16 KB
/
popup.html
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
<!DOCTYPE html>
<html>
<head>
<style>
:root {
--bg-color: #ffffff;
--text-color: #000000;
--button-bg-color: #e0e0e0;
--button-text-color: #000000;
--border-color: #cccccc;
--icon-color: #ffffff; /* This should match the color of the cog icon */
}
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #1e1e1e;
--text-color: #ffffff;
--button-bg-color: #333333;
--button-text-color: #ffffff;
--border-color: #444444;
--icon-color: #ffffff; /* This should match the color of the cog icon in dark mode */
}
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
width: 240px;
background-color: var(--bg-color);
color: var(--text-color);
}
.container {
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
button {
flex: 1;
margin-right: 10px;
background-color: var(--button-bg-color);
color: var(--button-text-color);
border: 1px solid var(--border-color);
padding: 5px;
cursor: pointer;
}
button:hover {
opacity: 0.8;
}
.hidden {
display: none;
}
.settings, .open-url {
cursor: pointer;
display: flex;
align-items: center;
}
.open-url {
margin-right: 10px; /* Add a gap between the open URL icon and the cog */
}
.form-container {
padding: 10px;
}
.form-container label {
display: block;
margin-top: 10px;
}
.form-container input, .form-container textarea, .form-container select {
width: 100%;
padding: 5px;
margin-top: 5px;
background-color: var(--bg-color);
color: var(--text-color);
border: 1px solid var(--border-color);
box-sizing: border-box;
}
#status, #warning {
margin: 10px 0;
text-align: center;
}
.checkbox-container {
display: flex;
align-items: center;
white-space: nowrap; /* Prevent text from wrapping */
margin-top: 5px;
}
</style>
</head>
<body>
<div class="form-container">
<textarea id="message" rows="4"></textarea>
<select id="topic-select"></select>
</div>
<div class="container">
<button id="send">Send to ntfy</button>
<span class="open-url" title="Open ntfy URL">🔗</span>
<span class="settings" id="settings-icon" title="Settings">⚙</span>
</div>
<div id="warning" class="hidden">Please configure ntfy settings first.</div>
<div id="status"></div>
<div id="settings" class="hidden form-container">
<label for="url">ntfy URL:</label>
<input type="text" id="url">
<label for="token">Token (optional):</label>
<input type="password" id="token">
<label for="topics">Topics (comma separated):</label>
<input type="text" id="topics">
<div class="checkbox-container">
<label for="prefill">Enable Prefill with URL:</label>
<input type="checkbox" id="prefill">
</div>
<div style="margin-top: 10px;">
<button id="save">Save Configuration</button>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>