Created
September 16, 2015 05:44
-
-
Save gajewsk2/7a4435ccf39ccf465462 to your computer and use it in GitHub Desktop.
removing subs2srs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="snapshot">{{Snapshot}} | |
<div class="small light"'>{{SequenceMarker}}</div> | |
<span class="video">{{Video}} </span> | |
<span class='audio' >{{Audio}}</span> | |
</div> | |
body, .night_mode, body a{ | |
background-color: #202020 !important; | |
text-decoration: none; | |
color: #FFFFFF; | |
font-size: 32px | |
} | |
.snapshot{ | |
display:block | |
width: 50%; | |
height:50%; | |
padding-bottom: 1em; | |
} | |
.reading{ | |
padding-bottom: 1em; | |
} | |
.hidden{ | |
display: none; | |
} | |
.card | |
{ | |
color: #FFFFFF; | |
font-family: arial; | |
font-size: 20px; | |
text-align: center; | |
color: black; | |
} | |
div [id^=hint] { | |
color: #FFFFFF; | |
text-decoration: none!important; | |
} | |
.hint{ | |
font-size: 22px !important; | |
text-decoration: underline !important; | |
} | |
.small{ | |
font-size: .5em !important; | |
} | |
.light{ | |
color: #FFFFFF; | |
} | |
.video{ | |
margin-right: 25% | |
} | |
.audio{ | |
} | |
{{FrontSide}} | |
<div class="reading"> | |
<a href="http://jisho.org/search/{{kanji:Expression}}"> | |
<span id="expression-content">{{Expression}}</span> | |
<span class="hidden" id="reading-content">{{furigana:Reading}}</span> | |
</a> | |
</div> | |
<div class="answer light small"> | |
<a href="http://jisho.org/search/{{kanji:Expression}}"> | |
{{hint:furigana:Meaning}} | |
</a> | |
</div> | |
<script> | |
function linkHit (e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
reading.classList.remove('hidden'); | |
expression.classList.add('hidden'); | |
} | |
var reading = document.getElementById("reading-content"); | |
var expression = document.getElementById('expression-content'); | |
var clicked = false; | |
expression.addEventListener('click', function(e){ | |
if (reading.innerText !== expression.innerText && !clicked) { | |
clicked = true; | |
linkHit(e); | |
} | |
}); | |
document.addEventListener('keydown', function(e) { | |
if(e.keyCode === 96){ | |
linkHit(e); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment