Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child Popup Specific Dictionary Settings #1800

Open
40elyK opened this issue Feb 3, 2025 · 6 comments
Open

Child Popup Specific Dictionary Settings #1800

40elyK opened this issue Feb 3, 2025 · 6 comments
Labels
kind/enhancement The issue or PR is a new feature or request

Comments

@40elyK
Copy link

40elyK commented Feb 3, 2025

Rather than using the same dictionaries for the child popups, we have the option to set specific dictionaries for child popup scans. I think this will ease the monolingual transition, using a primary monolingual dictionary and using a bilingual dictionary specifically for child scan popups. Something like having a primary dictionaries for main scans and secondary dictionaries for child scans.

@40elyK 40elyK added the kind/enhancement The issue or PR is a new feature or request label Feb 3, 2025
@NovaKing001
Copy link

You can already achieve this via the configure profiles menu. You will need to have two or more profiles.

The first profile will have all your monolingual dictionaries and the second profile will have all your bilingual dictionaries. Via the configure profiles menu notice that there will be a conditions option.

Image

Click on conditions next to your bilingual profile. Add a new group and the condition if the popup level >= 1.

Image

Now all child popups will use the bilingual dictionaries and any additional configurations to that specific profile.

Image

@40elyK
Copy link
Author

40elyK commented Feb 5, 2025

Oh wow, this is fantastic, thank you so much! On a separate note, how did you get your yomitan looking so drippy. I know it is likely custom CSS and fonts, but it looks incredible.

@NovaKing001
Copy link

@40elyK If you want my specific CSS I'll link it below
the font I use is HG明朝B, you'll have to download it online. To change the font you want to do it in the settings.
The Moe Way website has more detailed instructions if you want to add your own bits. https://learnjapanese.moe/yomicss/
Good luck with the monolingual transition! It'll be worth it.

Image

/* Darius Dictionary Colorizer
 * Last Updated 2023-01-18
 * The latest version can be found at
 * https://github.com/themoeway/yomichan-dict-css
 */
body{
color:#fff0c9;
}
:root {
  /* Change this opacity to 0% if you don't want backgrounds to change.
   * Or increase it if you want them to change more.
   */
  --dict-color-opacity: 0%;
  --dict-color: var(--tag-dictionary-background-color);
  --dict-bg-opacity: 0;
}

.definition-item {
  background-color: #1a1b26(
    in srgb,
    var(--dict-color) calc(var(--dict-bg-opacity) * var(--dict-color-opacity)),
    var(--background-color)
  );
  --tag-dictionary-background-color: var(--dict-color);
}

/* Japanese Dicts */

.definition-item[data-dictionary^="旺文社国語辞典"] {
  --dict-color: rgb(187, 255, 255);
  --dict-bg-opacity: 0.06;
  --tag-text-color: black;
}
.definition-item[data-dictionary^="明鏡国語辞典"] {
  --dict-color: rgb(51, 51, 221);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary^="岩波国語辞"] {
  --dict-color: rgb(51, 85, 51);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary*="新明解"] {
  --dict-color: rgb(255, 0, 0);
  --dict-bg-opacity: 0.025;
}
.definition-item[data-dictionary^="大辞林"] {
  --dict-color: rgb(85, 34, 85);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="デジタル大辞泉"] {
  --dict-color: rgb(170, 0, 0);
  --dict-bg-opacity: 0.04;
}
.definition-item[data-dictionary="精選版 日本国語大辞典"] {
  --dict-color: rgb(238, 238, 204);
  --dict-bg-opacity: 0.05;
  --tag-text-color: black;
}
.definition-item[data-dictionary="ハイブリッド新辞林"] {
  --dict-color: rgb(221, 221, 238);
  --dict-bg-opacity: 0.15;
  --tag-text-color: black;
}
.definition-item[data-dictionary^="広辞苑"] {
  --dict-color: rgb(51, 51, 51);
  --dict-bg-opacity: 0.05;
}
/* jitenon */
.definition-item[data-dictionary="四字熟語辞典オンライン"],
.definition-item[data-dictionary="故事・ことわざ・慣用句オンライン"],
.definition-item[data-dictionary="国語辞典オンライン"] {
  --dict-color: rgb(255, 227, 124);
  --dict-bg-opacity: 0.05;
  --tag-text-color: black;
}
.definition-item[data-dictionary="実用日本語表現辞典"] {
  --dict-color: rgb(99, 108, 141);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary^="三省堂国語辞典"] {
  --dict-color: rgb(229, 107, 57);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary^="JMdict"],
