-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
269 lines (220 loc) · 9.52 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!doctype html>
<meta charset="utf8">
<title>paper.css</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" href="src/paper.css" />
<link rel="stylesheet" href="src/simple.css" />
<link href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<main>
<header class="accent paper">
<h1>paper.css</h1>
<p>Lightweight, modern CSS to add some flair to your web-things</p>
</header>
<section class="buttons">
<div class="left">
<a class="movable paper paper-border-left" href="https://github.com/thesephist/paper.css" target="_blank">
<span class="desktop">See on</span> GitHub
</a>
<a class="movable paper" href="https://thesephist.github.io/blocks.css/" target="_blank">
blocks.css
</a>
</div>
<div class="right">
<a class="movable paper paper-border-right" href="https://thesephist.com" target="_blank">
<span class="desktop">A project</span> by
<span class="desktop">@thesephist</span>
<div class="mobile">Linus</div>
</a>
</div>
</section>
<details open class="paper">
<summary>
<h2>Basics</h2>
</summary>
<p>
<strong>paper.css</strong> is a spiritual successor to
<a class="inline movable colored paper" href="https://thesephist.github.io/blocks.css/"
target="_blank">blocks.css</a>,
a small library I'd made to add a nice, modern design aesthetic
to web apps without much work. paper.css carries the same simplicity,
focus on a single visual motif, and customizability thorugh CSS variables.
</p>
<p>paper.css is a single stylesheet. Get started by adding the stylesheet to your page's head.</p>
<pre><code><link rel="stylesheet" href="https://unpkg.com/@thesephist/paper.css/dist/paper.min.css" /></code></pre>
<p>A single paper element looks like this.</p>
<div class="paper">I'm a paper element.</div>
<p>
It's a static piece of paper hovering over the page. We make an element
into a paper element by adding the <code>paper</code> class.
We can further customize our paper element by adding other properties
through extra classes on the element.
</p>
<p>
Make the paper accented with a theme color with the <code>accent</code> class.
</p>
<div class="accent paper">Look at me! I'm colorful.</div>
<p>
If the accent is too bold, just color the text inside with
the <code>colored</code> class.
</p>
<div class="colored paper">I'm a little more subtle.</div>
<p>
A paper element is normally a <code>display: block</code> element. To use a
paper element inline, add the <code>inline</code> class to turn it into
an inline-block.
</p>
<p>This text includes <span class="inline paper">an inline paper element.</span></p>
</details open>
<details open class="paper">
<summary>
<h2>Movable paper</h2>
</summary>
<p>
The real appeal of paper elements is that the elevation off the page
can make interactive animations delightful. To mark a paper element as interactive,
add the <code>movable</code> class.
</p>
<p class="movable paper">I'm a movable paper element.</p>
<p>Try hovering over and clicking on the movable paper above.</p>
<div class="buttons">
<div class="left">
<div class="movable accent paper">accent</div>
<div class="movable colored paper">colored</div>
</div>
</div>
<p>
Movable elements are <code>font-weight: bold</code>. If you don't like it,
you can override the property on <code>.movable.paper</code> elements
in your own CSS.
</p>
</details open>
<details open class="paper">
<summary>
<h2>Borders</h2>
</summary>
<p>
One other visual accent we can add to paper elements is a single-sided border.
A paper card with a border can subtly draw attention to itself and come off
as less boring than a simple paper card.
</p>
<p>
We can add a border to a side of any paper element by adding the class
<code>paper-border-{{side}}</code>, where <code>side</code> can be any of
top, right, bottom, or left. Here's what those look like.
</p>
<div class="border-cards">
<div class="border-card paper paper-border-left">paper-border-left</div>
<div class="border-card paper paper-border-right">paper-border-right</div>
<div class="border-card paper paper-border-top">paper-border-top</div>
<div class="border-card paper paper-border-bottom">paper-border-bottom</div>
</div>
<p>We can also add multiple borders to the same element by using multiple classes.</p>
<div class="border-cards">
<div class="border-card paper paper-border-left paper-border-right">
paper-border-left paper-border-right
</div>
</div>
</details open>
<details open class="paper">
<summary>
<h2>Wrappers</h2>
</summary>
<p>
Paper elements have a small padding by default. If we're making a paper
element from an <code><img></code> or some other element that should
take up the entire paper area, add a <code>wrap</code> class to remove that
padding.
</p>
<p>With padding:</p>
<img class="paper movable" height="120px" src="assets/sample.jpg" alt="test image">
<p>... and without padding, with the <code>wrap</code> class.</p>
<img class="paper wrap movable" height="120px" src="assets/sample.jpg" alt="test image">
<p>Similar things work for videos, inputs, textareas, and other such elements.</p>
</details open>
<details open class="paper">
<summary>
<h2>Theming</h2>
</summary>
<p>
We can theme the color scheme of a paper.css page using CSS custom properties.
There are four variables you can adjust.
</p>
<ul>
<li>
<p><code>--paper-accent</code> is the accent color</p>
</li>
<li>
<p><code>--paper-foreground</code> is the color of the text in paper elements</p>
</li>
<li>
<p><code>--paper-background</code> is the color of the paper's background</p>
</li>
<li>
<p><code>--paper-border-width</code> determines the width of colored borders</p>
</li>
</ul>
<p>
To test theming,
<button class="switchThemeButton movable accent inline paper">click this button</button>
to switch the theme of this page.
</p>
</details>
<details open class="paper">
<summary>
<h2>Demo</h2>
</summary>
<p>
I'm using paper.css for most of my side projects since summer 2020,
including these below.
</p>
<ul>
<li>
<p>
<a href="https://codesynth.surge.sh" target="_blank">Codesynth</a>,
generating music from lines of source code with the Web Audio API
</p>
</li>
<li>
<p>
<a href="https://github.com/thesephist/lovecroft" target="_blank">Lovecroft</a>,
a minimal mailing list and newsletter manager that's fast and simple
</p>
</li>
<li>
<p>
<a href="https://matisse.vercel.app/" target="_blank">Matisse</a>,
a gallery of generative art written in the programming language <a href="https://dotink.co">Ink</a>
</p>
</li>
<li>
<p>
<a href="https://github.com/thesephist/histools" target="_blank">Histools</a>,
a collection of tools for generating heatmaps and data visualizations from Safari’s browser history data
</p>
</li>
<li>
<p>
<a href="https://fake.thesephist.com/" target="_blank">Wintermute</a>,
which generates fake blog posts from my blog based on a Markov chain model
</p>
</li>
<li>
<p>
<a href="https://github.com/thesephist/thingboard" target="_blank">Thingboard</a>,
a board for text notes in the browser, movable and scalable anywhere you want on the screen
</p>
</li>
</ul>
<p>Of course, this demo page is also built with paper.css.</p>
</details open>
<p class="footer">
paper.css is made by
<a href="https://thesephist.com" target="_blank">Linus</a>
and open source under the MIT License.
</p>
</main>
<script>
document.querySelector('.switchThemeButton').addEventListener('click', () => {
document.body.classList.toggle('themed');
});
</script>