mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
moved fonts to another file
This commit is contained in:
parent
a65b9b3392
commit
091db7315a
4 changed files with 50 additions and 18 deletions
|
|
@ -1218,24 +1218,7 @@
|
|||
<h1>font family</h1>
|
||||
<!-- <div class="text">Change the font family for the site</div> -->
|
||||
<div class="buttons">
|
||||
<div class="button" style="font-family:Roboto Mono" fontFamily="Roboto_Mono" tabindex="0"
|
||||
onclick="this.blur();">Roboto Mono</div>
|
||||
<div class="button" style="font-family:Source Code Pro" fontFamily="Source_Code_Pro" tabindex="0"
|
||||
onclick="this.blur();">Source Code Pro</div>
|
||||
<div class="button" style="font-family:IBM Plex Mono" fontFamily="IBM_Plex_Mono" tabindex="0"
|
||||
onclick="this.blur();">IBM Plex Mono</div>
|
||||
<div class="button" style="font-family:Inconsolata" fontFamily="Inconsolata" tabindex="0"
|
||||
onclick="this.blur();">Inconsolata</div>
|
||||
<div class="button" style="font-family:Fira Code" fontFamily="Fira_Code" tabindex="0"
|
||||
onclick="this.blur();">Fira Code</div>
|
||||
<div class="button" style="font-family:Roboto" fontFamily="Roboto" tabindex="0" onclick="this.blur();">
|
||||
Roboto</div>
|
||||
<div class="button" style="font-family:Montserrat" fontFamily="Montserrat" tabindex="0"
|
||||
onclick="this.blur();">Montserrat</div>
|
||||
<div class="button" style="font-family:Titillium Web" fontFamily="Titillium_Web" tabindex="0"
|
||||
onclick="this.blur();">Titillium Web</div>
|
||||
<div class="button" style="font-family:Lexend Deca" fontFamily="Lexend_Deca" tabindex="0"
|
||||
onclick="this.blur();">Lexend Deca</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="section flipTestColors">
|
||||
|
|
|
|||
|
|
@ -706,6 +706,17 @@ $.getJSON("funbox/list.json", function (data) {
|
|||
});
|
||||
});
|
||||
|
||||
let fontsList;
|
||||
|
||||
$.getJSON("js/fonts.json", function (data) {
|
||||
fontsList = data.sort(function (a, b) {
|
||||
(nameA = a.name.toLowerCase()), (nameB = b.name.toLowerCase());
|
||||
if (nameA < nameB) return -1;
|
||||
if (nameA > nameB) return 1;
|
||||
return 0;
|
||||
});
|
||||
});
|
||||
|
||||
let commandsThemes = {
|
||||
title: "Change theme...",
|
||||
list: [
|
||||
|
|
|
|||
28
public/js/fonts.json
Normal file
28
public/js/fonts.json
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[{
|
||||
"name": "Roboto Mono"
|
||||
},
|
||||
{
|
||||
"name": "Source Code Pro"
|
||||
},
|
||||
{
|
||||
"name": "IBM Plex Mono"
|
||||
},
|
||||
{
|
||||
"name": "Inconsolata"
|
||||
},
|
||||
{
|
||||
"name": "Fira Code"
|
||||
},
|
||||
{
|
||||
"name": "Roboto"
|
||||
},
|
||||
{
|
||||
"name": "Montserrat"
|
||||
},
|
||||
{
|
||||
"name": "Titillium Web"
|
||||
},
|
||||
{
|
||||
"name": "Lexend Deca"
|
||||
}
|
||||
]
|
||||
|
|
@ -56,6 +56,16 @@ function updateSettingsPage() {
|
|||
);
|
||||
});
|
||||
|
||||
let fontsEl = $(".pageSettings .section.fontFamily .buttons").empty();
|
||||
fontsList.forEach((font) => {
|
||||
fontsEl.append(
|
||||
`<div class="button" style="font-family:${
|
||||
font.name
|
||||
}" fontFamily="${font.name.replace(/ /g, "_")}" tabindex="0"
|
||||
onclick="this.blur();">${font.name}</div>`
|
||||
);
|
||||
});
|
||||
|
||||
refreshTagsSettingsSection();
|
||||
|
||||
setSettingsButton("smoothCaret", config.smoothCaret);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue