-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- settings for requested retention rate and maxiumum intervall (globally), not deck specific at the moment - layout fixes for cloze card
- Loading branch information
Showing
13 changed files
with
164 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
badge.svg,1707482354411,4edd75f1d7084efc0ef8a502c6034d114374a681693b0c00b5b28b03fd157671 | ||
robots.txt,1707482354412,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2 | ||
logo.svg,1707482354411,861ef96db8e9adace3f580944747289b6a5704bc798e917dc5449dd7a49dd560 | ||
service-worker.js,1707482354413,fd9ec6132f3af5770dd0924ed3356930a669a9274fce81ec82baa79d58d99611 | ||
manifest.json,1707482354412,55750b48311acbc8a8e79a712b06c86159fb6e31d8dedaf965408b92da601522 | ||
index.html,1707482354728,b053fba058cc23a96f91b087458cdc69cd2247988f95948ab2b0962b55e94c9c | ||
logo256.png,1707482354411,174027c4e97105e2e006e42620822304e0d3fdee4d390a423f15f0abc16ef781 | ||
assets/web-vitals-BptxjviT.js,1707482354732,3ffd55f59352ddeafd5ff621f81d31444c53f3ae25242797564de702ed442492 | ||
logo512.png,1707482354412,3db7a8824f96f862029199fbb398ab312bb4688d52b1a0ab0e2a311422a21ab3 | ||
assets/index-FdHQsup1.css,1707482354732,ea2fbd45c0802d691061503ec41920c7be651f20dd417ca45701b74a62f9ce87 | ||
assets/index-MEFcB1N5.js,1707482354732,aa981d9e3897e02ab17998c0ef3406b240d0226bc32bda4c776f84c66e1af504 | ||
index.html,1707506186415,185d22983d01f190f88163132235032df27cdfd027ab43b9158c71405797c274 | ||
badge.svg,1707506186007,4edd75f1d7084efc0ef8a502c6034d114374a681693b0c00b5b28b03fd157671 | ||
manifest.json,1707506186009,55750b48311acbc8a8e79a712b06c86159fb6e31d8dedaf965408b92da601522 | ||
service-worker.js,1707506186010,fd9ec6132f3af5770dd0924ed3356930a669a9274fce81ec82baa79d58d99611 | ||
robots.txt,1707506186009,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2 | ||
logo.svg,1707506186007,861ef96db8e9adace3f580944747289b6a5704bc798e917dc5449dd7a49dd560 | ||
logo256.png,1707506186008,174027c4e97105e2e006e42620822304e0d3fdee4d390a423f15f0abc16ef781 | ||
assets/web-vitals-BptxjviT.js,1707506186415,3ffd55f59352ddeafd5ff621f81d31444c53f3ae25242797564de702ed442492 | ||
logo512.png,1707506186008,3db7a8824f96f862029199fbb398ab312bb4688d52b1a0ab0e2a311422a21ab3 | ||
assets/index-uqoGVHGe.css,1707506186415,e8d03bd716c716adad3b78b29b513b3f29ebbaa60ce1fd7a86fce8526aa9b384 | ||
assets/index-j4mQTXfm.js,1707506186417,52576d3c9dceb5f8704a06e4a950cc851c77d37c6429d09fbe7ab4092ca7f27f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
import React, { useState } from "react"; | ||
import { Button, Card, Stack, Text, Title } from "@mantine/core"; | ||
import SettingsInput from "./SettingsInput"; | ||
import LanguageSelect from "./LanguageSelect"; | ||
import { Stack } from "@mantine/core"; | ||
import { useTranslation } from "react-i18next"; | ||
import LanguageSelect from "./LanguageSelect"; | ||
import SettingsInput from "./SettingsInput"; | ||
|
||
export default function GeneralSettingsView() { | ||
const [t] = useTranslation(); | ||
return ( | ||
<> | ||
<Stack gap="xl" align="start"> | ||
<SettingsInput | ||
label={t("settings.general.name")} | ||
description={t("settings.general.name-description")} | ||
settingsKey={"name"} | ||
inputType={"text"} | ||
/> | ||
<LanguageSelect /> | ||
<SettingsInput | ||
label={t("settings.general.enable-developer-mode")} | ||
description={t("settings.general.enable-developer-mode-description")} | ||
settingsKey="developerMode" | ||
inputType={"switch"} | ||
/> | ||
<SettingsInput | ||
label={"Zen Mode"} | ||
settingsKey="useZenMode" | ||
inputType={"switch"} | ||
/> | ||
</Stack> | ||
</> | ||
<Stack gap="xl" align="start"> | ||
<SettingsInput | ||
label={t("settings.general.name")} | ||
description={t("settings.general.name-description")} | ||
settingsKey={"name"} | ||
inputType={"text"} | ||
/> | ||
<LanguageSelect /> | ||
<SettingsInput | ||
label={t("settings.general.enable-developer-mode")} | ||
description={t("settings.general.enable-developer-mode-description")} | ||
settingsKey="developerMode" | ||
inputType={"switch"} | ||
/> | ||
<SettingsInput | ||
label={"Zen Mode"} | ||
settingsKey="useZenMode" | ||
inputType={"switch"} | ||
/> | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Stack, Text } from "@mantine/core"; | ||
import { useTranslation } from "react-i18next"; | ||
import { useSetting } from "../../logic/Settings"; | ||
import SettingsInput from "./SettingsInput"; | ||
|
||
export default function LearnSettingsView() { | ||
const [t] = useTranslation(); | ||
|
||
const [w] = useSetting("globalScheduler_w"); | ||
const [maximumInterval] = useSetting("globalScheduler_maximumInterval"); | ||
const [requestRetention] = useSetting("globalScheduler_requestRetention"); | ||
return ( | ||
<Stack gap="xl" align="start"> | ||
<SettingsInput | ||
label={t("settings.learn.requestRetention")} | ||
settingsKey="globalScheduler_requestRetention" | ||
inputType="number" | ||
/> | ||
<SettingsInput | ||
label={t("settings.learn.maximumInterval")} | ||
settingsKey="globalScheduler_maximumInterval" | ||
inputType="number" | ||
/> | ||
<Text>{w.map((x) => x + ", ")}</Text> | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
import * as fsrsjs from "fsrs.js"; | ||
import { setSetting, useSetting, useSettings } from "./Settings"; | ||
import { useCallback, useEffect, useMemo, useState } from "react"; | ||
|
||
export const scheduler = new fsrsjs.FSRS(); | ||
const scheduler = new fsrsjs.FSRS(); | ||
|
||
export function useGlobalScheduler() { | ||
const [maximumInterval] = useSetting("globalScheduler_maximumInterval"); | ||
const [requestRetention] = useSetting("globalScheduler_requestRetention"); | ||
const [w] = useSetting("globalScheduler_w"); | ||
|
||
useEffect(() => { | ||
scheduler.p.maximum_interval = maximumInterval; | ||
scheduler.p.request_retention = requestRetention; | ||
scheduler.p.w = w; | ||
}, [maximumInterval, requestRetention, w]); | ||
console.log(scheduler); | ||
return scheduler; | ||
} | ||
|
||
export function updateGlobalScheduler() { | ||
setSetting("globalScheduler_maximumInterval", scheduler.p.maximum_interval); | ||
setSetting("globalScheduler_requestRetention", scheduler.p.request_retention); | ||
setSetting("globalScheduler_w", scheduler.p.w); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
.clozeCard :global(.cloze-field) { | ||
display: inline-block; | ||
width: 4rem; | ||
height: calc(var(--mantine-line-height-sm) * var(--mantine-font-size-md)); | ||
border-top-right-radius: var(--mantine-radius-sm); | ||
border-top-left-radius: var(--mantine-radius-sm); | ||
vertical-align:baseline; | ||
padding: 0 0.25rem; | ||
border-radius: var(--mantine-radius-sm); | ||
background-color: var(--mantine-primary-color-light); | ||
border-bottom: solid 2px var(--mantine-primary-color-filled); | ||
|
||
:global(.cloze-content) { | ||
} | ||
|
||
:global(.cloze-content.occluded) { | ||
visibility: hidden; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters