Skip to content

Commit 344c499

Browse files
committed
add advanced setting for transparent answer buttons background on small screens
1 parent faabb32 commit 344c499

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

script.user.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name JPDB Userscript (6a67)
33
// @namespace http://tampermonkey.net/
4-
// @version 0.1.172
4+
// @version 0.1.173
55
// @description Script for JPDB that adds some styling and functionality
66
// @match *://jpdb.io/*
77
// @grant GM_addStyle
@@ -269,15 +269,24 @@
269269
});
270270

271271
settings.showAdvancedSettings = new UserSetting('showAdvancedSettings', false, 'Show advanced settings');
272-
settings.advancedStaticUserButtonsOnSmallScreens = new UserSetting(
273-
'advancedStaticUserButtonsOnSmallScreens',
272+
settings.advancedStaticAnswerButtonsOnSmallScreens = new UserSetting(
273+
'advancedStaticAnswerButtonsOnSmallScreens',
274274
false,
275-
'Static user buttons on small screens',
275+
'Static answer buttons on small screens',
276276
{
277277
longDescription: 'Move the answer buttons to the bottom of the page on small screens instead of floating.',
278278
dependency: settings.showAdvancedSettings
279279
}
280280
);
281+
settings.advancedTransparentBackgroundAnswerButtons = new UserSetting(
282+
'advancedTransparentBackgroundAnswerButtons',
283+
false,
284+
'Transparent answer buttons background on small screens',
285+
{
286+
longDescription: 'Make the answer buttons background transparent on small screens.',
287+
dependency: settings.showAdvancedSettings
288+
}
289+
);
281290
settings.advancedYomiVocabAudioServer = new UserSetting(
282291
'advancedYomiVocabAudioServer',
283292
'',
@@ -544,11 +553,11 @@
544553
545554
:is(html.dark-mode) .tooltip:before {
546555
background-color: #101518;
556+
pointer-events: none;
547557
}
548558
549559
body,
550560
input {
551-
font-family: 'Manrope', 'Nunito Sans', 'Extra Sans JP', 'Noto Sans Symbols2', 'Segoe UI', 'Noto Sans JP', 'Noto Sans CJK JP', 'Hiragino Sans GB', 'Meiryo', sans-serif;
552561
}
553562
554563
input[type='button'],
@@ -1002,6 +1011,19 @@
10021011
display: none;
10031012
}
10041013
}
1014+
`,
1015+
1016+
transparentBackgroundAnswerButtons: `
1017+
@media screen and (max-height: 600px) {
1018+
.review-button-group {
1019+
background-color: transparent;
1020+
pointer-events: none;
1021+
}
1022+
.review-button-group input {
1023+
opacity: 1;
1024+
pointer-events: auto;
1025+
}
1026+
}
10051027
`
10061028
};
10071029

@@ -1330,9 +1352,12 @@
13301352
if (USER_SETTINGS.enableReplaceKanjiStrokeOrder() && !USER_SETTINGS.useFontInsteadOfSvg()) {
13311353
GM_addStyle(STYLES.hideKanjiSvg);
13321354
}
1333-
if (USER_SETTINGS.advancedStaticUserButtonsOnSmallScreens()) {
1355+
if (USER_SETTINGS.advancedStaticAnswerButtonsOnSmallScreens()) {
13341356
GM_addStyle(STYLES.staticAnswerButtons);
13351357
}
1358+
if (USER_SETTINGS.advancedTransparentBackgroundAnswerButtons()) {
1359+
GM_addStyle(STYLES.transparentBackgroundAnswerButtons);
1360+
}
13361361
}
13371362

13381363
async function injectFont() {

0 commit comments

Comments
 (0)