libreddit/templates/popular.html.hbs

145 lines
2.2 KiB
Handlebars

<html>
<head>
<title>Libreddit</title>
<style>
* {
transition: 0.2s all;
margin: 0px;
color: white;
font-family: sans-serif;
}
html {
background: black;
}
header {
color: aqua;
background: #111;
padding: 10px;
border-bottom: 2px solid #222;
}
main {
max-width: 1000px;
margin: 0 auto;
padding: 0px 10px;
}
button {
background: none;
border: none;
font-weight: bold;
}
a {
color: inherit;
text-decoration: none;
}
a:not(.post_right):hover {
text-decoration: underline;
}
#sort {
max-width: 1000px;
margin: 20px auto 20px;
display: flex;
justify-content: start;
padding: 0px 10px;
}
#sort > div {
background: #111;
color: lightgrey;
border-radius: 5px;
margin-right: 5px;
padding: 10px;
width: 50px;
text-align: center;
cursor: pointer;
}
#sort > div:hover {
background: #222;
}
#sort > #sort_{{sort}} {
background: #333;
}
.post {
border: 2px solid #222;
border-radius: 5px;
background: #111;
display: flex;
}
.post:hover {
background: #222;
}
.post:hover > .post_left {
background: #333;
}
.post_left, .post_right {
display: flex;
flex-direction: column;
}
.post_left {
text-align: center;
background: #222;
border-radius: 5px 0px 0px 5px;
min-width: 75px;
padding: 10px 0px;
}
.post_upvote {
display: none;
}
.post_score {
margin: auto;
}
.post_right {
padding: 10px 25px;
flex-grow: 1;
flex-shrink: 1;
}
.post_right > * {
margin: 5px;
}
.post_right > p {
opacity: 0.75;
}
.post_thumbnail {
object-fit: cover;
width: auto;
flex-shrink: 0;
border-radius: 0px 5px 5px 0px;
}
.post_thumbnail[src=""] {
border: none;
}
</style>
</head>
<body>
<header><a href="/">LIBREDDIT</a></header>
<div id="sort">
<div id="sort_hot"><a href="/hot">Hot</a></div>
<div id="sort_top"><a href="/top">Top</a></div>
<div id="sort_new"><a href="/new">New</a></div>
<div id="sort_rising"><a href="/rising">Rising</a></div>
</div>
<main>
{{{posts}}}
</main>
</body>
</html>