
Untitled
By: a guest on
May 25th, 2012 | syntax:
HTML | size: 2.63 KB | views:
153 | expires: Never
<!--This doesn't appear on the card; we just want to steal its content later -->
<div id="image" style="display:none">{{{Sentence-Image}}}</div>
<div id="questionContainer">
<div id="sentenceClozed">{{{Sentence-Clozed}}}</div>
<div id="sentenceEnglish">{{{Sentence-English}}}</div>
<div id="hint">{{{Hint}}}</div>
</div>
<script>
// Get the image path. Assuming it's a .jpg.
var img = document.getElementById("image");
var start = img.innerHTML.indexOf("src=\"") +5;
var end = img.innerHTML.indexOf(".jpg\"");
var imgPath = img.innerHTML.substring(start, end) + ".jpg";
// And make it the background image
document.body.style.backgroundImage='url('+imgPath+')';
// Fill in the clozed portion with its English meaning
var eng = "{{{Vocabulary-English}}}"
var cloze = document.getElementById("sentenceClozed");
cloze.innerHTML = cloze.innerHTML.replace(/( )/, "「"+eng+"」");
</script>
<style type="text/css">
body
{
background-color:#000;
background-size:cover;
background-repeat:no-repeat;
background-position: 50% 50%;
margin:0px;
padding:0px;
height:100%;
}
/*Question card*/
#questionContainer
{
padding: 5px;
border-radius: 8px;
background-color: rgba(0,0,0,0.7);
margin-left: 2%;
margin-right: 2%;
}
#sentenceClozed
{
color: #ed9;
font-size: 1.3em;
}
#sentenceClozed b,
#sentenceClozed [style="font-weight: bold;"],
#sentenceClozed [style="font-weight:600;"]
{
color: #f0b570;
background-color: rgba(0,0,0,0.2);
font-family: monospace;
}
#sentenceEnglish
{
display: inline-block;
font-size: 1.1em;
color:#000;
background-color:#000;
margin-top: 10px;
}
#sentenceEnglish:hover
{
color: #dfb;
}
#hint
{
color: #fff;
font-size: 1.3em;
padding-top:5px;
}
#sentenceEnglishAfterAnswer
{
display: inline-block;
font-size: 1.1em;
color: #dfb;
margin-top: 5px;
}
/*Answer card*/
#answerContainer
{
position: relative;
border-radius: 8px;
background-color: rgba(0,0,0,0.7);
padding: 5px;
margin-left: 2%;
margin-right: 2%;
}
#vocabFurigana
{
font-size: 2.3em;
color: #f90;
}
#reading
{
font-size: 1.5em;
color: #ed9;
padding-top:2px;
}
#reading b,
#reading [style="font-weight: bold;"],
#reading [style="font-weight:600;"]
{
color: #f0b570;
background-color: rgba(0,0,0,0.2);
}
/*Audio images for ankidroid*/
#sentenceAudio
{
position: absolute;
top: 0.2em;
left: 0.2em;
}
#sentenceAudio img
{
width: 50%;
}
#vocabAudio
{
position: absolute;
top: 0.2em;
right: 0.2em;
}
#vocabAudio img
{
width: 50%;
}
</style>