-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
169 lines (164 loc) · 3.56 KB
/
popup.html
File metadata and controls
169 lines (164 loc) · 3.56 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
<!DOCTYPE html>
<html>
<head>
<title>Font Changer</title>
<style>
body {
width: 300px;
padding: 15px;
font-family: system-ui, -apple-system, sans-serif;
}
.container {
display: flex;
flex-direction: column;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 5px;
}
label {
font-weight: 500;
}
input[type="text"] {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
}
.toggle {
display: flex;
align-items: center;
gap: 10px;
}
.switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #2196F3;
}
input:checked + .slider:before {
transform: translateX(26px);
}
.status {
font-size: 12px;
color: #666;
}
.file-upload {
border: 2px dashed #ccc;
border-radius: 4px;
padding: 10px;
text-align: center;
cursor: pointer;
margin-top: 10px;
}
.file-upload:hover {
border-color: #2196F3;
}
.preview {
margin-top: 10px;
padding: 10px;
border: 1px solid #eee;
border-radius: 4px;
min-height: 50px;
transform-origin: left top;
}
.font-name {
font-size: 12px;
color: #666;
margin-top: 5px;
}
#fileInput {
display: none;
}
.or-divider {
text-align: center;
margin: 10px 0;
color: #666;
font-size: 12px;
}
.size-control {
display: flex;
align-items: center;
gap: 10px;
margin-top: 10px;
}
.size-control input[type="range"] {
flex: 1;
}
.size-value {
min-width: 40px;
text-align: right;
font-size: 14px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<div class="form-group">
<label>Upload Custom Font:</label>
<div class="file-upload" id="dropZone">
<input type="file" id="fileInput" accept=".ttf,.otf,.woff,.woff2">
<div>Click to upload or drag & drop</div>
<div class="font-name" id="fontFileName"></div>
</div>
</div>
<div class="or-divider">OR</div>
<div class="form-group">
<label for="fontInput">Use System Font:</label>
<input type="text" id="fontInput" placeholder="Enter font name (e.g., Georgia)">
</div>
<div class="form-group">
<label>Text Scale:</label>
<div class="size-control">
<input type="range" id="fontSize" min="8" max="32" value="16" step="1">
<span class="size-value" id="fontSizeValue">100%</span>
</div>
</div>
<div class="preview" id="preview">
Preview Text
</div>
<div class="toggle">
<label class="switch">
<input type="checkbox" id="fontToggle">
<span class="slider"></span>
</label>
<span>Enable Font Change</span>
</div>
<div class="status" id="status"></div>
</div>
<script src="popup.js"></script>
</body>
</html>