-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.html
154 lines (135 loc) · 3.79 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html>
<head>
<title>Modern Popup</title>
<style>
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
'Helvetica Neue', sans-serif;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
--background-color: #fff; /* Default light background color */
--text-color: #333; /* Default text color */
/* Dark mode */
@media (prefers-color-scheme: dark) {
--background-color: #333;
--text-color: #fff;
}
background-color: var(--background-color);
color: var(--text-color);
transition: color 0.3s, background-color 0.3s;
}
.popup {
position: relative;
width: 300px;
padding: 20px;
border-radius: 12px; /* Rounded corners */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
background-color: #fff;
color: #333;
}
.button {
display: inline-block;
padding: 8px 16px;
margin-top: 20px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #fff;
text-decoration: none;
font-size: 14px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #0056b3;
}
.top-nav {
margin-bottom: 16px;
}
.icon-container {
position: absolute;
top: 8px;
right: 8px;
display: flex;
gap: 10px;
align-items: center;
}
.close-icon,
.configure-icon {
width: 16px;
height: 16px;
cursor: pointer;
}
.logo {
position: absolute;
top: 8px;
left: 8px;
width: 40px;
height: 40px;
cursor: pointer;
}
/* Settings screen */
.settings-screen {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.back-button {
position: absolute;
top: 8px;
left: 8px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="popup">
<div class="top-nav">
<img src="images/icon-48.png" alt="Logo" class="logo">
<div class="icon-container">
<img src="images/settings.png" alt="Configure" class="configure-icon">
<img src="images/close.png" alt="Close" class="close-icon">
</div>
</div>
<div class="settings-screen">
<img src="images/back.png" alt="Back" class="back-button">
<!-- Other settings content here -->
</div>
<h2>Ad Blocking Extension</h2>
<p>Replace or block unwanted advertisements!</p>
<p>Enhance your browsing experience with fewer distractions.</p>
<p>Customize your ad preferences easily.</p>
<a href="#" class="button">Settings</a>
<a href="#" class="button">Subscribe</a>
</div>
<script>
// Detect system's color scheme and set the popup's theme accordingly
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark-theme');
}
const closeBtn = document.querySelector('.close-icon');
const configureBtn = document.querySelector('.configure-icon');
const settingsScreen = document.querySelector('.settings-screen');
const backBtn = document.querySelector('.back-button');
closeBtn.addEventListener('click', () => {
document.querySelector('.popup').style.display = 'none';
});
configureBtn.addEventListener('click', () => {
document.querySelector('.popup').style.display = 'none';
settingsScreen.style.display = 'block';
});
backBtn.addEventListener('click', () => {
settingsScreen.style.display = 'none';
document.querySelector('.popup').style.display = 'block';
});
</script>
</body>
</html>