feat: Add Typekit font loading script
All checks were successful
CI / cache-and-install (push) Successful in 1m31s
All checks were successful
CI / cache-and-install (push) Successful in 1m31s
This commit is contained in:
30
index.html
30
index.html
@ -20,4 +20,34 @@
|
|||||||
<script src="https://fastly.jsdelivr.net/npm/@vant/touch-emulator/dist/index.min.js"></script>
|
<script src="https://fastly.jsdelivr.net/npm/@vant/touch-emulator/dist/index.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/nprogress/nprogress.css" />
|
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/nprogress/nprogress.css" />
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
(function (d) {
|
||||||
|
var config = {
|
||||||
|
kitId: 'whk2tto',
|
||||||
|
scriptTimeout: 3000,
|
||||||
|
async: true,
|
||||||
|
},
|
||||||
|
h = d.documentElement,
|
||||||
|
t = setTimeout(function () {
|
||||||
|
h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive';
|
||||||
|
}, config.scriptTimeout),
|
||||||
|
tk = d.createElement('script'),
|
||||||
|
f = false,
|
||||||
|
s = d.getElementsByTagName('script')[0],
|
||||||
|
a;
|
||||||
|
h.className += ' wf-loading';
|
||||||
|
tk.src = 'https://use.typekit.net/' + config.kitId + '.js';
|
||||||
|
tk.async = true;
|
||||||
|
tk.onload = tk.onreadystatechange = function () {
|
||||||
|
a = this.readyState;
|
||||||
|
if (f || (a && a != 'complete' && a != 'loaded')) return;
|
||||||
|
f = true;
|
||||||
|
clearTimeout(t);
|
||||||
|
try {
|
||||||
|
Typekit.load(config);
|
||||||
|
} catch (e) {}
|
||||||
|
};
|
||||||
|
s.parentNode.insertBefore(tk, s);
|
||||||
|
})(document);
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
@ -58,6 +58,14 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--h-base-font: lxgw-wenkai-mono-tc, alibaba-puhuiti, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||||
|
Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
:root:root {
|
||||||
|
--van-base-font: var(--h-base-font);
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
@ -66,19 +74,9 @@ body {
|
|||||||
color 0.5s,
|
color 0.5s,
|
||||||
background-color 0.5s;
|
background-color 0.5s;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
font-family:
|
font-family: var(--h-base-font);
|
||||||
Inter,
|
font-weight: 400;
|
||||||
-apple-system,
|
font-style: normal;
|
||||||
BlinkMacSystemFont,
|
|
||||||
'Segoe UI',
|
|
||||||
Roboto,
|
|
||||||
Oxygen,
|
|
||||||
Ubuntu,
|
|
||||||
Cantarell,
|
|
||||||
'Fira Sans',
|
|
||||||
'Droid Sans',
|
|
||||||
'Helvetica Neue',
|
|
||||||
sans-serif;
|
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
Reference in New Issue
Block a user