-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
209 lines (207 loc) · 7.72 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8"/>
<meta name="author" content="frugbug"/>
<meta name="description" content="Where my stuff is"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta property="og:title" content="Seafile Custom CSS"/>
<meta property="og:description" content="By Laura"/>
<meta property="og:image" content="https://frugbug.github.io/seafile-custom-css/media/seafile-logo-large-square.png"/>
<meta property="og:image:type" content="image/png"/>
<meta property="og:image:height" content="384"/>
<meta property="og:image:width" content="384"/>
<meta content="#AA717C" data-react-helmet="true" name="theme-color"/>
<link rel="apple-touch-icon-precomposed" href="media/seafile-logo-large-square.png"/>
<title>Seafile Custom CSS</title>
<link rel="icon" href="media/favicon_pink.png" type="image/x-icon"/>
<style>
::selection {
color: rgb(64, 64, 64);
background: #D59CA7;
}
* {
scrollbar-color: rgb(48, 48, 48) rgb(24, 24, 24);
}
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: .9375rem;
font-weight: 400;
background-color: rgb(24, 24, 24);
color: rgb(192, 192, 192);
line-height: 1.5;
}
#page-wrapper {
background-color: rgb(32, 32, 32);
border-radius: 12px;
border: 1px solid rgb(64, 64, 64);
margin: 1em auto;
max-width: 1000px;
padding: 1.5em;
}
#seafile-logo {
display: block;
margin: 0 auto;
width: 256px;
aspect-ratio: 4 / 1;
}
h1 {
text-align: center;
}
h3 {
padding-bottom: 2px;
border-bottom: 1px solid rgb(48, 48, 48);
}
.code-block {
background-color: rgb(24, 24, 24);
padding: 8px;
border-radius: 8px;
border: 1px solid rgb(48, 48, 48);
width: auto;
}
code {
padding: 0 0.5em;
}
.code-block-buttons {
float: right;
padding: 4px 0 4px;
}
.code-block-copy {
float: right;
background-color: transparent;
border: none;
cursor: pointer;
z-index: 2;
position: relative;
padding: 8px;
bottom: 9px;
transition: filter 0.2s;
}
.code-block-copy:hover {
filter: brightness(1.5);
}
svg {
fill: rgb(128, 128, 128);
}
#tick {
position: relative;
left: 20px;
bottom: 1px;
transform: rotate(-0.25turn);
opacity: 0;
transition: fill 0.2s, transform 0.2s, opacity 0.2s;
z-index: 0;
}
.tick-show {
transform: rotate(0.0turn) !important;
opacity: 1 !important;
z-index: 3;
}
#copy-button {
position: relative;
transform: rotate(0.0turn);
opacity: 1;
transition: transform 0.2s, opacity 0.2s;
z-index: 1;
}
.copy-button-hide {
transform: rotate(0.25turn) !important;
opacity: 0 !important;
z-index: -1;
pointer-events: none;
}
.screenshot {
width: 100%;
aspect-ratio: 16 / 9;
margin-bottom: 0.5em;
}
.inline-code {
background-color: rgb(24, 24, 24);
border-radius: 4px;
padding: 2px 6px;
}
#footer {
text-align: center;
margin: 0 0 1em;
}
.footer-text {
color: rgb(96, 96, 96);
font-size: 0.9em;
}
.footer-link {
color: rgb(96, 96, 96);
transition: color 0.2s;
text-decoration: none;
}
.footer-link:hover {
color: rgb(128, 128, 128);
text-decoration: underline;
}
</style>
</head>
<body>
<div id="page-wrapper">
<img id="seafile-logo" src="media/seafile-logo-dark-pink.png"/>
<br>
<h1>Seafile Custom CSS</h1>
<p>My (incomplete) custom CSS for Seafile, made to be easy on the eyes and slightly softer than the default styling.</p>
<h3>How do I use this?</h3>
<p>On your Seafile admin settings page, paste this into your Custom CSS textbox:</p>
<div class="code-block">
<code id="text-copy">@import url('https://frugbug.github.io/seafile-custom-css/seafile.css');</code>
<div class="code-block-buttons">
<button onclick="copyText('text-copy');return false;" class="code-block-copy">
<svg id="tick" width="16" height="16">
<path d="M 15.414 3.486 a 0.975 0.975 90 0 1 0 1.378 l -9.425 9.425 a 0.975 0.975 90 0 1 -1.378 0 L 0.386 10.064 a 0.9763 0.9763 90 0 1 0.0234 -1.3546 a 0.9763 0.9763 90 0 1 1.3546 -0.0234 L 5.3 12.222 l 8.736 -8.736 a 0.975 0.975 90 0 1 1.378 0 Z"></path>
</svg>
<svg id="copy-button" width="16" height="16">
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path>
<path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
</button>
</div>
<script>
function copyText(id)
{
var r = document.createRange();
r.selectNode(document.getElementById(id));
window.getSelection().removeAllRanges();
window.getSelection().addRange(r);
document.execCommand('copy');
window.getSelection().removeAllRanges();
// Show tick
var tick = document.getElementById("tick");
tick.classList.add("tick-show");
// Hide copy
var copyButton = document.getElementById("copy-button");
copyButton.classList.add("copy-button-hide");
setTimeout(function(){
tick.classList.remove("tick-show");
copyButton.classList.remove("copy-button-hide");
}, 700);
}
</script>
</div>
<h3>What does it look like?</h3>
<a href="media/screenshot-1.webp">
<img class="screenshot" src="media/screenshot-1.webp"/>
</a>
<a href="media/screenshot-2.webp">
<img class="screenshot" src="media/screenshot-2.webp"/>
</a>
<a href="media/screenshot-3.webp">
<img class="screenshot" src="media/screenshot-3.webp"/>
</a>
<a href="media/screenshot-4.webp">
<img class="screenshot" src="media/screenshot-4.webp"/>
</a>
<h3>Why is there a website?</h3>
<p>Because if I simply put the file from <code class="inline-code">raw.githubusercontent.com</code> into Seafile's custom CSS field, it won't work. Github serves all text files with a MIME type of <code class="inline-code">text/plain</code> to prevent people abusing their service as a CDN, which is a shame, because that would be really cool. So in order to have the CSS file hosted on Github (and also have it work), it needs to be part of a Github pages site.</p>
<h3>Why is there a shell script?</h3>
<p>I use Python's <code class="inline-code">http.server</code> module to host this for my Seafile instance when I work on it, so I don't have to commit each small change I make.</p>
</div>
<div id="footer">
<p class="footer-text">By Laura | <a class="footer-link" href="https://github.com/frugbug/seafile-custom-css">View on Github</a><p>
</div>
</body>
</html>