fix(site-2): Home page styles(pt 2) (#8720)

* DocsNav

* Push

* Nav title on each page

* Install jridgewell sourcemap codec. Why it breaking suddenly

* Use theme store

* Use $nav_title

* use $page.data.nav_title

* Disable global prerendering

* Fix Suppprters section

* use new method

* Initially hidden nav functionality

* Minor fixes

* Simplify into one single nav

* Accomodate to the bottom nav

* Minor fixes

* nit

* Add selected to other pages as well

* New way of passing to navbar

* Code cleanup

* Directly pass list instead of components

* 14 days

* Fix comment

* Discord icon

* Homepage styles

* More tweak, extra CTA

* Bigger lowercase tagline

* Preload overpass for transitions demo

* Tweak for ipad air

* Remove letter spacing

* simplify home page styles (#8738)

* simplify

* fix

* slightly better use of space

* tiny bit more room

* read the docs

* crop image

* very minor tweak

* another breakpoint

* tweak

* actually it works down to 1400px

---------

Co-authored-by: Rich Harris <git@rich-harris.dev>

---------

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Rich Harris <git@rich-harris.dev>
pull/8742/head
Puru Vijay 1 year ago committed by GitHub
parent 62bef809b2
commit 9d33d14ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,17 +191,17 @@ importers:
specifier: ^5.0.0
version: 5.0.0
'@types/node':
specifier: ^20.2.5
version: 20.2.5
specifier: ^20.2.6
version: 20.2.6
'@types/prettier':
specifier: ^2.7.2
version: 2.7.2
specifier: ^2.7.3
version: 2.7.3
degit:
specifier: ^2.8.4
version: 2.8.4
dotenv:
specifier: ^16.1.0
version: 16.1.0
specifier: ^16.1.4
version: 16.1.4
jimp:
specifier: ^0.22.8
version: 0.22.8
@ -209,8 +209,8 @@ importers:
specifier: ^0.30.0
version: 0.30.0
marked:
specifier: ^5.0.3
version: 5.0.3
specifier: ^5.1.0
version: 5.1.0
node-fetch:
specifier: ^3.3.1
version: 3.3.1
@ -255,7 +255,7 @@ importers:
version: 5.0.4
vite:
specifier: ^4.3.9
version: 4.3.9(@types/node@20.2.5)(sass@1.62.1)
version: 4.3.9(@types/node@20.2.6)(sass@1.62.1)
vite-imagetools:
specifier: ^5.0.4
version: 5.0.4
@ -1742,7 +1742,7 @@ packages:
svelte: link:packages/svelte
tiny-glob: 0.2.9
undici: 5.22.1
vite: 4.3.9(@types/node@20.2.5)(sass@1.62.1)
vite: 4.3.9(@types/node@20.2.6)(sass@1.62.1)
transitivePeerDependencies:
- supports-color
@ -1772,7 +1772,7 @@ packages:
codemirror: 6.0.1(@lezer/common@1.0.3)
esm-env: 1.0.0
estree-walker: 3.0.3
marked: 5.0.3
marked: 5.1.0
resolve.exports: 2.0.2
svelte: link:packages/svelte
svelte-json-tree: 1.0.0
@ -1820,7 +1820,7 @@ packages:
'@sveltejs/vite-plugin-svelte': 2.4.1(svelte@packages+svelte)(vite@4.3.9)
debug: 4.3.4
svelte: link:packages/svelte
vite: 4.3.9(@types/node@20.2.5)(sass@1.62.1)
vite: 4.3.9(@types/node@20.2.6)(sass@1.62.1)
transitivePeerDependencies:
- supports-color
@ -1838,7 +1838,7 @@ packages:
magic-string: 0.30.0
svelte: link:packages/svelte
svelte-hmr: 0.15.2(svelte@packages+svelte)
vite: 4.3.9(@types/node@20.2.5)(sass@1.62.1)
vite: 4.3.9(@types/node@20.2.6)(sass@1.62.1)
vitefu: 0.2.4(vite@4.3.9)
transitivePeerDependencies:
- supports-color
@ -1912,8 +1912,8 @@ packages:
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
dev: true
/@types/node@20.2.5:
resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==}
/@types/node@20.2.6:
resolution: {integrity: sha512-GQBWUtGoefMEOx/vu+emHEHU5aw6JdDoEtZhoBrHFPZbA/YNRFfN996XbBASEWdvmLSLyv9FKYppYGyZjCaq/g==}
/@types/normalize-package-data@2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
@ -1923,8 +1923,8 @@ packages:
resolution: {integrity: sha512-qwfpsHmFuhAS/dVd4uBIraMxRd56vwBUYQGZ6GpXnFuM2XMRFJbIyruFKKlW2daQliuYZwe0qfn/UjFCDKic5g==}
dev: false
/@types/prettier@2.7.2:
resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==}
/@types/prettier@2.7.3:
resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==}
dev: true
/@types/pug@2.0.6:
@ -1946,7 +1946,7 @@ packages:
/@types/websocket@1.0.5:
resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==}
dependencies:
'@types/node': 20.2.5
'@types/node': 20.2.6
dev: false
/@typescript-eslint/eslint-plugin@5.59.7(@typescript-eslint/parser@5.59.7)(eslint@8.41.0)(typescript@5.0.4):
@ -2959,8 +2959,8 @@ packages:
engines: {node: '>=12'}
dev: true
/dotenv@16.1.0:
resolution: {integrity: sha512-XiwP/4cqatBNLEnKe169vPZCrovUmYngyVA4DgZ3uIVLJfZaBgr4uT0EF2TrEQqgWDDlekGo0muEYme5SR78Ww==}
/dotenv@16.1.4:
resolution: {integrity: sha512-m55RtE8AsPeJBpOIFKihEmqUcoVncQIwo7x9U8ZwLEZw9ZpXboz2c+rvog+jUaJvVrZ5kBOeYQBX5+8Aa/OZQw==}
engines: {node: '>=12'}
dev: true
@ -4388,8 +4388,8 @@ packages:
engines: {node: '>=8'}
dev: true
/marked@5.0.3:
resolution: {integrity: sha512-KUONa43Uk74uUNWMxh6lfaNYmSAsRMiDAaX8QBCCRVXzEufR0zX6T33vrGbvTnQLL02ungDM3KSzZtO+chJaHg==}
/marked@5.1.0:
resolution: {integrity: sha512-z3/nBe7aTI8JDszlYLk7dDVNpngjw0o1ZJtrA9kIfkkHcIF+xH7mO23aISl4WxP83elU+MFROgahqdpd05lMEQ==}
engines: {node: '>= 18'}
hasBin: true
@ -6230,7 +6230,7 @@ packages:
fsevents: 2.3.2
dev: true
/vite@4.3.9(@types/node@20.2.5)(sass@1.62.1):
/vite@4.3.9(@types/node@20.2.6)(sass@1.62.1):
resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
@ -6255,7 +6255,7 @@ packages:
terser:
optional: true
dependencies:
'@types/node': 20.2.5
'@types/node': 20.2.6
esbuild: 0.17.19
postcss: 8.4.23
rollup: 3.23.0
@ -6271,7 +6271,7 @@ packages:
vite:
optional: true
dependencies:
vite: 4.3.9(@types/node@20.2.5)(sass@1.62.1)
vite: 4.3.9(@types/node@20.2.6)(sass@1.62.1)
/vitest@0.31.1(happy-dom@9.20.3)(jsdom@21.1.2)(playwright@1.34.3):
resolution: {integrity: sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==}

@ -32,13 +32,13 @@
"@sveltejs/site-kit": "6.0.0-next.1",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@types/marked": "^5.0.0",
"@types/node": "^20.2.5",
"@types/prettier": "^2.7.2",
"@types/node": "^20.2.6",
"@types/prettier": "^2.7.3",
"degit": "^2.8.4",
"dotenv": "^16.1.0",
"dotenv": "^16.1.4",
"jimp": "^0.22.8",
"magic-string": "^0.30.0",
"marked": "^5.0.3",
"marked": "^5.1.0",
"node-fetch": "^3.3.1",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",

@ -31,6 +31,10 @@
let selected = examples[0];
</script>
<svelte:head>
<link rel="prefetch" href="/fonts/overpass/overpass-latin-400.woff2" />
</svelte:head>
<Section --background="var(--sk-back-2)">
<h3>Why Svelte?</h3>

@ -1,109 +1,161 @@
<script>
import Image from './Image.svelte';
import { Icon } from '@sveltejs/site-kit/components';
import SvelteLogotype from './svelte-logotype.svg';
// @ts-ignore
import MachineDesktop from './svelte-machine-desktop.png?w=1200;2000;2800;4400&format=avif;webp;png;&as=picture';
// @ts-ignore
import MachineMobile from './svelte-machine-mobile.png?w=960&format=avif;webp;png;&as=picture';
import Machine from './svelte-machine.png?big-image';
const srcset = (sources) => sources.map(({ src, w }) => `${src} ${w}w`).join(', ');
</script>
<div class="hero">
<strong>Cybernetically enhanced web apps</strong>
<Image
src={Machine}
alt="The Svelte compiler packaging up your component code"
--max-height="60vh"
/>
<img alt="Svelte logotype" class="logotype" src={SvelteLogotype} />
<div class="hero-content">
<img alt="Svelte logotype" class="logotype" src={SvelteLogotype} />
<strong>
<span style="white-space: nowrap;">Cybernetically enhanced</span> <br /> web apps
</strong>
<div class="buttons">
<a href="https://learn.svelte.dev" rel="external" class="cta">
tutorial <Icon name="arrow-right" />
</a>
<a href="/docs/introduction" class="cta basic">read the docs</a>
</div>
</div>
<picture class="machine">
<source
srcset={srcset(MachineDesktop.sources.avif)}
type="image/avif"
media="(min-width: 800px)"
/>
<source
srcset={srcset(MachineDesktop.sources.webp)}
type="image/webp"
media="(min-width: 800px)"
/>
<source
srcset={srcset(MachineDesktop.sources.png)}
type="image/png"
media="(min-width: 800px)"
/>
<source srcset={srcset(MachineMobile.sources.avif)} type="image/avif" />
<source srcset={srcset(MachineMobile.sources.webp)} type="image/webp" />
<source srcset={srcset(MachineMobile.sources.png)} type="image/png" />
<img alt="The Svelte compiler packaging up your component code" src={MachineMobile.img.src} />
</picture>
</div>
<style>
.hero {
position: relative;
background: radial-gradient(circle at 40% 30%, rgb(235, 243, 249), rgb(214, 222, 228));
height: 40vh;
padding: 6rem 0 34vw 0;
margin-bottom: 3rem;
}
.hero :global(picture img) {
width: 240%;
transform: translateX(-26%);
.machine img {
position: absolute;
pointer-events: none;
}
.logotype {
display: none;
.hero-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
margin-bottom: 4rem;
}
strong {
position: absolute;
font-size: min(4vw, var(--sk-text-s));
max-width: 10em;
text-transform: uppercase;
font-weight: 700;
font-size: var(--sk-text-l);
text-align: center;
font-family: var(--sk-font);
text-transform: lowercase;
font-weight: 400;
color: var(--sk-text-2);
line-height: 1.2;
}
.buttons {
display: flex;
gap: 1rem;
align-items: center;
}
.cta {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: var(--sk-theme-1);
padding: 0.35em 0.8em;
font-size: var(--sk-text-s);
letter-spacing: 0.05em;
left: max(var(--sk-page-padding-side), 10%);
top: 25%;
white-space: nowrap;
border-radius: var(--sk-border-radius);
box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.08);
color: #fff;
color: color-mix(in hwb, hsl(var(--sk-theme-1-hsl)) 10%, var(--sk-back-1) 95%);
transition: 0.5s var(--quint-out);
transition-property: transform, box-shadow, color;
}
@media (min-width: 580px) {
strong {
max-width: 12em;
top: 30%;
}
.cta:hover {
text-decoration: none;
box-shadow: 0px 0.8px 3.8px rgba(0, 0, 0, 0.115), 0px 6px 30px rgba(0, 0, 0, 0.23);
transform: scale3d(1.01, 1.01, 1);
}
.hero {
height: 42vh;
}
.cta.basic {
background-color: var(--sk-back-5);
.hero :global(picture img) {
width: 220%;
transform: translateX(-26%);
}
color: var(--sk-text-1);
}
.logotype {
width: min(45vw, 40em);
}
@media (min-width: 800px) {
.logotype {
.hero-content {
--width: clamp(60rem, 50vw, 80rem);
position: absolute;
display: block;
width: min(30vw, 36rem);
bottom: 54%;
left: 15%;
display: grid;
grid-template-columns: 1fr 1fr;
grid-column-gap: 4rem;
grid-row-gap: 2rem;
width: var(--width);
left: calc(0.5 * (100% - min(100vw, 120rem)) + var(--sk-page-padding-side));
top: 6rem;
font-size: 0.9em;
}
strong {
max-width: 16em;
top: 49%;
.logotype {
width: 100%;
justify-self: end;
}
.logotype,
strong {
left: calc(var(--sk-page-padding-side) + 8rem);
text-align: left;
font-size: calc(0.04 * var(--width));
}
.hero {
height: 44vh;
}
.hero :global(picture img) {
width: 160%;
transform: translateX(-14%);
height: calc(14rem + 20vw);
padding: 14rem 0 0 0;
}
}
@media (min-width: 1200px) {
strong,
.logotype {
left: calc(50% - 56rem + var(--sk-page-padding-side));
@media (min-width: 1400px) {
.hero-content {
grid-template-columns: 1fr;
width: calc(0.5 * var(--width));
top: 6vw;
}
.hero {
height: 45vh;
}
.hero :global(picture img) {
width: 120%;
transform: translateX(-10%);
height: calc(10rem + 20vw);
padding: 10rem 0 0 0;
}
}

@ -26,7 +26,6 @@
display: block;
width: 100%;
height: auto;
max-height: var(--max-height, 100%);
object-fit: cover;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Loading…
Cancel
Save