|
1 | | -<script> |
2 | | - import iconSquoosh from "@ktibow/iconset-material-symbols/fullscreen-exit-rounded"; |
3 | | - import iconInject from "@ktibow/iconset-material-symbols/vaccines-outline-rounded"; |
4 | | - import Icon from "$lib/misc/Icon.svelte"; |
5 | | - import Branding from "./Branding.svelte"; |
| 1 | +<script lang="ts"> |
| 2 | + import { page } from "$app/state"; |
| 3 | + import { resolve } from "$app/paths"; |
| 4 | +
|
| 5 | + const name = "M3 Svelte"; |
| 6 | + const description = "implements the Material 3 design system in Svelte."; |
| 7 | + const github = "https://github.com/KTibow/m3-svelte"; |
6 | 8 | </script> |
7 | 9 |
|
8 | | -<div class="wrapper"> |
9 | | - <Branding /> |
10 | | - <div class="pills"> |
11 | | - <div class="pill"> |
12 | | - <Icon icon={iconInject} /> |
13 | | - Now injecting globals |
14 | | - </div> |
15 | | - <div class="pill"> |
16 | | - <Icon icon={iconSquoosh} /> |
17 | | - Smallest CSS yet |
18 | | - </div> |
19 | | - </div> |
| 10 | +<div class="branding"> |
| 11 | + <h1> |
| 12 | + <img src="https://ktibow.github.io/favicon.svg" alt="KTibow's" width="48" height="48" /> |
| 13 | + {name} |
| 14 | + </h1> |
| 15 | + <p>{description}</p> |
| 16 | + <a href={github}> |
| 17 | + <p>GitHub</p> |
| 18 | + <p class="supporting">{page.data.stars} stars</p> |
| 19 | + </a> |
| 20 | + <a href="https://discord.gg/sRzVYM9b47"> |
| 21 | + <p>Discord</p> |
| 22 | + <p class="supporting">{page.data.members} members</p> |
| 23 | + </a> |
| 24 | + <a href={resolve("/docs/features")}> |
| 25 | + <p>Features...</p> |
| 26 | + <p class="supporting">Powerful yet lean</p> |
| 27 | + </a> |
20 | 28 | </div> |
21 | 29 |
|
22 | 30 | <style> |
23 | | - .wrapper { |
| 31 | + .branding { |
| 32 | + --transition: var(--m3-timing-function-emphasized) 500ms; |
24 | 33 | display: flex; |
25 | 34 | flex-direction: column; |
26 | | - align-items: center; |
27 | | - gap: 1.5rem; |
28 | | - padding: 6rem 0; |
29 | | - } |
30 | | - .pills { |
31 | | - @apply --m3-label-large; |
32 | | - display: flex; |
33 | 35 | justify-content: center; |
| 36 | + border-radius: 1.5rem; |
| 37 | + background-color: var(--m3c-primary-container-subtle); |
| 38 | + color: var(--m3c-on-primary-container-subtle); |
| 39 | + transition: var(--transition); |
| 40 | + overflow: hidden; |
34 | 41 |
|
35 | | - gap: 0.5rem; |
36 | | - flex-wrap: wrap; |
37 | | - } |
38 | | - .pill { |
39 | | - background-color: var(--m3c-surface-container-low); |
| 42 | + margin-block: 6rem; |
| 43 | + margin-inline: auto; |
40 | 44 |
|
41 | | - height: 2rem; |
42 | | - display: flex; |
43 | | - align-items: center; |
44 | | - gap: 0.5rem; |
45 | | - padding: 0 1rem; |
46 | | - border-radius: 2rem; |
| 45 | + /* COLLAPSED STATE */ |
| 46 | + &:not(:hover, :has(a:focus-visible)) { |
| 47 | + > h1 { |
| 48 | + > img { |
| 49 | + width: 0; |
| 50 | + height: 0; |
| 51 | + opacity: 0; |
| 52 | + margin-right: 0; |
| 53 | + } |
| 54 | + } |
| 55 | + > p, |
| 56 | + > a { |
| 57 | + height: 0; |
| 58 | + margin: 0 -2rem; |
| 59 | + opacity: 0; |
| 60 | + padding-block: 0; |
| 61 | + pointer-events: none; |
| 62 | + } |
| 63 | + } |
| 64 | +
|
| 65 | + /* EXPANDED ELEMENTS */ |
| 66 | + h1 { |
| 67 | + display: flex; |
| 68 | + align-items: center; |
| 69 | + justify-content: center; |
| 70 | + @apply --m3-display-large; |
| 71 | + font-weight: bold; |
| 72 | + margin-block: 0.5rem; |
| 73 | + margin-inline: 1rem; |
| 74 | + transition: var(--transition); |
| 75 | +
|
| 76 | + img { |
| 77 | + width: 1em; |
| 78 | + height: 1em; |
| 79 | + border-radius: var(--m3-shape-full); |
| 80 | + background-color: var(--m3c-surface); |
| 81 | + margin-right: 1rem; |
| 82 | + transition: var(--transition); |
| 83 | + } |
| 84 | + } |
| 85 | +
|
| 86 | + /* Description paragraph */ |
| 87 | + & > p { |
| 88 | + height: 1.5rem; |
| 89 | + margin: 0; |
| 90 | + margin-inline: 1rem; |
| 91 | + overflow: hidden; |
| 92 | + white-space: nowrap; |
| 93 | + transition: var(--transition); |
| 94 | + } |
| 95 | +
|
| 96 | + /* Link "Buttons" */ |
| 97 | + a { |
| 98 | + @apply --m3-focus-inward; |
| 99 | + display: flex; |
| 100 | + align-items: center; |
| 101 | + justify-content: space-between; |
| 102 | + height: 3rem; |
| 103 | + padding-inline: 1rem; |
| 104 | + border-radius: 1.5rem; |
| 105 | + margin-top: 0.5rem; |
| 106 | + background-color: var(--m3c-primary-container); |
| 107 | + color: var(--m3c-on-primary-container); |
| 108 | + text-decoration: none; |
| 109 | + transition: var(--transition); |
| 110 | + overflow: hidden; |
| 111 | +
|
| 112 | + p { |
| 113 | + margin: 0; |
| 114 | + } |
| 115 | +
|
| 116 | + .supporting { |
| 117 | + font-size: 0.85rem; |
| 118 | + opacity: 0.8; |
| 119 | + } |
| 120 | + } |
47 | 121 | } |
48 | 122 | </style> |
0 commit comments