-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathindex.html
More file actions
184 lines (162 loc) · 4.12 KB
/
index.html
File metadata and controls
184 lines (162 loc) · 4.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub & BitBucket HTML Preview</title>
<!--
FIX 1: Favicon 404
Embedded SVG data URI prevents the browser from requesting /favicon.ico
-->
<style>
/*
Humane Dark Theme
No neon, no gradients. Clean, flat, professional.
*/
:root {
--bg-body: #0d1117;
--bg-card: #161b22;
--border-color: #30363d;
--text-primary: #c9d1d9;
--text-secondary: #8b949e;
--accent-color: #58a6ff;
--input-bg: #0d1117;
--code-bg: #21262d;
--btn-primary: #238636;
--btn-hover: #2ea043;
--font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
body {
font-family: var(--font-stack);
background-color: var(--bg-body);
color: var(--text-primary);
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
line-height: 1.5;
}
.container {
width: 100%;
max-width: 680px;
padding: 20px;
box-sizing: border-box;
}
#previewform {
background-color: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 40px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
text-align: center;
display: none; /* JS will toggle this */
}
h1 {
font-size: 24px;
font-weight: 600;
margin-top: 0;
margin-bottom: 10px;
}
p {
color: var(--text-secondary);
font-size: 14px;
margin-bottom: 20px;
}
.input-group {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
input[type="url"] {
flex-grow: 1;
background-color: var(--input-bg);
border: 1px solid var(--border-color);
color: var(--text-primary);
padding: 10px 12px;
border-radius: 6px;
font-size: 14px;
outline: none;
transition: border-color 0.2s ease;
}
input[type="url"]:focus {
border-color: var(--accent-color);
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}
input[type="submit"] {
background-color: var(--btn-primary);
color: #ffffff;
border: 1px solid rgba(240,246,252,0.1);
padding: 10px 20px;
border-radius: 6px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
}
input[type="submit"]:hover {
background-color: var(--btn-hover);
}
.instruction-box {
background-color: var(--code-bg);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 15px;
text-align: left;
font-size: 13px;
color: var(--text-secondary);
}
.instruction-box strong {
color: var(--accent-color);
font-weight: 600;
background: transparent;
padding: 0;
}
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
word-break: break-all;
}
#footer {
margin-top: 30px;
font-size: 12px;
color: var(--text-secondary);
}
#footer a {
color: var(--accent-color);
text-decoration: none;
}
#footer a:hover {
text-decoration: underline;
}
@media (max-width: 600px) {
.input-group {
flex-direction: column;
}
#previewform {
padding: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<form id="previewform" onsubmit="location.href='/?'+this.file.value;return false">
<h1>HTML Preview</h1>
<p>View raw HTML files from GitHub or BitBucket directly in your browser.</p>
<div class="input-group">
<input type="url" id="file" value="" placeholder="https://github.com/user/repo/blob/main/index.html" autofocus>
<input type="submit" value="Preview File">
</div>
<div class="instruction-box">
<p style="margin:0 0 5px 0; font-size:11px; text-transform:uppercase; letter-spacing:1px;">Manual Usage</p>
<code><strong>https://htmlpreview.github.io/?</strong>https://github.com/twbs/bootstrap/blob/gh-pages/index.html</code>
</div>
<div id="footer">
Developed by <a href="https://github.com/niutech">niu tech</a> | Contribute on <a href="https://github.com/htmlpreview/htmlpreview.github.com">GitHub</a>
</div>
</form>
</div>
<script src="htmlpreview.js"></script>
</body>
</html>