mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Tweak latest post highlight
Tweak JS to work on a 2nd click, too. Tweak CSS for shorter highlight and linear transition.
This commit is contained in:
@@ -5,7 +5,10 @@ title: Home
|
||||
<div class="newest-post">
|
||||
<emph>Latest Post</emph>: {% for post in site.categories.rust-os limit:1 %}
|
||||
<strong><a href="#{{ post.id }}" onclick="
|
||||
document.getElementById('{{ post.id }}').className += ' updated';
|
||||
post = document.getElementById('{{ post.id }}');
|
||||
post.className = post.className.replace(/\b updated\b/, '');
|
||||
post.offsetWidth = post.offsetWidth; // trigger reflow -> works on 2nd click, too
|
||||
post.className += ' updated';
|
||||
">{{post.title}}</a></strong>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user