[wip] new styles
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "TODO",
|
"name": "HowFeed.biz",
|
||||||
"description": "TODO",
|
"description": "HowFeed.biz",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "sapper dev",
|
"dev": "sapper dev",
|
||||||
"build": "sapper build",
|
"build": "sapper build",
|
||||||
|
@ -5,56 +5,46 @@
|
|||||||
<style>
|
<style>
|
||||||
nav {
|
nav {
|
||||||
border-bottom: 1px solid rgba(255,62,0,0.1);
|
border-bottom: 1px solid rgba(255,62,0,0.1);
|
||||||
font-weight: 300;
|
font-weight: 800;
|
||||||
padding: 0 1em;
|
padding: 1rem 0 0 0;
|
||||||
|
position: fixed;
|
||||||
|
width: 100vw;
|
||||||
|
z-index: 100;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
div.items {
|
||||||
ul {
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
text-transform: uppercase;
|
||||||
|
padding: 0 1.5rem;
|
||||||
}
|
}
|
||||||
|
div.filler {
|
||||||
/* clearfix */
|
flex: 1 0 0;
|
||||||
ul::after {
|
}
|
||||||
|
div.items div::after {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
div.items div {
|
||||||
li {
|
|
||||||
display: block;
|
display: block;
|
||||||
float: left;
|
|
||||||
}
|
}
|
||||||
|
div.link a {
|
||||||
[aria-current] {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
[aria-current]::after {
|
|
||||||
position: absolute;
|
|
||||||
content: '';
|
|
||||||
width: calc(100% - 1em);
|
|
||||||
height: 2px;
|
|
||||||
background-color: rgb(255,62,0);
|
|
||||||
display: block;
|
|
||||||
bottom: -1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 1em 0.5em;
|
padding: 0.5rem 0;
|
||||||
display: block;
|
display: block;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
img.wordmark {
|
||||||
|
height: 2.5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<div class="items">
|
||||||
<li><a aria-current="{segment === undefined ? 'page' : undefined}" href=".">home</a></li>
|
<div><a href="/"><img class="wordmark" src="/logo.png" alt="HowFeed.biz"></a></div>
|
||||||
<li><a aria-current="{segment === 'about' ? 'page' : undefined}" href="about">about</a></li>
|
<div class="filler"></div>
|
||||||
|
<div class="link"><a href="blog">Contact Us</a></div>
|
||||||
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
|
</div>
|
||||||
the blog data when we hover over the link or tap it on a touchscreen -->
|
|
||||||
<li><a rel=prefetch aria-current="{segment === 'blog' ? 'page' : undefined}" href="blog">blog</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
max-width: 56em;
|
max-width: 56em;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 2em;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
28
src/routes/a/[slug].json.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import posts from './_posts.js';
|
||||||
|
|
||||||
|
const lookup = new Map();
|
||||||
|
posts.forEach(post => {
|
||||||
|
lookup.set(post.slug, JSON.stringify(post));
|
||||||
|
});
|
||||||
|
|
||||||
|
export function get(req, res, next) {
|
||||||
|
// the `slug` parameter is available because
|
||||||
|
// this file is called [slug].json.js
|
||||||
|
const { slug } = req.params;
|
||||||
|
|
||||||
|
if (lookup.has(slug)) {
|
||||||
|
res.writeHead(200, {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
});
|
||||||
|
|
||||||
|
res.end(lookup.get(slug));
|
||||||
|
} else {
|
||||||
|
res.writeHead(404, {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
});
|
||||||
|
|
||||||
|
res.end(JSON.stringify({
|
||||||
|
message: `Not found`
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
64
src/routes/a/[slug].svelte
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<script context="module">
|
||||||
|
export async function preload({ params, query }) {
|
||||||
|
// the `slug` parameter is available because
|
||||||
|
// this file is called [slug].svelte
|
||||||
|
const res = await this.fetch(`a/${params.slug}.json`);
|
||||||
|
const data = await res.json();
|
||||||
|
|
||||||
|
if (res.status === 200) {
|
||||||
|
return { post: data };
|
||||||
|
} else {
|
||||||
|
this.error(res.status, data.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export let post;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
By default, CSS is locally scoped to the component,
|
||||||
|
and any unused styles are dead-code-eliminated.
|
||||||
|
In this page, Svelte can't know which elements are
|
||||||
|
going to appear inside the {{{post.html}}} block,
|
||||||
|
so we have to use the :global(...) modifier to target
|
||||||
|
all elements inside .content
|
||||||
|
*/
|
||||||
|
.content :global(h2) {
|
||||||
|
font-size: 1.4em;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content :global(pre) {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.05);
|
||||||
|
padding: 0.5em;
|
||||||
|
border-radius: 2px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content :global(pre) :global(code) {
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content :global(ul) {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content :global(li) {
|
||||||
|
margin: 0 0 0.5em 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>{post.title}</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<h1>{post.title}</h1>
|
||||||
|
|
||||||
|
<div class='content'>
|
||||||
|
{@html post.html}
|
||||||
|
</div>
|
63
src/routes/a/_posts.js
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
const posts = [
|
||||||
|
{
|
||||||
|
title: 'How To Disable ABS in Your Car',
|
||||||
|
date: 1590908400000,
|
||||||
|
html: `
|
||||||
|
<p>First, you have to know what <a href='https://svelte.dev'>Svelte</a> is. Svelte is a UI framework with a bold new idea: rather than providing a library that you write code with (like React or Vue, for example), it's a compiler that turns your components into highly optimized vanilla JavaScript. If you haven't already read the <a href='https://svelte.dev/blog/frameworks-without-the-framework'>introductory blog post</a>, you should!</p>
|
||||||
|
|
||||||
|
<p>Sapper is a Next.js-style framework (<a href='blog/how-is-sapper-different-from-next'>more on that here</a>) built around Svelte. It makes it embarrassingly easy to create extremely high performance web apps. Out of the box, you get:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Code-splitting, dynamic imports and hot module replacement, powered by webpack</li>
|
||||||
|
<li>Server-side rendering (SSR) with client-side hydration</li>
|
||||||
|
<li>Service worker for offline support, and all the PWA bells and whistles</li>
|
||||||
|
<li>The nicest development experience you've ever had, or your money back</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>It's implemented as Express middleware. Everything is set up and waiting for you to get started, but you keep complete control over the server, service worker, webpack config and everything else, so it's as flexible as you need it to be.</p>
|
||||||
|
`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'How to Pay Zero in Taxes',
|
||||||
|
date: 1590908400000,
|
||||||
|
html: `
|
||||||
|
<p>First, you have to know what <a href='https://svelte.dev'>Svelte</a> is. Svelte is a UI framework with a bold new idea: rather than providing a library that you write code with (like React or Vue, for example), it's a compiler that turns your components into highly optimized vanilla JavaScript. If you haven't already read the <a href='https://svelte.dev/blog/frameworks-without-the-framework'>introductory blog post</a>, you should!</p>
|
||||||
|
|
||||||
|
<p>Sapper is a Next.js-style framework (<a href='blog/how-is-sapper-different-from-next'>more on that here</a>) built around Svelte. It makes it embarrassingly easy to create extremely high performance web apps. Out of the box, you get:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Code-splitting, dynamic imports and hot module replacement, powered by webpack</li>
|
||||||
|
<li>Server-side rendering (SSR) with client-side hydration</li>
|
||||||
|
<li>Service worker for offline support, and all the PWA bells and whistles</li>
|
||||||
|
<li>The nicest development experience you've ever had, or your money back</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>It's implemented as Express middleware. Everything is set up and waiting for you to get started, but you keep complete control over the server, service worker, webpack config and everything else, so it's as flexible as you need it to be.</p>
|
||||||
|
`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Here\'s Why Canned Water is Better',
|
||||||
|
date: 1590908400000,
|
||||||
|
html: `
|
||||||
|
<p>First, you have to know what <a href='https://svelte.dev'>Svelte</a> is. Svelte is a UI framework with a bold new idea: rather than providing a library that you write code with (like React or Vue, for example), it's a compiler that turns your components into highly optimized vanilla JavaScript. If you haven't already read the <a href='https://svelte.dev/blog/frameworks-without-the-framework'>introductory blog post</a>, you should!</p>
|
||||||
|
|
||||||
|
<p>Sapper is a Next.js-style framework (<a href='blog/how-is-sapper-different-from-next'>more on that here</a>) built around Svelte. It makes it embarrassingly easy to create extremely high performance web apps. Out of the box, you get:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Code-splitting, dynamic imports and hot module replacement, powered by webpack</li>
|
||||||
|
<li>Server-side rendering (SSR) with client-side hydration</li>
|
||||||
|
<li>Service worker for offline support, and all the PWA bells and whistles</li>
|
||||||
|
<li>The nicest development experience you've ever had, or your money back</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>It's implemented as Express middleware. Everything is set up and waiting for you to get started, but you keep complete control over the server, service worker, webpack config and everything else, so it's as flexible as you need it to be.</p>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
posts.forEach(post => {
|
||||||
|
post.slug = post.title.toLowerCase().replace(/\W+/g, '-');
|
||||||
|
post.html = post.html.replace(/^\t{3}/gm, '');
|
||||||
|
});
|
||||||
|
|
||||||
|
export default posts;
|
@ -1,7 +0,0 @@
|
|||||||
<svelte:head>
|
|
||||||
<title>About</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>About this site</h1>
|
|
||||||
|
|
||||||
<p>This is the 'about' page. There's not much here.</p>
|
|
@ -1,28 +0,0 @@
|
|||||||
import posts from './_posts.js';
|
|
||||||
|
|
||||||
const lookup = new Map();
|
|
||||||
posts.forEach(post => {
|
|
||||||
lookup.set(post.slug, JSON.stringify(post));
|
|
||||||
});
|
|
||||||
|
|
||||||
export function get(req, res, next) {
|
|
||||||
// the `slug` parameter is available because
|
|
||||||
// this file is called [slug].json.js
|
|
||||||
const { slug } = req.params;
|
|
||||||
|
|
||||||
if (lookup.has(slug)) {
|
|
||||||
res.writeHead(200, {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
});
|
|
||||||
|
|
||||||
res.end(lookup.get(slug));
|
|
||||||
} else {
|
|
||||||
res.writeHead(404, {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
});
|
|
||||||
|
|
||||||
res.end(JSON.stringify({
|
|
||||||
message: `Not found`
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
<script context="module">
|
|
||||||
export async function preload({ params, query }) {
|
|
||||||
// the `slug` parameter is available because
|
|
||||||
// this file is called [slug].svelte
|
|
||||||
const res = await this.fetch(`blog/${params.slug}.json`);
|
|
||||||
const data = await res.json();
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
|
||||||
return { post: data };
|
|
||||||
} else {
|
|
||||||
this.error(res.status, data.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export let post;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
/*
|
|
||||||
By default, CSS is locally scoped to the component,
|
|
||||||
and any unused styles are dead-code-eliminated.
|
|
||||||
In this page, Svelte can't know which elements are
|
|
||||||
going to appear inside the {{{post.html}}} block,
|
|
||||||
so we have to use the :global(...) modifier to target
|
|
||||||
all elements inside .content
|
|
||||||
*/
|
|
||||||
.content :global(h2) {
|
|
||||||
font-size: 1.4em;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content :global(pre) {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.05);
|
|
||||||
padding: 0.5em;
|
|
||||||
border-radius: 2px;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content :global(pre) :global(code) {
|
|
||||||
background-color: transparent;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content :global(ul) {
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content :global(li) {
|
|
||||||
margin: 0 0 0.5em 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<svelte:head>
|
|
||||||
<title>{post.title}</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>{post.title}</h1>
|
|
||||||
|
|
||||||
<div class='content'>
|
|
||||||
{@html post.html}
|
|
||||||
</div>
|
|
@ -1,92 +0,0 @@
|
|||||||
// Ordinarily, you'd generate this data from markdown files in your
|
|
||||||
// repo, or fetch them from a database of some kind. But in order to
|
|
||||||
// avoid unnecessary dependencies in the starter template, and in the
|
|
||||||
// service of obviousness, we're just going to leave it here.
|
|
||||||
|
|
||||||
// This file is called `_posts.js` rather than `posts.js`, because
|
|
||||||
// we don't want to create an `/blog/posts` route — the leading
|
|
||||||
// underscore tells Sapper not to do that.
|
|
||||||
|
|
||||||
const posts = [
|
|
||||||
{
|
|
||||||
title: 'What is Sapper?',
|
|
||||||
slug: 'what-is-sapper',
|
|
||||||
html: `
|
|
||||||
<p>First, you have to know what <a href='https://svelte.dev'>Svelte</a> is. Svelte is a UI framework with a bold new idea: rather than providing a library that you write code with (like React or Vue, for example), it's a compiler that turns your components into highly optimized vanilla JavaScript. If you haven't already read the <a href='https://svelte.dev/blog/frameworks-without-the-framework'>introductory blog post</a>, you should!</p>
|
|
||||||
|
|
||||||
<p>Sapper is a Next.js-style framework (<a href='blog/how-is-sapper-different-from-next'>more on that here</a>) built around Svelte. It makes it embarrassingly easy to create extremely high performance web apps. Out of the box, you get:</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Code-splitting, dynamic imports and hot module replacement, powered by webpack</li>
|
|
||||||
<li>Server-side rendering (SSR) with client-side hydration</li>
|
|
||||||
<li>Service worker for offline support, and all the PWA bells and whistles</li>
|
|
||||||
<li>The nicest development experience you've ever had, or your money back</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>It's implemented as Express middleware. Everything is set up and waiting for you to get started, but you keep complete control over the server, service worker, webpack config and everything else, so it's as flexible as you need it to be.</p>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: 'How to use Sapper',
|
|
||||||
slug: 'how-to-use-sapper',
|
|
||||||
html: `
|
|
||||||
<h2>Step one</h2>
|
|
||||||
<p>Create a new project, using <a href='https://github.com/Rich-Harris/degit'>degit</a>:</p>
|
|
||||||
|
|
||||||
<pre><code>npx degit "sveltejs/sapper-template#rollup" my-app
|
|
||||||
cd my-app
|
|
||||||
npm install # or yarn!
|
|
||||||
npm run dev
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h2>Step two</h2>
|
|
||||||
<p>Go to <a href='http://localhost:3000'>localhost:3000</a>. Open <code>my-app</code> in your editor. Edit the files in the <code>src/routes</code> directory or add new ones.</p>
|
|
||||||
|
|
||||||
<h2>Step three</h2>
|
|
||||||
<p>...</p>
|
|
||||||
|
|
||||||
<h2>Step four</h2>
|
|
||||||
<p>Resist overdone joke formats.</p>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: 'Why the name?',
|
|
||||||
slug: 'why-the-name',
|
|
||||||
html: `
|
|
||||||
<p>In war, the soldiers who build bridges, repair roads, clear minefields and conduct demolitions — all under combat conditions — are known as <em>sappers</em>.</p>
|
|
||||||
|
|
||||||
<p>For web developers, the stakes are generally lower than those for combat engineers. But we face our own hostile environment: underpowered devices, poor network connections, and the complexity inherent in front-end engineering. Sapper, which is short for <strong>S</strong>velte <strong>app</strong> mak<strong>er</strong>, is your courageous and dutiful ally.</p>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: 'How is Sapper different from Next.js?',
|
|
||||||
slug: 'how-is-sapper-different-from-next',
|
|
||||||
html: `
|
|
||||||
<p><a href='https://github.com/zeit/next.js'>Next.js</a> is a React framework from <a href='https://vercel.com/'>Vercel</a>, and is the inspiration for Sapper. There are a few notable differences, however:</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>It's powered by <a href='https://svelte.dev'>Svelte</a> instead of React, so it's faster and your apps are smaller</li>
|
|
||||||
<li>Instead of route masking, we encode route parameters in filenames. For example, the page you're looking at right now is <code>src/routes/blog/[slug].svelte</code></li>
|
|
||||||
<li>As well as pages (Svelte components, which render on server or client), you can create <em>server routes</em> in your <code>routes</code> directory. These are just <code>.js</code> files that export functions corresponding to HTTP methods, and receive Express <code>request</code> and <code>response</code> objects as arguments. This makes it very easy to, for example, add a JSON API such as the one <a href='blog/how-is-sapper-different-from-next.json'>powering this very page</a></li>
|
|
||||||
<li>Links are just <code><a></code> elements, rather than framework-specific <code><Link></code> components. That means, for example, that <a href='blog/how-can-i-get-involved'>this link right here</a>, despite being inside a blob of HTML, works with the router as you'd expect.</li>
|
|
||||||
</ul>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: 'How can I get involved?',
|
|
||||||
slug: 'how-can-i-get-involved',
|
|
||||||
html: `
|
|
||||||
<p>We're so glad you asked! Come on over to the <a href='https://github.com/sveltejs/svelte'>Svelte</a> and <a href='https://github.com/sveltejs/sapper'>Sapper</a> repos, and join us in the <a href='https://svelte.dev/chat'>Discord chatroom</a>. Everyone is welcome, especially you!</p>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
posts.forEach(post => {
|
|
||||||
post.html = post.html.replace(/^\t{3}/gm, '');
|
|
||||||
});
|
|
||||||
|
|
||||||
export default posts;
|
|
@ -1,16 +0,0 @@
|
|||||||
import posts from './_posts.js';
|
|
||||||
|
|
||||||
const contents = JSON.stringify(posts.map(post => {
|
|
||||||
return {
|
|
||||||
title: post.title,
|
|
||||||
slug: post.slug
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
|
|
||||||
export function get(req, res) {
|
|
||||||
res.writeHead(200, {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
});
|
|
||||||
|
|
||||||
res.end(contents);
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
<script context="module">
|
|
||||||
export function preload({ params, query }) {
|
|
||||||
return this.fetch(`blog.json`).then(r => r.json()).then(posts => {
|
|
||||||
return { posts };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export let posts;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
ul {
|
|
||||||
margin: 0 0 1em 0;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<svelte:head>
|
|
||||||
<title>Blog</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>Recent posts</h1>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{#each posts as post}
|
|
||||||
<!-- we're using the non-standard `rel=prefetch` attribute to
|
|
||||||
tell Sapper to load the data for the page as soon as
|
|
||||||
the user hovers over the link or taps it, instead of
|
|
||||||
waiting for the 'click' event -->
|
|
||||||
<li><a rel='prefetch' href='blog/{post.slug}'>{post.title}</a></li>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
@ -30,17 +30,30 @@
|
|||||||
font-size: 4em;
|
font-size: 4em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.background {
|
||||||
|
background: url('/cityscape.jpg') no-repeat center;
|
||||||
|
background-size: cover;
|
||||||
|
position: fixed;
|
||||||
|
height: 16rem;
|
||||||
|
width: 100vw;
|
||||||
|
z-index: 0;
|
||||||
|
filter: blur(5px);
|
||||||
|
}
|
||||||
|
div.content {
|
||||||
|
margin-top: 5rem;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Sapper project template</title>
|
<title>HOWFEED.BIZ</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<h1>Great success!</h1>
|
<div class="background"></div>
|
||||||
|
<div class="content">
|
||||||
|
<h1 class="uppercase">Welcome</h1>
|
||||||
<figure>
|
<figure>
|
||||||
<img alt='Success Kid' src='successkid.jpg'>
|
|
||||||
<figcaption>Have fun with Sapper!</figcaption>
|
<figcaption>Have fun with Sapper!</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
</div>
|
||||||
<p><strong>Try editing this file (src/routes/index.svelte) to test live reloading.</strong></p>
|
|
||||||
|
@ -4,30 +4,14 @@
|
|||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta name='viewport' content='width=device-width,initial-scale=1.0'>
|
<meta name='viewport' content='width=device-width,initial-scale=1.0'>
|
||||||
<meta name='theme-color' content='#333333'>
|
<meta name='theme-color' content='#333333'>
|
||||||
|
|
||||||
%sapper.base%
|
%sapper.base%
|
||||||
|
|
||||||
<link rel='stylesheet' href='global.css'>
|
<link rel='stylesheet' href='global.css'>
|
||||||
<link rel='manifest' href='manifest.json' crossorigin='use-credentials'>
|
|
||||||
<link rel='icon' type='image/png' href='favicon.png'>
|
<link rel='icon' type='image/png' href='favicon.png'>
|
||||||
|
|
||||||
<!-- Sapper generates a <style> tag containing critical CSS
|
|
||||||
for the current page. CSS for the rest of the app is
|
|
||||||
lazily loaded when it precaches secondary pages -->
|
|
||||||
%sapper.styles%
|
%sapper.styles%
|
||||||
|
|
||||||
<!-- This contains the contents of the <svelte:head> component, if
|
|
||||||
the current page has one -->
|
|
||||||
%sapper.head%
|
%sapper.head%
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- The application will be rendered inside this element,
|
|
||||||
because `src/client.js` references it -->
|
|
||||||
<div id='sapper'>%sapper.html%</div>
|
<div id='sapper'>%sapper.html%</div>
|
||||||
|
|
||||||
<!-- Sapper creates a <script> tag containing `src/client.js`
|
|
||||||
and anything else it needs to hydrate the app and
|
|
||||||
initialise the router -->
|
|
||||||
%sapper.scripts%
|
%sapper.scripts%
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
BIN
static/cityscape.jpg
Normal file
After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
static/logo.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"background_color": "#ffffff",
|
|
||||||
"theme_color": "#333333",
|
|
||||||
"name": "TODO",
|
|
||||||
"short_name": "TODO",
|
|
||||||
"display": "minimal-ui",
|
|
||||||
"start_url": "/",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "logo-192.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "logo-512.png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Before Width: | Height: | Size: 77 KiB |