.definition-item[data-dictionary^="JMDict"],
.definition-item[data-dictionary^="JMnedict"],
.definition-item[data-dictionary^="Jitendex"] {
  --dict-color: rgb(0, 132, 255);
  --dict-bg-opacity: 0.02;
}
.definition-item[data-dictionary="NEW斎藤和英大辞典"] {
  --dict-color: rgb(244, 225, 254);
  --dict-bg-opacity: 0.15;
  --tag-text-color: black;
}
.definition-item[data-dictionary="新和英"] {
  --dict-color: rgb(21, 70, 51);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary^="Pixiv"] {
  --dict-color: rgb(0, 151, 250);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="漢字源"] {
  --dict-color: rgb(201, 149, 93);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="日本語俗語辞書"] {
  --dict-color: rgb(176, 4, 157);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="weblio古語辞典"] {
  --dict-color: rgb(193, 123, 148);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="語源由来辞典"] {
  --dict-color: rgb(206, 169, 47);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="学研 四字熟語辞典"] {
  --dict-color: rgb(180, 192, 152);
  --dict-bg-opacity: 0.08;
  --tag-text-color: black;
}
.definition-item[data-dictionary="故事ことわざの辞典"] {
  --dict-color: rgb(117, 87, 85);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary^="日本語文法辞典"] {
  --dict-color: rgb(23, 59, 173);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="絵でわかる日本語"] {
  --dict-color: rgb(207, 76, 110);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="JLPT文法解説まとめ"] {
  --dict-color: rgb(244, 66, 54);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="どんなときどう使う 日本語表現文型辞典"] {
  --dict-color: rgb(126, 168, 232);
  --dict-bg-opacity: 0.08;
}
.definition-item[data-dictionary="毎日のんびり日本語教師"] {
  --dict-color: rgb(255, 216, 228);
  --dict-bg-opacity: 0.12;
  --tag-text-color: black;
}
.definition-item[data-dictionary^="新選国語辞典"] {
  --dict-color: #0073c4;
  --dict-bg-opacity: 0.03;
}
/* goo.ne.jp */
.definition-item[data-dictionary="使い方の分かる 類語例解辞典"],
.definition-item[data-dictionary="全国方言辞典"] {
  --dict-color: #9c4836;
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="新語時事用語辞典"] {
  --dict-color: #6e9ac6;
  --dict-bg-opacity: 0.07;
}
.definition-item[data-dictionary="漢字ペディア同訓異義"] {
  --dict-color: #b7b7b7;
  --dict-bg-opacity: 0.12;
}
.definition-item[data-dictionary*="Wikipedia"] {
  --dict-color: #447ff5;
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary^="漢検漢字辞典"] {
  --dict-color: #e7a93a;
  --dict-bg-opacity: 0.08;
}

/* Kanji Dicts */

/* same color as earlier jitenon */
.tag[data-category="dictionary"][data-details="漢字辞典オンライン"] {
  --tag-color: rgb(255, 227, 124);
  --tag-text-color: black;
}
.tag[data-category="dictionary"][data-details="JPDB Kanji"] {
  --tag-color: #ff3e3d;
}
.tag[data-category="dictionary"][data-details="TheKanjiMap Kanji Radicals/Composition"] {
  --tag-color: #2a94c9;
}
.tag[data-category="dictionary"][data-details*="Wiktionary"] {
  --tag-color: #447ff5;
}
/* Same as JMdict */
.tag[data-category="dictionary"][data-details^="KANJIDIC"] {
  --tag-color: rgb(0, 132, 255);
}

/* Hanzi Dicts */
.tag[data-category="dictionary"][data-details^="CC-CEDICT"] {
  --tag-color: rgb(32, 48, 64);
}

/* Pitch Accent */

.tag[data-category="pronunciation-dictionary"][data-details="NHK"] {
  --tag-color: #0076d0;
}
.tag[data-category="pronunciation-dictionary"][data-details^="大辞泉"] {
  --tag-color: rgb(170, 0, 0);
}
.tag[data-category="pronunciation-dictionary"][data-details^="大辞林"] {
  --tag-color: rgb(85, 34, 85);
}

/* Chinese Dicts */

/* also covers Canto CEDICT */
.definition-item[data-dictionary*="CEDICT"] {
  --dict-color: rgb(32, 48, 64);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary^="中日大辞典"] {
  --dict-color: rgb(223, 72, 79);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="漢語大詞典"] {
  --dict-color: rgb(160, 19, 23);
  --dict-bg-opacity: 0.05;
}
/* also 萌典国语辞典 */
.definition-item[data-dictionary^="萌典"] {
  --dict-color: rgb(255, 221, 212);
  --dict-bg-opacity: 0.12;
  --tag-text-color: black;
}
.definition-item[data-dictionary="兩岸詞典"] {
  --dict-color: rgb(62, 94, 143);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="牛津英汉汉英词典"] {
  --dict-color: rgb(15, 58, 124);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="五南國語活用辭典"] {
  --dict-color: rgb(251, 150, 60);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="譯典通英漢雙向字典"] {
  --dict-color: rgb(172, 76, 77);
  --dict-bg-opacity: 0.05;
}
.definition-item[data-dictionary="现代汉语规范词典"] {
  --dict-color: rgb(232, 25, 15);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="CantoDict"] {
  --dict-color: rgb(203, 255, 212);
  --dict-bg-opacity: 0.1;
  --tag-text-color: black;
}
.definition-item[data-dictionary^="Words\.hk"] {
  --dict-color: #ae1625;
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="CE Wiktionary"] {
  --dict-color: rgb(235, 206, 161);
  --dict-bg-opacity: 0.05;
  --tag-text-color: black;
}
.definition-item[data-dictionary="CC-Canto"] {
  --dict-color: rgb(34, 34, 34);
  --dict-bg-opacity: 0.03;
}
.definition-item[data-dictionary="Wenlin ABC"] {
  --dict-color: #ffca08;
  --dict-bg-opacity: 0.05;
}

/* Frequency Dicts (Also Kanji Dicts) */

/* Japanese Frequency */
.frequency-group-item[data-details^="JPDB"] {
  --tag-frequency-background-color: #ff3e3d;
}
.frequency-group-item[data-details^="Innocent"] {
  --tag-frequency-background-color: #e82c9c;
}
.frequency-group-item[data-details="Novels"] {
  --tag-frequency-background-color: #e537fa;
}
.frequency-group-item[data-details^="BCCWJ"] {
  --tag-frequency-background-color: #8f27e3;
}
.frequency-group-item[data-details="CC100"] {
  --tag-frequency-background-color: #6238fa;
}
.frequency-group-item[data-details="Conversation Corpus"] {
  --tag-frequency-background-color: #273ce3;
}
.frequency-group-item[data-details^="青空文庫"] {
  --tag-frequency-background-color: #3d93ff;
}
.frequency-group-item[data-details="Youtube"] {
  --tag-frequency-background-color: #fd0101;
}
.frequency-group-item[data-details^="Wikipedia"] {
  --tag-frequency-background-color: #447ff5;
}

/* Chinese Frequency */
.frequency-group-item[data-details="HSK"] {
  --tag-frequency-background-color: #ff3e3d;
}
.frequency-group-item[data-details="BLCUlit"] {
  --tag-frequency-background-color: #e82c9c;
}
.frequency-group-item[data-details="SUBTLEX-CH"] {
  --tag-frequency-background-color: #e537fa;
}
.frequency-group-item[data-details="BLCUcoll"] {
  --tag-frequency-background-color: #8f27e3;
}
.frequency-group-item[data-details="BLCUmixed"] {
  --tag-frequency-background-color: #6238fa;
}
.frequency-group-item[data-details="BLCUnews"] {
  --tag-frequency-background-color: #273ce3;
}
.frequency-group-item[data-details="BLCUsci"] {
  --tag-frequency-background-color: #3d93ff;
}

/* End Dictionary Colorizer */
body
{
font-family:"HG明朝B";
font-weight: ;
background-color: #1a1b26

}
/* Globally set the line count */
:root {
    --collapsible-definition-line-count: 6;
}

/* Set the line count for a specific dictionary */
.definition-item[data-dictionary='JMdict'] {
    --collapsible-definition-line-count: 2;
}

/* Spoiler-like functionality, use with Force collapsed mode */
.definition-item[data-dictionary='JMdict'] .definition-item-inner.collapsible.collapsed {
    color: #000000;
    background-color: #000000;
}

/* remove misc dict classifications/codepoints/stats */
.kanji-glyph-data > tbody > tr:nth-child(n + 3) {
  display: none;
}

/* remove stroke diagram, freq, header for next entries */
div.entry[data-type='kanji']:nth-child(n + 2) .kanji-glyph-container,
div.entry[data-type='kanji']:nth-child(n + 2) [data-section-type='frequencies'],
div.entry[data-type='kanji']:nth-child(n + 2) table.kanji-glyph-data > tbody > tr:first-child {
  display: none;
}

/* remove 'No data found' */
.kanji-info-table-item-value-empty {
  display: none;
}

/* reduce extra padding */
.kanji-glyph-data,
div.entry[data-type='kanji'],
div.entry[data-type='kanji']:nth-child(n + 2) .kanji-glyph-data > tbody > tr > *,
.kanji-glyph-data dl.kanji-readings-japanese,
div.entry[data-type='kanji']:nth-child(n + 2)
  .kanji-glyph-data
  dl.kanji-readings-chinese[data-count='0'] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0em;
  margin-top: 0 !important;
}
/* remove horizontal lines */
.entry + .entry[data-type='kanji'],
div#dictionary-entries > div.entry:nth-child(n + 2) .kanji-glyph-data > tbody > tr > * {
  border-top: none !important;
}
/* change decimal list */
.kanji-gloss-list {
  list-style-type: circle;
}
.headword-term ruby rt {
  user-select: none;
  color: #fff0c9
}
.headword-term {
  color: #fff0c9
}
.headword-kanji-link {
  color: #fff0c9
}

@40elyK
Copy link
Author

40elyK commented Feb 6, 2025

Thanks for the CSS, it looks so good!

Btw, when setting the profile conditions, can I make it more specific, like only using a profile when another profile is in use? I have both Chinese and Japanese profiles, so I don't want my bilingual dictionaries mixing with each other.

@NovaKing001
Copy link

@40elyK Unfortunately there is no profile conditional statement, you may want to open a new issue and request this. But, you can get something close enough. Notice that there is a modified key conditional. Let's say for example your Chinese bilingual profile only gets triggered when you press ctrl + shift

Image
Your Japanese Bilingual profile then gets triggered when no such action is performed.

Image

this will be the end result (sorry for using just Japanese dictionaries I don't have any bilingual dictionaries installed on yomitan)

Image

Let me know if you have any other questions.

@40elyK
Copy link
Author

40elyK commented Feb 7, 2025

Nah, no more questions. You've been an amazing help. Thanks man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants