homepage and articles

This commit is contained in:
James Shiffer 2020-06-04 19:30:45 -07:00
parent 929e2c505c
commit 108f428551
No known key found for this signature in database
GPG Key ID: C0DB8774A1B3BA45
7 changed files with 177 additions and 55 deletions

View File

@ -4,40 +4,41 @@
<style> <style>
nav { nav {
border-bottom: 1px solid rgba(255,62,0,0.1); font-weight: bold;
font-weight: 800;
padding: 1rem 0 0 0; padding: 1rem 0 0 0;
position: fixed; position: fixed;
width: 100vw; width: 100vw;
z-index: 100; z-index: 100;
background-color: #fff; background-color: #fff;
top: 0;
} }
div.items { div.items {
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex; display: flex;
flex-direction: column;
text-transform: uppercase; text-transform: uppercase;
padding: 0 1.5rem; padding: 0 1.5rem 0.25rem;
align-items: start;
} }
div.filler { div.filler {
flex: 1 0 0; flex: 1 0 0;
} }
div.items div::after {
content: '';
display: block;
clear: both;
}
div.items div { div.items div {
display: block; display: block;
} }
div.link a { div.link a {
text-decoration: none; text-decoration: none;
padding: 0.5rem 0; font-size: 2rem;
display: block;
font-size: 24px;
} }
img.wordmark { img.wordmark {
height: 2.5rem; height: 3rem;
}
@media (min-width: 640px) {
div.items {
flex-direction: row;
align-items: end;
}
} }
</style> </style>
@ -45,6 +46,6 @@
<div class="items"> <div class="items">
<div><a href="/"><img class="wordmark" src="/logo.png" alt="HowFeed.biz"></a></div> <div><a href="/"><img class="wordmark" src="/logo.png" alt="HowFeed.biz"></a></div>
<div class="filler"></div> <div class="filler"></div>
<div class="link"><a href="blog">Contact Us</a></div> <div class="link"><a href="mailto:the_katze@naver.com">Contact Us</a></div>
</div> </div>
</nav> </nav>

View File

@ -20,7 +20,7 @@
margin: 1em auto; margin: 1em auto;
} }
@media (min-width: 480px) { @media (min-width: 640px) {
h1 { h1 {
font-size: 4em; font-size: 4em;
} }

View File

@ -6,16 +6,28 @@
<style> <style>
main { main {
position: relative; max-width: 100vw;
max-width: 56em; background: #fff;
background-color: white;
margin: 0 auto;
box-sizing: border-box; box-sizing: border-box;
} }
footer {
box-sizing: border-box;
text-align: center;
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
padding: 1rem;
z-index: 1;
}
</style> </style>
<Nav {segment}/> <Nav {segment}/>
<main> <main>
<slot></slot> <slot></slot>
<footer>
Wholly funded and published by FemboyFinancial, Ltd.
Copyright &copy; {new Date().getFullYear()} FemboyFinancial, Ltd. All rights reserved.
</footer>
</main> </main>

View File

@ -12,17 +12,17 @@ export function get(req, res, next) {
if (lookup.has(slug)) { if (lookup.has(slug)) {
res.writeHead(200, { res.writeHead(200, {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}); });
res.end(lookup.get(slug)); res.end(lookup.get(slug));
} else { } else {
res.writeHead(404, { res.writeHead(404, {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}); });
res.end(JSON.stringify({ res.end(JSON.stringify({
message: `Not found` message: `Not found`
})); }));
} }
} }

View File

@ -51,14 +51,35 @@
.content :global(li) { .content :global(li) {
margin: 0 0 0.5em 0; margin: 0 0 0.5em 0;
} }
.content {
position: absolute;
background: #fff;
margin: 8rem;
padding: 2rem;
}
figure.article-image {
width: auto;
margin: 0;
}
div.article-meta {
margin: 0;
padding: 0;
}
</style> </style>
<svelte:head> <svelte:head>
<title>{post.title}</title> <title>{post.title} | HOWFEED.BIZ</title>
</svelte:head> </svelte:head>
<h1>{post.title}</h1> <div class="content">
<figure class="article-image">
<div class='content'> <img alt={post.title} src={`/a/${post.slug}.jpg`}>
</figure>
<div class="article-meta">
<h1 class="article-title">{post.title}</h1>
</div>
{@html post.html} {@html post.html}
</div> </div>

View File

@ -1,48 +1,82 @@
<script context="module">
import posts from './a/_posts.js';
export async function preload()
{
return {articles: posts};
}
</script>
<script>
export let articles;
</script>
<style> <style>
h1, figure, p { h1, h2 {
text-align: center; text-align: center;
}
h1, h2, p {
margin: 0 auto; margin: 0 auto;
} }
h1 { h1 {
font-size: 2.8em; font-size: 3rem;
text-transform: uppercase; text-transform: uppercase;
font-weight: 700;
margin: 0 0 0.5em 0;
} }
figure { figure {
margin: 0 0 1em 0; margin: 0;
} }
img { img {
width: 100%; width: 100%;
max-width: 400px; max-width: 640px;
margin: 0 0 1em 0; margin: 1rem;
} }
@media (min-width: 640px) {
p { div.content {
margin: 1em auto; padding-top: 5rem !important;
} }
h1.welcome {
@media (min-width: 480px) { font-size: 8rem !important;
h1 { }
font-size: 4em; h2.desc {
font-size: 2rem !important;
}
}
@media (min-width: 1280px) {
h1.welcome {
font-size: 10rem !important;
}
h2.desc {
font-size: 3.5rem !important;
} }
} }
div.background { div.background {
background: url('/cityscape.jpg') no-repeat center; background: url('/cityscape.jpg') no-repeat center;
background-size: cover; background-size: cover;
position: fixed; position: fixed;
height: 16rem; height: 24rem;
width: 100vw; width: 100vw;
z-index: 0; z-index: 0;
filter: blur(5px); filter: blur(5px);
} }
div.content { div.content {
margin-top: 5rem; padding-top: 8rem;
position: absolute;
z-index: 1; z-index: 1;
margin: 0 auto;
width: 100vw;
}
h1.welcome, h2.desc {
color: whitesmoke;
}
h1.welcome {
margin-top: 1rem;
font-size: 4rem;
}
h2 {
text-transform: uppercase;
}
h2.desc {
margin-bottom: 1rem;
font-size: 1.5rem;
} }
</style> </style>
@ -52,8 +86,19 @@
<div class="background"></div> <div class="background"></div>
<div class="content"> <div class="content">
<h1 class="uppercase">Welcome</h1> <h1 class="welcome">Welcome</h1>
<figure> <h2 class="desc">Find an Article</h2>
<figcaption>Have fun with Sapper!</figcaption> <div class="article-list">
</figure> {#each articles as {title, slug, date}}
<a rel="prefetch" href={`/a/${slug}`}>
<figure class="article-image">
<img src={`/a/${slug}.jpg` || '/logo.png'} alt={title}>
</figure>
<div class="article-meta">
<p class="article-title">{title}</p>
<p class="article-date">{new Date(date).toLocaleDateString()}</p>
</div>
</a>
{/each}
</div>
</div> </div>

View File

@ -3,13 +3,13 @@ body {
font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
font-size: 14px; font-size: 14px;
line-height: 1.5; line-height: 1.5;
color: #333; color: #000;
background-color: rgb(150, 200, 234);
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin: 0 0 0.5em 0; font-weight: bold;
font-weight: 400; line-height: 1.1;
line-height: 1.2;
} }
h1 { h1 {
@ -20,6 +20,10 @@ a {
color: inherit; color: inherit;
} }
a:hover {
color: #508FC3;
}
code { code {
font-family: menlo, inconsolata, monospace; font-family: menlo, inconsolata, monospace;
font-size: calc(1em - 2px); font-size: calc(1em - 2px);
@ -29,8 +33,47 @@ code {
border-radius: 2px; border-radius: 2px;
} }
@media (min-width: 400px) { @media (min-width: 640px) {
body { body {
font-size: 16px; font-size: 16px;
} }
} }
div.article-list {
background: #508FC3;
width: 80%;
margin: 0 auto;
padding: 2rem 1rem;
}
div.article-list > a {
display: flex;
text-decoration: none;
flex-direction: row;
margin: 2rem;
align-items: start;
}
figure.article-image {
background: white;
display: flex;
align-self: center;
justify-content: center;
width: 33.33%;
}
figure.article-image img {
height: 12rem;
width: auto;
}
div.article-meta {
background: white;
margin: 2rem;
padding: 0.75rem;
line-height: 1;
font-weight: bold;
flex: 1 0 0;
}
.article-title {
font-size: 4rem;
}
.article-date {
font-size: 2rem;
}