|
21 | 21 | <link |
22 | 22 | rel="stylesheet" |
23 | 23 | href="{{ '/lora/lora.css' | url }}" |
24 | | - data-font="Lora var" |
| 24 | + data-font="Lora" |
25 | 25 | data-weights="400 700" |
26 | 26 | /> |
27 | 27 | <link |
|
49 | 49 | --fillable: var(--color); |
50 | 50 | } |
51 | 51 | body { |
52 | | - --fallback: 'Inter var', Inter, system-ui, sans-serif; |
53 | | - font-family: var(--font, var(--fallback)); |
54 | | - font-weight: var(--weight, 400); |
| 52 | + font-family: 'Inter var', Inter, system-ui, sans-serif; |
55 | 53 | } |
56 | 54 | label:has(#font) { |
57 | 55 | --measure: 20ch; |
|
62 | 60 | h3 { |
63 | 61 | --flow: 2em; |
64 | 62 | } |
| 63 | + label:has(#specimen) { |
| 64 | + max-width: 100%; |
| 65 | + font-size: 1.2em; |
| 66 | + } |
| 67 | + #specimen { |
| 68 | + padding: var(--s2) var(--s0); |
| 69 | + font-family: var(--font, var(--fallback)); |
| 70 | + font-weight: var(--weight, 400); |
| 71 | + border-color: var(--border); |
| 72 | + } |
65 | 73 | </style> |
66 | 74 | </head> |
67 | 75 | <body> |
|
88 | 96 | </footer> |
89 | 97 |
|
90 | 98 | <script> |
| 99 | + const specimen = document.getElementById('specimen') |
| 100 | +
|
91 | 101 | function setFont(font) { |
92 | | - document.documentElement.style.setProperty('--font', `'${font}'`) |
| 102 | + specimen.style.setProperty('--font', `'${font}'`) |
93 | 103 |
|
94 | 104 | const style = document.querySelector(`[data-font="${font}"]`) |
95 | 105 | if (style.dataset.weights) { |
|
102 | 112 | setWeight(400) |
103 | 113 | } |
104 | 114 | function setWeight(value) { |
105 | | - document.documentElement.style.setProperty('--weight', value) |
| 115 | + specimen.style.setProperty('--weight', value) |
106 | 116 | document.getElementById('weight').previousElementSibling.textContent = |
107 | 117 | `Weight (${value})` |
108 | 118 | } |
|
126 | 136 |
|
127 | 137 | document.getElementById('font').value = 'Inter var' |
128 | 138 | setFont('Inter var') |
| 139 | +
|
| 140 | + const quotes = [ |
| 141 | + `Design is not just what it looks like and feels like. Design is how it works.`, // Steve Jobs |
| 142 | + `A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.`, // Douglas Adams |
| 143 | + `Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.`, // Antoine de Saint-Exupér |
| 144 | + `Good design is as little as possible. Less, but better, because it concentrates on the essential aspects, and the products are not burdened with non-essentials. Back to purity, back to simplicity.`, // Dieter Rams |
| 145 | + ] |
| 146 | +
|
| 147 | + specimen.value = quotes[Math.floor(Math.random() * quotes.length)] |
| 148 | + specimen.style.height = specimen.scrollHeight + 'px' |
129 | 149 | </script> |
130 | 150 |
|
131 | 151 | <!-- @openlab/alembic inject-js --> |
|
0 commit comments