diff --git a/public/assets/style.css b/public/assets/style.css index 519736d..9036e97 100644 --- a/public/assets/style.css +++ b/public/assets/style.css @@ -1,12 +1,65 @@ +/* 1. Use a more-intuitive box-sizing model */ +*, *::before, *::after { + box-sizing: border-box; +} + +/* 2. Remove default margin */ +* { + margin: 0; +} + +/* 3. Enable keyword animations */ +@media (prefers-reduced-motion: no-preference) { + html { + interpolate-size: allow-keywords; + } +} body { - color: white; - background: purple; - max-width: 95%; + /* 4. Add accessible line-height */ + line-height: 1.5; + /* 5. Improve text rendering */ + -webkit-font-smoothing: antialiased; +} + +/* 6. Improve media defaults */ +img, picture, video, canvas, svg { display: block; - margin: auto; + max-width: 100%; +} + +/* 7. Inherit fonts for form controls */ +input, button, textarea, select { + font: inherit; +} + +/* 8. Avoid text overflows */ +p, h1, h2, h3, h4, h5, h6 { + overflow-wrap: break-word; +} + +/* 9. Improve line wrapping */ +p { + text-wrap: pretty; +} + +h1, h2, h3, h4, h5, h6 { + text-wrap: balance; +} + +/* + 10. Create a root stacking context +*/ +#root, #__next { + isolation: isolate; +} + +body { + background: orange; } img { max-width: 100%; display: block; -} +} + +/*# sourceMappingURL=style.css.map */ diff --git a/public/assets/style.css.map b/public/assets/style.css.map new file mode 100644 index 0000000..8d73f85 --- /dev/null +++ b/public/assets/style.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["../../theme/reset.scss","../../theme/styles.scss"],"names":[],"mappings":"AAAA;AACA;EACE;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;IACE;;;AAIJ;AACE;EACA;AACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;;;AAEF;EACE;;;AAGF;AAAA;AAAA;AAGA;EACE;;;AClDF;EACE;;;AAGF;EACE;EACA","file":"style.css"} \ No newline at end of file diff --git a/public/pages/about.html b/public/pages/about.html index 354850b..5f03faf 100644 --- a/public/pages/about.html +++ b/public/pages/about.html @@ -1,14 +1,7 @@ - + About -

This is the about page!

diff --git a/src/connection.rs b/src/connection.rs index f2c6824..1d15a01 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -95,3 +95,7 @@ fn return_response(path_or_code: &str) -> String { let length = contents.len(); format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}") } + +pub fn path_exists(path: &str) -> bool { + fs::metadata(path).is_ok() +} diff --git a/theme/package.json b/theme/package.json new file mode 100644 index 0000000..115a59d --- /dev/null +++ b/theme/package.json @@ -0,0 +1,11 @@ +{ + "name": "batflip", + "version": "1.0.0", + "description": "Theme for Batflip scoring.", + "main": "index.js", + "scripts": { + "build": "sass styles.scss ../public/assets/style.css" + }, + "author": "Dan Chadwick", + "license": "MIT" +} diff --git a/theme/reset.scss b/theme/reset.scss new file mode 100644 index 0000000..0761796 --- /dev/null +++ b/theme/reset.scss @@ -0,0 +1,54 @@ +/* 1. Use a more-intuitive box-sizing model */ +*, *::before, *::after { + box-sizing: border-box; +} + +/* 2. Remove default margin */ +* { + margin: 0; +} + +/* 3. Enable keyword animations */ +@media (prefers-reduced-motion: no-preference) { + html { + interpolate-size: allow-keywords; + } +} + +body { + /* 4. Add accessible line-height */ + line-height: 1.5; + /* 5. Improve text rendering */ + -webkit-font-smoothing: antialiased; +} + +/* 6. Improve media defaults */ +img, picture, video, canvas, svg { + display: block; + max-width: 100%; +} + +/* 7. Inherit fonts for form controls */ +input, button, textarea, select { + font: inherit; +} + +/* 8. Avoid text overflows */ +p, h1, h2, h3, h4, h5, h6 { + overflow-wrap: break-word; +} + +/* 9. Improve line wrapping */ +p { + text-wrap: pretty; +} +h1, h2, h3, h4, h5, h6 { + text-wrap: balance; +} + +/* + 10. Create a root stacking context +*/ +#root, #__next { + isolation: isolate; +} diff --git a/theme/styles.scss b/theme/styles.scss new file mode 100644 index 0000000..21c6862 --- /dev/null +++ b/theme/styles.scss @@ -0,0 +1,10 @@ +@import "reset"; + +body { + background: orange; +} + +img { + max-width: 100%; + display: block; +}