This commit is contained in:
Jack 2020-12-23 17:17:46 +00:00
commit 0bb6256931
3 changed files with 29 additions and 3 deletions

View file

@ -1305,7 +1305,11 @@ function stopCaretAnimation() {
function startCaretAnimation() {
if (caretAnimating === false) {
$("#caret").css("animation-name", "caretFlash");
if (config.smoothCaret) {
$("#caret").css("animation-name", "caretFlashSmooth");
} else {
$("#caret").css("animation-name", "caretFlashHard");
}
caretAnimating = true;
}
}

View file

@ -995,11 +995,21 @@ function setWordCount(wordCount, nosave) {
function setSmoothCaret(mode, nosave) {
config.smoothCaret = mode;
if (!nosave) saveConfigToCookie();
if (mode) {
$("#caret").css("animation-name", "caretFlashSmooth");
} else {
$("#caret").css("animation-name", "caretFlashHard");
}
}
function toggleSmoothCaret() {
config.smoothCaret = !config.smoothCaret;
saveConfigToCookie();
if (config.smoothCaret) {
$("#caret").css("animation-name", "caretFlashSmooth");
} else {
$("#caret").css("animation-name", "caretFlashHard");
}
}
//startgraphsatzero

View file

@ -995,7 +995,7 @@ a:hover {
#caret {
height: 1.5rem;
background: var(--caret-color);
animation-name: caretFlash;
animation-name: caretFlashSmooth;
/* animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); */
animation-iteration-count: infinite;
animation-duration: 1s;
@ -1080,7 +1080,7 @@ a:hover {
}
}
@keyframes caretFlash {
@keyframes caretFlashSmooth {
0%,
100% {
opacity: 0;
@ -1091,6 +1091,18 @@ a:hover {
}
}
@keyframes caretFlashHard {
0%,
50% {
opacity: 0;
}
51%,
100% {
opacity: 1;
}
}
#menu {
font-size: 1rem;
line-height: 1rem;