Skip to content

Instantly share code, notes, and snippets.

@xerosanyam
Last active March 24, 2023 23:31
Show Gist options
  • Save xerosanyam/74461bc424dd92f04cd8f8275196d2ee to your computer and use it in GitHub Desktop.
Save xerosanyam/74461bc424dd92f04cd8f8275196d2ee to your computer and use it in GitHub Desktop.
My settings for Anki. This include 15 sec timer and left align
{{Front}}
<hr>
{{Back}}
{{Front}}
<br/>
<br/>
<span class="timer" id="s2"><span>
<script>
function countdown( elementName, minutes, seconds )
{
var element, endTime, hours, mins, msLeft, time;
function twoDigits( n )
{
return (n <= 9 ? "0" + n : n);
}
function updateTimer()
{
msLeft = endTime - (+new Date);
if ( msLeft < 1000 ) {
element.innerHTML = "Countdown's Over!";
} else {
time = new Date( msLeft );
hours = time.getUTCHours();
mins = time.getUTCMinutes();
element.innerHTML = (hours ? hours + ':' + twoDigits( mins ) : mins) + ':' + twoDigits( time.getUTCSeconds() );
setTimeout( updateTimer, time.getUTCMilliseconds() + 500 );
}
}
element = document.getElementById( elementName );
endTime = (+new Date) + 1000 * (60*minutes + seconds) + 500;
updateTimer();
}
countdown("s2", 0,15 );//2nd value is the minute, 3rd is the seconds
</script>
.card {
font-family: arial;
font-size: 20px;
text-align: left;
color: black;
background-color: white;
}
@xerosanyam
Copy link
Author

Rules before making Anki cards
https://www.supermemo.com/en/articles/20rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment