Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
collapse top padding if there's no room for side padding
Browse files Browse the repository at this point in the history
Reduce use of Nightly features.

resolves #228
  • Loading branch information
jeremyBanks authored and deploy committed Feb 15, 2020
2 parents b88345b + 462528b commit b5f11d1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
28 changes: 13 additions & 15 deletions src/bin/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,20 @@ fn unpack_tables() -> Tables {
pub fn read_table<T: DeserializeOwned>(
path: &str,
) -> Result<Vec<T>, Box<dyn std::error::Error>> {
let result: Result<Vec<T>, Box<dyn std::error::Error>> = try {
let file = File::open(path)?;
let buffer = BufReader::new(&file);
let deserializer = JsonDeserializer::from_reader(buffer);
let json_results = deserializer.into_iter::<JsonValue>();
json_results
.map(Result::unwrap)
.map(T::deserialize)
.map(Result::unwrap)
.collect()
};
match result {
Ok(result) => Ok(result),
Ok(match File::open(path) {
Ok(file) => {
let buffer = BufReader::new(&file);
let deserializer = JsonDeserializer::from_reader(buffer);
let json_results = deserializer.into_iter::<JsonValue>();
json_results
.map(Result::unwrap)
.map(T::deserialize)
.map(Result::unwrap)
.collect()
}
Err(err) => {
error!("Failed to load table: {:?}", err);
Ok(vec![])
vec![]
}
}
})
}
1 change: 0 additions & 1 deletion src/bin/speedruns.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(try_blocks)]
#![allow(missing_docs, clippy::useless_attribute, clippy::useless_vec)]
#![warn(
missing_debug_implementations,
Expand Down
31 changes: 20 additions & 11 deletions src/components/styles.module.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
@font-face {
font-family: "JetBrains Mono";
font-weight: normal;
src: local("JetBrains Mono"),
url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

@font-face {
font-family: "JetBrains Mono";
font-weight: bold;
src: local("JetBrains Mono"),
url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

@font-face {
font-family: "Fira Sans";
font-weight: normal;
src: local("Fira Sans"), url("/fonts/FiraSans-Regular.woff2") format("woff2");
src: url("/fonts/FiraSans-Regular.woff2") format("woff2");
}

@font-face {
font-family: "Fira Sans";
font-weight: bold;
src: local("Fira Sans"), url("/fonts/FiraSans-Bold.woff2") format("woff2");
src: url("/fonts/FiraSans-Bold.woff2") format("woff2");
}

html.document {
Expand All @@ -43,15 +41,23 @@ html.document {
}

main {
box-sizing: border-box;
display: block;
color: #000;
background: #fff;
font: 16px "Fira Sans", sans-serif;
padding: 24px 0;
margin: 16px auto;
transition: margin 0.1s ease-in-out, border-radius 0.1s ease-in-out,
padding 0.1s ease-in-out;
@media (max-width: 660px) {
margin: 0 auto;
border-radius: 0;
padding-top: 0px;
}
width: 100%;
max-width: 640px;
min-width: 596px;
max-width: 650px;
min-width: 600px;
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
box-shadow: 0 0 2px black, 0 0 4px rgba(255, 255, 255, 0.5);
Expand Down Expand Up @@ -249,20 +255,23 @@ html.document {
width: 140px;
}

.links {
td.links,
th.links {
text-align: left;
padding-left: 0px;
}
td.links {
width: 50px;
width: 60px;
vertical-align: middle;
padding-left: 8px;

a {
position: relative;
display: inline-block;
position: relative;
bottom: 16px;
width: 18px;
height: 0;
left: -2px;
overflow: visible;

svg {
Expand Down
3 changes: 0 additions & 3 deletions src/lib/speedruns.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Tools to download, search, and mirror https://speedrun.com leaderboards.
#![feature(
arbitrary_self_types,
associated_type_defaults,
proc_macro_hygiene,
label_break_value,
slice_concat_ext,
option_unwrap_none,
never_type
)]
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import useNprogress from "~/components/hooks/use-nprogress";
import LoadingBlock from "~/components/loading-block";

const searchSuggestions = [
"Burnout",
"WarCraft",
"Burnout",
"Pokemon",
"Portal",
"Metroid",
Expand Down

1 comment on commit b5f11d1

@vercel
Copy link

@vercel vercel bot commented on b5f11d1 Feb 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.