mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 11:26:13 +08:00
impr: add monkey caret style
also moves caret images to a folder
This commit is contained in:
parent
5a9038cfef
commit
36574b4096
7 changed files with 24 additions and 5 deletions
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
&.carrot {
|
||||
background-color: transparent;
|
||||
background-image: url("/images/carrot.png");
|
||||
background-image: url("/images/caret/carrot.png");
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
|
@ -47,7 +47,16 @@
|
|||
|
||||
&.banana {
|
||||
background-color: transparent;
|
||||
background-image: url("/images/banana.png");
|
||||
background-image: url("/images/caret/banana.png");
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
&.monkey {
|
||||
background-color: transparent;
|
||||
background-image: url("/images/caret/monkey.png");
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
|
|||
caretStyle: {
|
||||
subgroup: {
|
||||
options: "fromSchema",
|
||||
isVisible: (value) => !["banana", "carrot"].includes(value),
|
||||
isVisible: (value) => !["banana", "carrot", "monkey"].includes(value),
|
||||
},
|
||||
},
|
||||
paceCaret: {
|
||||
|
|
@ -489,7 +489,7 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
|
|||
paceCaretStyle: {
|
||||
subgroup: {
|
||||
options: "fromSchema",
|
||||
isVisible: (value) => !["banana", "carrot"].includes(value),
|
||||
isVisible: (value) => !["banana", "carrot", "monkey"].includes(value),
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,16 @@ export class Caret {
|
|||
this.style = style;
|
||||
this.element.style.width = "";
|
||||
this.element.classList.remove(
|
||||
...["off", "default", "underline", "outline", "block", "carrot", "banana"]
|
||||
...[
|
||||
"off",
|
||||
"default",
|
||||
"underline",
|
||||
"outline",
|
||||
"block",
|
||||
"carrot",
|
||||
"banana",
|
||||
"monkey",
|
||||
]
|
||||
);
|
||||
this.element.classList.add(style);
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
frontend/static/images/caret/monkey.png
Normal file
BIN
frontend/static/images/caret/monkey.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
|
|
@ -44,6 +44,7 @@ export const CaretStyleSchema = z.enum([
|
|||
"underline",
|
||||
"carrot",
|
||||
"banana",
|
||||
"monkey",
|
||||
]);
|
||||
export type CaretStyle = z.infer<typeof CaretStyleSchema>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue