mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Animate hint activation
This commit is contained in:
parent
96ba30f754
commit
7f202f513d
@ -933,7 +933,11 @@ class IframeBoss:
|
||||
hint = data.hint
|
||||
if hint.type is 'link':
|
||||
a = document.body.querySelector(f'[data-calibre-hint-value="{hint.value}"]')
|
||||
self.activate_link(hint.data.name, hint.data.frag, a)
|
||||
a.addEventListener("animationend", def (ev):
|
||||
a.classList.remove('calibre-animated-hint')
|
||||
self.activate_link(hint.data.name, hint.data.frag, a)
|
||||
, False)
|
||||
a.classList.add('calibre-animated-hint')
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -125,6 +125,19 @@ def apply_colors(is_content_popup):
|
||||
cursor: default !important;\
|
||||
padding: 1px !important;\
|
||||
border: solid 1px {opts.color_scheme.foreground} !important;\
|
||||
|
||||
}}
|
||||
|
||||
.calibre-animated-hint {{
|
||||
animation-name: calibre-animate-hint; \
|
||||
animation-duration: 0.3s; \
|
||||
animation-timing-function: ease-out; \
|
||||
display: inline-block !important; \
|
||||
text-indent: 0 !important; \
|
||||
}}
|
||||
@keyframes calibre-animate-hint {{
|
||||
from {{ transform: scale(1); }}
|
||||
to {{ transform: scale(2); }}
|
||||
}}
|
||||
'''
|
||||
ss.textContent = text
|
||||
|
Loading…
x
Reference in New Issue
Block a user