diff --git a/.changeset/thirty-glasses-applaud.md b/.changeset/thirty-glasses-applaud.md new file mode 100644 index 0000000..c856ede --- /dev/null +++ b/.changeset/thirty-glasses-applaud.md @@ -0,0 +1,5 @@ +--- +'anki-templates': minor +--- + +Support hiding options to avoid potential answer hints (支持隐藏选项以避免可能的答案提示) diff --git a/src/components/settings.tsx b/src/components/settings.tsx index b0a3ae3..ba93015 100644 --- a/src/components/settings.tsx +++ b/src/components/settings.tsx @@ -27,6 +27,10 @@ export const hideQuestionTypeAtom = atomWithLocalStorage( false, ); export const noScorllAtom = atomWithLocalStorage('noScorll', true); +export const blurOptionsAtom = atomWithLocalStorage( + 'blurOptions', + false, +); let OptionList: FC; @@ -41,6 +45,7 @@ if (id === 'mcq') { const [hideQuestionType, setHideQuestionType] = useAtom(hideQuestionTypeAtom); const [noScorll, setNoScorll] = useAtom(noScorllAtom); + const [blurOptions, setBlurOptions] = useAtom(blurOptionsAtom); return ( <> @@ -72,6 +77,12 @@ if (id === 'mcq') { checked={selectionMenu} onChange={setSelectionMenu} /> + { const note = useField('note'); const isMultipleChoice = answers.length > 1; + const [blurred, setBlurred] = useStorage( + 'blurred', + useAtomValue(blurOptionsAtom), + ); + return ( {
setBlurred(false)} > {options.map((name) => { const selectResult = getSelectResult(name); @@ -150,6 +160,9 @@ export default () => { 'before:text-indigo-500 after:hidden': selectResult === 'none', }, + { + [`pointer-events-none blur`]: blurred, + }, )} >