Skip to content

Commit fa92b38

Browse files
authored
homepage tweak (#233)
* homepage tweak * tweak
1 parent b389522 commit fa92b38

File tree

10 files changed

+53
-109
lines changed

10 files changed

+53
-109
lines changed

apps/svelte.dev/src/routes/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<Hero />
2626

27-
<Blurb --background="var(--sk-back-1)">
27+
<Blurb>
2828
{#snippet one()}
2929
<div>
3030
<h2>fast</h2>

apps/svelte.dev/src/routes/_home/Features.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Section } from '@sveltejs/site-kit/components';
33
</script>
44

5-
<Section --background="var(--sk-back-1)">
5+
<Section>
66
<div class="container">
77
<div class="features">
88
<h2><span>features? we got 'em.</span></h2>
+42-99
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
<script>
2-
import SvelteLogotype from './svelte-logotype.svg';
3-
4-
// @ts-ignore
2+
// @ts-expect-error
53
import MachineDesktop from './svelte-machine-desktop.png?w=1200;2000;2800;4400&format=avif;webp;png;&as=picture';
6-
// @ts-ignore
4+
// @ts-expect-error
75
import MachineMobile from './svelte-machine-mobile.png?w=960&format=avif;webp;png;&as=picture';
86
</script>
97

108
<div class="hero">
119
<div class="hero-content">
12-
<img alt="Svelte logotype" class="logotype" src={SvelteLogotype} width="300" height="56" />
13-
<strong>
14-
<span style="white-space: nowrap">Web development</span> <br /> but fun
15-
</strong>
16-
<div class="buttons">
17-
<a href="/tutorial" class="cta">tutorial</a>
18-
<a href="/docs" class="cta basic">read the docs</a>
19-
</div>
10+
<h1>web development for the rest of us</h1>
11+
<a href="/docs" class="cta basic">get started</a>
2012
</div>
2113

2214
<picture class="machine">
@@ -51,16 +43,35 @@
5143
<style>
5244
.hero {
5345
position: relative;
54-
background: radial-gradient(circle at 40% 30%, rgb(235, 243, 249), rgb(214, 222, 228));
5546
padding: 6rem 0 34vw 0;
5647
margin-bottom: 3rem;
57-
}
5848
59-
.machine img {
60-
position: absolute;
61-
pointer-events: none;
62-
width: 100%;
63-
height: auto;
49+
&::before {
50+
content: '';
51+
position: absolute;
52+
width: 100%;
53+
height: 200%;
54+
left: 0;
55+
top: 0;
56+
background: linear-gradient(to bottom, transparent, var(--sk-back-1)),
57+
radial-gradient(circle at 40% 30%, rgb(235, 243, 249), rgb(214, 222, 228));
58+
}
59+
60+
:root.dark &::before {
61+
background: linear-gradient(to bottom, transparent, var(--sk-back-1)),
62+
radial-gradient(
63+
64.14% 72.25% at 47.58% 31.75%,
64+
hsl(209deg 6% 47% / 52%) 0%,
65+
hsla(0, 0%, 100%, 0) 100%
66+
),
67+
linear-gradient(
68+
92.4deg,
69+
hsl(210, 7%, 16%) 14.67%,
70+
hsl(0deg 0% 0% / 48%) 54.37%,
71+
hsla(207, 22%, 13%, 0.62) 92.49%
72+
),
73+
linear-gradient(0deg, hsl(204, 38%, 20%), hsl(204, 10%, 90%));
74+
}
6475
}
6576
6677
.hero-content {
@@ -69,78 +80,35 @@
6980
align-items: center;
7081
gap: 1rem;
7182
margin-bottom: 4rem;
83+
text-align: center;
7284
}
7385
74-
strong {
75-
font-size: var(--sk-font-size-h2);
76-
text-align: center;
77-
font-family: var(--sk-font-heading);
78-
text-transform: lowercase;
79-
font-weight: 400;
80-
color: var(--sk-text-2);
81-
line-height: 1.2;
86+
h1 {
87+
max-width: 9em;
8288
}
8389
84-
.buttons {
85-
display: flex;
86-
gap: 1rem;
87-
align-items: center;
90+
.machine img {
91+
position: absolute;
92+
pointer-events: none;
93+
width: 100%;
94+
height: auto;
8895
}
8996
9097
.cta {
91-
display: flex;
92-
align-items: center;
93-
gap: 0.1rem;
94-
background: var(--sk-theme-1);
95-
padding: 0.35em 0.8em;
9698
font-family: var(--sk-font-ui);
9799
font-size: var(--sk-font-size-ui-medium);
98-
font-weight: 600;
99-
white-space: nowrap;
100-
border-radius: var(--sk-border-radius);
101-
box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.08);
102-
color: #fff;
103-
transition: 0.5s var(--quint-out);
104-
transition-property: box-shadow, color;
105-
}
106-
107-
.cta:hover {
108-
text-decoration: none;
109-
box-shadow:
110-
0px 0.8px 3.8px rgba(0, 0, 0, 0.115),
111-
0px 6px 30px rgba(0, 0, 0, 0.23);
112-
}
113-
114-
.cta.basic {
115-
background-color: var(--sk-back-5);
116-
color: var(--sk-text-1);
117-
}
118-
119-
.logotype {
120-
width: min(45vw, 40em);
121-
height: auto;
100+
color: var(--sk-theme-1);
101+
text-transform: uppercase;
122102
}
123103
124104
@media (min-width: 800px) {
125105
.hero-content {
126106
--width: clamp(60rem, 50vw, 80rem);
107+
align-items: start;
127108
position: absolute;
128-
display: grid;
129-
grid-template-columns: 1fr 1fr;
130-
grid-column-gap: 4rem;
131-
grid-row-gap: 2rem;
132109
width: var(--width);
133110
left: calc(0.5 * (100% - min(100vw, 120rem)) + var(--sk-page-padding-side));
134-
top: 6rem;
135-
font-size: 0.9em;
136-
}
137-
138-
.logotype {
139-
width: 100%;
140-
justify-self: end;
141-
}
142-
143-
strong {
111+
top: calc(8vw - 2rem);
144112
text-align: left;
145113
}
146114
@@ -151,34 +119,9 @@
151119
}
152120
153121
@media (min-width: 1400px) {
154-
.hero-content {
155-
grid-template-columns: 1fr;
156-
width: calc(0.5 * var(--width));
157-
top: 6vw;
158-
}
159-
160122
.hero {
161123
height: calc(10rem + 20vw);
162124
padding: 10rem 0 0 0;
163125
}
164126
}
165-
166-
:global(html.dark) .hero {
167-
background: radial-gradient(
168-
64.14% 72.25% at 47.58% 31.75%,
169-
hsl(209deg 6% 47% / 52%) 0%,
170-
hsla(0, 0%, 100%, 0) 100%
171-
),
172-
linear-gradient(
173-
92.4deg,
174-
hsl(210, 7%, 16%) 14.67%,
175-
hsl(0deg 0% 0% / 48%) 54.37%,
176-
hsla(207, 22%, 13%, 0.62) 92.49%
177-
),
178-
linear-gradient(0deg, hsl(204, 38%, 20%), hsl(204, 10%, 90%));
179-
}
180-
181-
:global(html.dark) .logotype {
182-
filter: invert(4) brightness(1.2);
183-
}
184127
</style>

apps/svelte.dev/src/routes/tutorial/[slug]/Menu.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/** @type {import('$lib/tutorial').Exercise} */
1414
export let current;
1515
16-
const is_mobile = mql('(max-width: 800px)');
16+
const is_mobile = mql('(max-width: 799px)');
1717
1818
const duration = $reduced_motion ? 0 : 200;
1919
@@ -388,7 +388,7 @@
388388
outline-offset: -2px;
389389
}
390390
391-
@media screen and (max-width: 800px) {
391+
@media screen and (max-width: 799px) {
392392
.container {
393393
border-right: none;
394394
}

packages/site-kit/src/lib/components/Banner.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
display: none;
118118
}
119119
120-
@media screen and (max-width: 800px) {
120+
@media screen and (max-width: 799px) {
121121
.banner-bottom {
122122
bottom: initial;
123123
top: 0;

packages/site-kit/src/lib/components/Section.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
<style>
1212
section {
13+
position: relative;
1314
padding: 6rem 0;
14-
background: var(--background, white);
15+
background: var(--background, transparent);
1516
}
1617
1718
section::after {

packages/site-kit/src/lib/components/Shell.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The main shell of the application. It provides a slot for the top navigation, th
7878
overflow-x: hidden;
7979
}
8080
81-
@media (max-width: 800px) {
81+
@media (max-width: 799px) {
8282
main {
8383
padding-top: var(--sk-banner-bottom-height);
8484
padding-bottom: 0;

packages/site-kit/src/lib/home/Blurb.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let { one, two, three }: { one?: Snippet; two?: Snippet; three?: Snippet } = $props();
66
</script>
77

8-
<Section --background="var(--sk-back-1)">
8+
<Section>
99
<div class="grid">
1010
{#if one}
1111
<div>

packages/site-kit/src/lib/nav/Nav.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Top navigation bar for the application. It provides a slot for the left side, th
172172
font-size: var(--sk-font-size-ui-small);
173173
}
174174
175-
@media (max-width: 800px) {
175+
@media (max-width: 799px) {
176176
nav:not(.visible):not(:focus-within) {
177177
transform: translate(0, calc(var(--sk-nav-height)));
178178
}

packages/site-kit/src/lib/styles/tokens.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
}
137137
}
138138

139-
@media screen and (min-width: 768px) {
139+
@media screen and (min-width: 800px) {
140140
:root {
141141
--sk-font-size-h1: 5.4rem;
142142
--sk-page-padding-top: 8rem;

0 commit comments

Comments
 (0)