Skip to content

Commit

Permalink
adjust vertical space for cards without audio
Browse files Browse the repository at this point in the history
  • Loading branch information
6a67 committed Sep 5, 2024
1 parent e4d849c commit 731e32e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions script.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name JPDB Userscript (6a67)
// @namespace http://tampermonkey.net/
// @version 0.1.120
// @version 0.1.121
// @description Script for JPDB that adds some styling and functionality
// @match https://jpdb.io/*
// @grant GM_addStyle
Expand Down Expand Up @@ -725,15 +725,19 @@
position: absolute;
right: 1rem;
height: 50vh;
transform: translateY(2rem);
letter-spacing: 0.15rem;
}
.card-sentence:has(.icon-link) {
transform: translateY(2rem);
}
.card-sentence .icon-link {
position: absolute;
transform: translateY(-2rem);
}
.card-sentence .ti-pencil {
position: absolute;
}
.card-sentence:has(.ti-volume) .ti-pencil {
right: 2rem;
}
.card-sentence .sentence {
Expand Down Expand Up @@ -2784,8 +2788,8 @@
if (!cardSentence) {
return;
}
if(showCheckboxExamplesLabel) {

if (showCheckboxExamplesLabel) {
const verticalDistance = getVerticalDistanceTopToTop(cardSentence, showCheckboxExamplesLabel);
heights.push(`${Math.round(verticalDistance)}px`);
}
Expand All @@ -2796,7 +2800,6 @@
}
}


if (cardSentence) {
cardSentence.style.height = `calc(max(10px, min(${heights.join(', ')}) * 0.99)`;
}
Expand Down

0 comments on commit 731e32e

Please sign in to comment.