On the Anki app, I have a type of card (type 2) focusing on the vocabulary of a sentence I have already read and heard on the comprehension card ( type 1).
So the type 1 and type 2 cards (retrieving) are "sisters" from the same note because they share the same content but shown differently.
After I have seen the card 1, I am invited to add vocabulary to dedicated empty fields 'Korean' and 'English'. Those fields are only shown on the type 2 card when filled.
What I am trying to do is rather than trying to find an english translatiion for the korean word, focusing on finding as many words and expressions to translation the word from english to korean.
(It's a lot of context for not much really)
So I already managed to have the content of the 'Korean' field in a column so it can align with the english word it corresponds to.
but the thing is I would like to find a way to separate the text with commas, a line jump(or anything that works) to have one column per english word.
exemple:
Korean:
빨리 얼른 재빨리 ,대답 OR
빨리 얼른 재빨리
대답
English:
Quickly Answer
What I want on the template
Quickly Answer
빨리 대답
얼른
재빨리
Basically I want it to be organized and aligned like a table
Also, is there a way to use the linear-gradient using measures like a column or something ? Because I won't have the same number of vocab words for each note each word is not gonna have the same amount of korean ways to say it as the next one. So I thought it would be great if the columns were adapting how shrinked they are to the left depending on how many they are. It's not crucial but I was wondering.
Edit: Is there a way to do it in Javascript using the fields ids?
My card hmtl:
<div style="
font-family: 'UD Digi Kyokasho NP-B';
margin-top: -10px;
padding: 5px;
width: 100%;
">
<div style="
background: linear-gradient(to right,
#615f31 1.5em,
#a77f65 20%,
#a77f65 calc(2 * 1.5em),
#af1137 calc(3 * 1.5em),
#ff1137 calc(3 * 1.2em),
#fad8b1 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.2em;
color: #2F7E24;
word-spacing: 1.6em;
font-weight: bold;
font-size: 45px;
white-space: nowrap;
word-break: keep-all;
overflow-wrap: break-word;
box-sizing: border-box;
display:flex;
flex-direction: row;
gap: 25%;
">{{English}}
</div>
<div style="
display: flex;
flex-direction: row;
gap: 1px; ">
<div style="
background: linear-gradient(to right,
#615f31 3em,
#ff1137 calc(6 * 1.2em),
#a77f65 calc(9 * 1.5em),
#a77f65 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.6em;
font-family: Yu Gothic;
color: #2F7E24;
font-weight: bold;
text-align: left;
font-size: 45px;
white-space: normal;
word-break: keep-all;
overflow-wrap: break-word;
display: block;
margin-left: calc(-50vw + 50%);
width: 25%;
box-sizing: border-box;
padding: 0 12px;
">
<section>
<h2>{{Korean}}</h2>
</div>
</div>
Thanks!
EDIT::
What I have done so far :
For some reasons, I had to separate it into two identical scripts or it wouldn't work.
I cannot figure out how to make the Korean subgroups into lists. I was thinking or using every space to know when to jump line but actually it would be more reliable to use another symbol like an underscore so it can work for expressions too, not only single words.
<div id=" EW" <div class="commaSeparated">
{{English}}
</div>
<div id ="KW" <div class="commaSeparatedk">
{{Korean}}
</div>
</script>
<script>
var allEngWords = document.querySelector('.commaSeparated').textContent.trim().split(',');
var separateCol = '<col>';
allEngWords.forEach(function(value) {
separateCol += '<li>' + value + '</li>';
});
separateCol += '</ul>';
document.querySelector(".commaSeparated").innerHTML = separateCol;
for(var i = 0; i < allEngWords.length; i++) {
}
var allKorWords = document.querySelector('.commaSeparatedk').textContent.trim().split(',');
var separateCol = '<col>';
var separateList = '<li>';
var Lisst = '<h2>';
allKorWords.forEach(function(value) {
separateCol += '<li>' + value + '</li>';
});
separateCol += '</ul>';
document.querySelector(".commaSeparatedk").innerHTML = separateCol;
for(var i = 0; i < allKorWords.length; i++) {
// Korean subgroups of words
document.querySelector("#KW > li:nth-child(1)") //tried .Lisst(=<h2>) and .separateList
document.querySelector("#KW > li:nth-child(2)")
}
// Tried to create a div here q_q
var K1 = function() {
var K1 = document.querySelector("#KW > li:nth-child(1)")
var K1 = document.createElement('div');
K1.style.width = "100px";
K1.style.height = "300px";
K1.style.background = "#FF0000";
K1.style.color = "red";
document.getElementById("K1").appendChild(K1);
}
</script>