homepage changes

pull/2437/head
Achim Vedam 6 years ago
parent 83f57046fa
commit 802fe40128

@ -1,7 +1,6 @@
<script>
import { onMount } from 'svelte';
import Icon from './Icon.svelte';
import Logo from './Logo.svelte';
export let segment;
@ -78,17 +77,6 @@
box-shadow: none;
}
h2 {
display: block;
text-transform: uppercase;
font-weight: 300;
font-size: 2.8rem;
letter-spacing: .12em;
line-height: 1;
margin: 0;
top: .1rem;
}
.primary {
list-style: none;
font-family: var(--font);
@ -142,7 +130,7 @@
}
ul li a {
font-size: var(--h6);
font-size: var(--h5);
padding: 0 .8rem;
}
@ -158,15 +146,14 @@
.home {
position: relative;
top: 0;
top: -.1rem;
width: 18rem;
color: var(--second);
height: 4.2rem;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
z-index: 11;
padding: 0.5rem 0 0.3rem 4.2rem;
background: url(/logo.svg) 0 50% no-repeat;
background: url(/svelte-logo-horizontal.svg) 0 50% no-repeat;
background-size: auto 100%;
z-index: 11;
}
.active {
@ -192,7 +179,7 @@
}
ul.open li a {
font-size: var(--h6);
font-size: var(--h5);
padding: 0 .8rem;
display: inline;
}
@ -215,9 +202,7 @@
<header class:visible="{visible || open}">
<nav>
<a rel="prefetch" href='.' class="home" title='Homepage'>
<h2>Svelte</h2>
</a>
<a rel="prefetch" href='.' class="home" title='Homepage'></a>
<ul
bind:this={ul}

@ -1,3 +1,7 @@
<script>
import Icon from '../../components/Icon.svelte';
</script>
<style>
.container {
position: relative;
@ -7,78 +11,47 @@
max-width: 120rem;
grid-row-gap: 1em;
grid-template-areas:
"one"
"two"
"three"
"what"
"start";
}
.box {
padding: 1em;
display: flex;
flex-direction: column;
'one'
'two'
'three'
'what'
'start';
}
h2 {
padding: 0;
margin: 0 0 0.5em 0;
font-size: var(--h2);
padding: 0;
color: white;
text-align: left;
}
p {
font-size: var(--h5);
h3 {
margin: 0 0 1.6rem 0;
color: black;
}
.box {
padding: 1em;
display: flex;
flex-direction: column;
}
.box a {
position: relative;
text-align: right;
margin-top: auto;
padding: 0 1.2em 0 0;
font-family: Roboto, sans-serif;
font-size: 1.6rem;
font-weight: 700;
padding: 0 2.4rem 0 0;
}
.box a:hover {
color: white;
text-decoration: underline;
.box a :global(svg) {
stroke: white;
}
.box a::after, .cta a::after {
content: '';
position: absolute;
display: block;
right: 0;
top: 0.35em;
width: 1em;
height: 1em;
background: url(/icons/arrow-right.svg);
}
.cta a {
display: inline-block;
text-align: right;
background-color: var(--prime);
padding: 0.5em 1.8em 0.5em 1em;
border-radius: var(--border-r);
.box a:hover {
color: white;
position: relative;
}
.cta a::after {
right: 0.5em;
top: 0.75em;
}
.description {
margin: 2em 0 0 0;
text-decoration: underline;
}
.cta {
margin: 0;
}
.description { margin: 2em 0 0 0 }
@media (min-width: 900px) {
.container {
@ -86,18 +59,12 @@
grid-row-gap: 1em;
grid-template-columns: repeat(2, 1fr);
grid-template-areas:
"one two"
"three start"
"what what";
}
.box {
padding: 2em;
'one two'
'three start'
'what what';
}
.cta {
text-align: right;
}
.box { padding: 2em }
}
@media (min-width: 1200px) {
@ -106,52 +73,70 @@
grid-row-gap: 5em;
grid-template-columns: repeat(6, 1fr);
grid-template-areas:
"one one two two three three"
"what what what start start start";
'one one two two three three'
'what what what start start start';
}
.description {
margin: 0;
}
.cta {
text-align: left;
}
.description { margin: 0 }
}
</style>
<section class='container'>
<div class='box bg-prime white' style="grid-area: one">
<h2 style='padding:2.4rem 0 0 0'>Write less code</h2>
<p>Build boilerplate-free components using languages you already know — HTML, CSS and JavaScript</p>
<section class="container">
<div class="box bg-prime white" style="grid-area: one">
<h2>Write less code</h2>
<p>
Build boilerplate-free components using languages you already know — HTML, CSS and JavaScript
</p>
<a href="TODO-blog-post-on-loc">learn more</a>
<a href="TODO-blog-post-on-loc">
discover how <Icon name="arrow-right"/>
</a>
</div>
<div class='box bg-flash white' style="grid-area: two">
<h2 style='padding:2.4rem 0 0 0'>No virtual DOM</h2>
<p>Svelte compiles your code to tiny, framework-less vanilla JS — your app starts fast and stays fast</p>
<div class="box bg-flash white" style="grid-area: two">
<h2>No virtual DOM</h2>
<p>
Svelte compiles your code to tiny, framework-less vanilla JS — your app
starts fast and stays fast
</p>
<a href="TODO-blog-post-on-vdom-overhead">learn more</a>
<a href="TODO-blog-post-on-vdom-overhead">
wonder why <Icon name="arrow-right"/>
</a>
</div>
<div class='box bg-second white' style="grid-area: three">
<h2 style='padding:2.4rem 0 0 0'>Truly reactive</h2>
<p>No more complex state management libraries — Svelte brings reactivity to JavaScript itself</p>
<div class="box bg-second white" style="grid-area: three">
<h2>Truly reactive</h2>
<p>
No more complex state management libraries — Svelte brings reactivity to JavaScript itself
</p>
<a href="TODO-blog-post-on-reactivity">learn more</a>
<a href="TODO-blog-post-on-reactivity">
experience how <Icon name="arrow-right"/>
</a>
</div>
<div class="linkify description" style="grid-area: what;">
<p>Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the <em>browser</em>, Svelte shifts that work into a <em>compile step</em> that happens when you build your app.</p>
<p>Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.</p>
<p><a href="TODO-svelte-3-blog-post">Read the introductory blog post</a> to learn more.</p>
<h3>Svelte up your life</h3>
<p>
Svelte is a radical new approach to building user interfaces. Whereas
traditional frameworks do the bulk of their work in the <em>browser</em>, Svelte shifts that work into a <em>compile step</em> that happens when you build your app.
</p>
<p>
Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.
</p>
<p>
Read the <a href="TODO-svelte-3-blog-post">introductory blog post</a>
to learn more
</p>
</div>
<div style="grid-area: start; display: flex; flex-direction: column">
<h3>Convince yourself</h3>
<pre class="language-bash" style="margin: 0 0 1em 0">
# quick install
npx degit sveltejs/template my-svelte-project
cd my-svelte-project
@ -159,8 +144,12 @@ npm install
npm run dev & open http://localhost:5000
</pre>
<p class="linkify" style="flex: 1">See the <a href="blog/the-easiest-way-to-get-started">quickstart guide</a> for more information.</p>
<p class="linkify" style="flex: 1">
See the <a href="blog/the-easiest-way-to-get-started">quickstart guide </a> for more information.
</p>
<p class="cta"><a rel="prefetch" href="tutorial">Learn Svelte</a></p>
<p><a class="btn bg-prime white" rel="prefetch" href="tutorial">
Learn Svelte <Icon name="arrow-right"/>
</a></p>
</div>
</section>

@ -13,32 +13,23 @@
margin: 1em 0 0 0;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
a {
height: 40px;
margin: 0 0.5em 0.5em 0;
a:not(.btn) {
height: 5rem;
margin: 0 1.6rem 3.2rem;
text-decoration: none;
border: 1px solid #aaa;
padding: 5px 10px;
border-radius: 20px;
}
.add-yourself {
display: flex;
align-items: center;
border: 1px solid #eee;
}
img {
height: 100%;
}
img { height: 100% }
@media (min-width: 540px) {
a {
height: 60px;
padding: 10px 20px;
border-radius: 30px;
a:not(.btn) {
height: 6rem;
padding: 1rem 2rem;
border-radius: var(--border-r);
}
}
</style>
@ -54,5 +45,5 @@
<a href="https://www.nesta.org.uk"><img src="organisations/nesta.svg" alt="Nesta logo"></a>
<a href="https://nytimes.com"><img src="organisations/nyt.svg" alt="The New York Times logo"></a>
<a href="https://www.stone.co"><img src="organisations/stone.svg" alt="Stone Payments logo"></a>
<a href="https://github.com/sveltejs/svelte/blob/master/site/src/routes/_components/WhosUsingSvelte.svelte" class="add-yourself"><span>+ your company?</span></a>
<p><a href="https://github.com/sveltejs/svelte/blob/master/site/src/routes/_components/WhosUsingSvelte.svelte" class="btn bg-flash white">+ your company?</a></p>
</div>

@ -1,6 +1,4 @@
<script>
import Icon from '../components/Icon.svelte';
import Logo from '../components/Logo.svelte';
import Blurb from './_components/Blurb.svelte';
import WhosUsingSvelte from './_components/WhosUsingSvelte.svelte';
import IntersectionObserver from '../components/IntersectionObserver.svelte';
@ -25,9 +23,8 @@
max-width: 120rem;
}
.container ul {
list-style: none;
}
.container h3 { color: black }
.container ul { list-style: none }
/* max line-length ~60 chars */
li:not(.box) > p {
@ -39,54 +36,43 @@
--text: hsl(36, 3%, 44%);
}
.hero { height: 20rem }
.hero h3 {
position: relative;
margin: -3.2rem 0 0 3rem;
}
.logo {
position: absolute;
left: -120px;
top: -120px;
width: 80vmin;
height: 80vmin;
opacity: 0.1;
top: -23rem;
right: -4rem;
width: 68rem;
height: 68rem;
mix-blend-mode: multiply;
will-change: transform;
}
.hero h1 {
text-align: center;
margin: 2rem 0;
font-size: 6rem;
color: var(--heading);
font-weight: 100;
letter-spacing: .12em;
text-transform: uppercase;
}
.hero h2 {
text-align: center;
display: block;
position: relative;
font-size: 3.2rem;
text-align: center;
width: 100%;
text-transform: lowercase;
font-weight: 300;
opacity: 0.7;
.logotype {
margin: 2rem 0 0 0;
height: 12rem;
}
.examples {
background: var(--second);
color: white;
/* padding: 2em 0; */
overflow: hidden;
}
.example {
/* background: var(--second);
color: white;
padding: 0.8rem;
border-radius: var(--border-r); */
width: 100%;
height: 420px;
}
.example > p {
margin: 4.4rem 2.4rem 2.4rem 0;
}
.repl-container {
width: 100%;
height: 100%;
@ -94,10 +80,6 @@
overflow: hidden;
}
.example > div:first-child {
/* padding: 0.8rem; */
}
.contributor {
width: 2.4em;
height: 2.4em;
@ -107,26 +89,17 @@
background: no-repeat url(/contributors.jpg);
background-size: auto 102%;
margin: 0 0.5em 0.5em 0;
border: 1px solid var(--second);
border: .2rem solid var(--second);
}
@media (min-width: 920px) {
.example {
display: grid;
grid-template-columns: 1fr 4fr;
grid-template-columns: 1fr 3fr;
grid-gap: 0.5em;
align-items: start;
}
}
@media screen and (min-width: 870px) {
.hero h1 {
position: relative;
top: -.8rem;
font-size: 18rem;
margin: 2rem 2rem 0 1rem;
}
}
</style>
<svelte:head>
@ -135,20 +108,18 @@
<svelte:window bind:scrollY={sy}/>
<img alt="Svelte logo" class="logo" src="logo.svg" style="transform: translate(0,{sy * 0.2}px)">
<section class="hero container">
<h2>Cybernetically enhanced web apps</h2>
<h1>Svelte</h1>
<img alt="Svelte logotype" class="logotype" src="svelte-logotype.svg">
<h3>Cybernetically enhanced web apps</h3>
<img alt="Svelte logo" class="logo" src="svelte-logo-outline.svg" style="transform: translate(0, {sy * .7}px)">
</section>
<Blurb/>
<div class="examples">
<section class="container example linkify">
<div>
<p>Svelte components are built on top of HTML. Just add data.</p>
</div>
<p><b>A taste of Svelte</b><br/>Svelte components are built on top of HTML. Just add data.</p>
<div class="repl-container">
<IntersectionObserver once let:intersecting top={400}>
@ -161,9 +132,7 @@
</section>
<section class="container example linkify">
<div>
<p>CSS is component-scoped by default — no more style collisions or specificity wars. Or you can <a href="TODO-blog-post-on-css-in-js">use your favourite CSS-in-JS library</a>.</p>
</div>
<p><b>Scoped styles</b><br/>CSS is component-scoped by default — no more style collisions or specificity wars. Or you can <a href="TODO-blog-post-on-css-in-js">use your favourite CSS-in-JS library</a>.</p>
<div class="repl-container">
<IntersectionObserver once let:intersecting top={400}>
@ -176,9 +145,7 @@
</section>
<section class="container example linkify">
<div>
<p>Trigger efficient, granular updates by assigning to local variables. The compiler does the rest.</p>
</div>
<p><b>Intelligent compiler</b><br/>Trigger efficient, granular updates by assigning to local variables. The compiler does the rest.</p>
<div class="repl-container">
<IntersectionObserver once let:intersecting top={400}>
@ -191,9 +158,7 @@
</section>
<section class="container example linkify">
<div>
<p>Build beautiful UIs with a powerful, performant transition engine built right into the framework.</p>
</div>
<p><b>Build-in Transitions</b><br/>Create beautiful UIs with a powerful, performant transition engine built right into the framework.</p>
<div class="repl-container">
<IntersectionObserver once let:intersecting top={400}>

Loading…
Cancel
Save