Skip to content

Commit eef49e5

Browse files
authored
refactor css (#149)
1 parent 45b7114 commit eef49e5

14 files changed

+134
-247
lines changed

templates/header.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<div id="main">
55
<div id="name">
66
<a href="{{ parent_page }}"></a>
7-
{{ title }}</div>
7+
{{ title }}
8+
</div>
89
<div id="contents">

templates/index.css

Lines changed: 53 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
--bg: #301f15;
2626
--text: #e8e6e3;
2727
--page-margin: 8%;
28+
--gap: 0.5rem;
2829
}
2930

3031
html, body {
@@ -133,78 +134,80 @@ code {
133134
.contents-item {
134135
font-size: 2rem;
135136
width: fit-content;
136-
padding: 10px 10px 10px 10px;
137137
/* background-color: var(--bg); */
138138
}
139139

140-
.contents-item:not(:first-of-type) {
141-
margin-top: 10px;
142-
}
143-
144140
/* TODO: just remove h1s and define classes with larger fonts */
145141
#contents h1 {
146142
padding: 0;
147-
margin: 0px 0px 0px 0px;
143+
margin: 0;
148144
}
149145

150146
/* main box for all other pages*/
151147
.page-content {
152148
width: 100%;
153149
padding: 50px;
154-
font-size: 1rem;
155150
background: var(--bg);
156151
border-radius: 20px;
157152
box-sizing: border-box;
158153
}
159154

160-
.writing {
161-
background: var(--bg);
162-
color: D7CDB0;
155+
/* recipe page */
156+
.recipe-sidebar {
157+
width: max(350px, 25%);
158+
min-width: max(350px, 25%);
163159
}
164160

165-
.preserve-whitespace {
166-
white-space: pre-wrap;
161+
.recipe-sources {
162+
font-size: 0.5rem;
167163
}
168164

169-
.writing-title {
170-
color: var(--light-bg);
165+
/* zeitgeist page */
166+
.zeitgeist-section .flex-row {
167+
width: 100%;
171168
}
172169

173-
/* tables
174-
TODO: use simplified version used in mythmancer.com
175-
*/
176-
.table {
177-
display: flex;
178-
flex-direction: column;
179-
margin-bottom: 40px;
170+
.zeitgeist-section img {
171+
border: 0;
172+
max-width: calc((100% - 2rem) / 5);
180173
}
181174

182-
.table-row {
183-
display: flex;
184-
flex-direction: row;
185-
justify-content: center;
175+
.zeitgeist-lower-row img {
176+
max-width: calc((100% - 4.5rem) / 10);
186177
}
187178

188-
.table-row.label {
179+
/* tools */
180+
#screamintovoid {
181+
width: min(500px, 100%);
182+
height: 300px;
183+
resize: none;
184+
border: none;
185+
border-bottom: 1px solid var(--light-bg);
186+
background: rgba(255, 255, 255, 0.04);
187+
padding: 15px;
188+
outline: none;
189+
color: var(--text);
190+
font-family: "Libre Caslon Text";
189191
font-size: 1rem;
190192
}
191193

192-
.table-column {
193-
flex: 1;
194-
border: 1px solid var(--light-bg);
195-
min-height: 40px;
194+
/* generics */
195+
.flex-col {
196196
display: flex;
197-
align-items: center;
198-
padding-left: 10px;
199-
overflow: hidden;
197+
flex-direction: column;
200198
}
201199

202-
.table.no-borders .table-column {
203-
border: none;
200+
.flex-row {
201+
display: flex;
202+
flex-direction: row;
203+
}
204+
205+
.gappy {
206+
gap: var(--gap);
204207
}
205208

206-
.table-column:not(:nth-last-of-type(1)) {
207-
border-right: 1px solid var(--light-bg);
209+
.gappy-2x {
210+
gap: calc(2 * var(--gap));
208211
}
209212

210213
.table-header {
@@ -215,119 +218,27 @@ code {
215218
top: 0;
216219
}
217220

218-
.table .table-row:nth-child(even) {
219-
background-color: rgb(255, 255, 255, 0.15);
220-
}
221-
222-
.table .table-row.non-alternating:nth-child(even) {
223-
background-color: transparent !important;
224-
}
225-
226-
/* recipe page */
227-
.recipe-card {
228-
display: flex;
229-
flex-direction: row;
230-
}
231-
232-
.recipe-sidebar {
233-
display: flex;
234-
flex-direction: column;
235-
min-width: 350px;
236-
max-width: 25%;
237-
}
238-
239-
.recipe-ingredients {
240-
padding-top: 20px;
241-
}
242-
243-
.recipe-steps {
244-
padding-left: 30px;
245-
}
246-
247-
.recipe-sources {
248-
padding-top: 20px;
249-
font-size: 0.5rem;
250-
}
251-
252-
/* about page */
253-
.work-logo {
254-
height: 100px;
255-
width: auto;
256-
}
257-
258-
/* thoughts page */
259-
.thought-group {
260-
margin-bottom: 40px;
261-
}
262-
263-
/* TODO: replace brs with meaningful divs/sizing */
264-
.thoughts br {
265-
margin-top: 5px;
266-
display: block;
267-
}
268-
269-
/* zeitgeist page */
270-
.zeitgeist-heading {
271-
display: flex;
272-
flex-direction: row;
273-
}
274-
275-
.zeitgeist-section .table img {
276-
width: 100%;
277-
}
278-
279-
.zeitgeist-section .table-column {
280-
padding: 5px;
281-
border: 0;
282-
border-right: 0;
283-
max-width: 20%;
284-
}
285-
286-
.zeitgeist-lower-row .table-column {
287-
max-width: 10%;
288-
box-sizing: border-box;
289-
}
290-
291-
.zeitgeist-section .table-column:not(:nth-last-of-type(1)) {
292-
border: 0;
293-
}
294-
295-
.zeitgeist-section .table .table-row:nth-child(even) {
296-
background-color: transparent;
221+
.table .flex-col {
222+
min-height: 40px;
223+
align-items: center;
224+
overflow: hidden;
225+
width: 50%;
297226
}
298227

299-
/* tools */
300-
#qr {
301-
display: flex;
302-
flex-direction: column;
303-
width: 300px;
304-
align-self: center;
228+
.table > .flex-row:nth-child(even) {
229+
background-color: rgb(255, 255, 255, 0.15);
305230
}
306231

307-
#screamintovoid {
308-
min-width: 40%;
309-
max-width: 300px;
310-
height: 300px;
311-
resize: none;
312-
border: none;
313-
border-bottom: 1px solid var(--light-bg);
314-
background: transparent;
315-
outline: none;
316-
color: var(--text);
317-
font-family: "Libre Caslon Text";
318-
font-size: 2rem;
319-
margin-top: 30px;
232+
.table > .flex-row.non-alternating:nth-child(even) {
233+
background-color: transparent !important;
320234
}
321235

322-
#fullscreen-btn {
323-
margin-left: auto;
324-
width: fit-content;
325-
cursor: pointer;
236+
.preserve-whitespace {
237+
white-space: pre-wrap;
326238
}
327239

328-
/* generics */
329-
.v-spacer {
330-
height: 100%;
240+
.writing-title {
241+
color: var(--light-bg);
331242
}
332243

333244
.force-dyad {
@@ -337,20 +248,6 @@ code {
337248
display: flex;
338249
}
339250

340-
.btn {
341-
/* Button, should be paired with a color */
342-
display: flex;
343-
justify-content: center;
344-
margin-left: 10px;
345-
margin-right: 10px;
346-
height: var(--cs-height-min);
347-
cursor: pointer;
348-
user-select: none;
349-
border-radius: 5px;
350-
background: var(--light-bg);
351-
color: var(--bg);
352-
}
353-
354251
.notes {
355252
font-size: 1rem;
356253
}

templates/template_about.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{% with title="purajit | about" %}
22
{% include './header.html' %}
33
{% endwith %}
4-
<div class="about page-content">
4+
<div class="page-content flex-col gappy">
55
<h1>software engineer / writer (barely) / musician (not even)</h1>
6-
i'd love to contribute to: education, public transit, biology, sustainability, lab research<br/>
7-
don't contact me about: crypto/web3/blockchain, fintech, amazon, facebook, tech middleman/marketplace services<br/><br/>
6+
<div>i'd love to contribute to: education, public transit, biology, sustainability, lab research</div>
7+
<div>don't contact me about: crypto/web3/blockchain, fintech, amazon, facebook, tech middleman/marketplace services</div>
88
<h1>worked at:</h1>
9+
<div class="flex-row gappy">
910
{% for job in data['work'] %}
10-
<a href="{{ job['link'] }}"><img class="work-logo" src="{{ static_url }}/images/work-{{ job['key'] }}.png"></a>
11+
<a href="{{ job['link'] }}"><img class="work-logo" src="{{ static_url }}/images/work-{{ job['key'] }}.png" height="100px"></a>
1112
{% endfor %}
13+
</div>
1214
</div>
1315
{% include './footer.html' %}

templates/template_basics_table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% with title="purajit | recipes" %}
22
{% include './header.html' %}
33
{% endwith %}
4-
<div class="writing page-content">
4+
<div class="page-content">
55
<h1 class="writing-title">{{ title }}</h1><br>
66
<div class="table">
77
<div class="table-row table-header">

templates/template_blog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% with title="purajit | blog" %}
22
{% include './header.html' %}
33
{% endwith %}
4-
<div class="writing page-content">
4+
<div class="page-content">
55
{{ data }}
66
</div>
77
{% include './footer.html' %}

templates/template_content_table.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
<div class="flex-col gappy-2x">
12
{% for item in contents %}
23
<div class="contents-item">
34
<a href="{{ item['link'] }}">{{ item['title'] }}</a>
45
</div>
56
{% endfor %}
7+
</div>

templates/template_continuous_dice.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
font-weight: 500;
106106
text-align: center;
107107
margin-bottom: 0.25rem;
108+
border-bottom: 1px solid white;
108109
}
109110

110111
.history-entry {

templates/template_lorem.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% with title="purajit | lorem" %}
22
{% include './header.html' %}
33
{% endwith %}
4-
<div class="page-content">
5-
{{ data }}
4+
<div class="page-content flex-col">
5+
{{ data }}
66
</div>
77
{% include './footer.html' %}

templates/template_qr.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% with title="purajit | tools" %}
22
{% include './header.html' %}
33
{% endwith %}
4-
<div class="page-content">
5-
<img id="qr" src="{{ static_url }}/images/qr.jpg">
4+
<div class="page-content flex-row">
5+
<img id="qr" src="{{ static_url }}/images/qr.jpg" width="300px">
66
</div>
77
{% include './footer.html' %}

0 commit comments

Comments
 (0)