@@ -17,32 +17,31 @@ <h1 id="main-title">
17
17
{%- if title == config.title -%}
18
18
< script defer async >
19
19
( function internationalize_hoverbear ( ) {
20
- const data = { { load_data ( path = "static/internationalized-hoverbear.json" ) | json_encode | safe
21
- } } ;
22
- const langs = Object . keys ( data ) ;
23
- let current_lang = "english" ;
24
- let num_languages = langs . length ;
25
- window . setInterval ( function ( ) {
26
- let new_lang ;
27
- // Guard against same result.
28
- do {
29
- new_lang = langs [ Math . floor ( Math . random ( ) * num_languages ) ] ;
30
- } while ( current_lang == new_lang ) ;
20
+ const data = { { load_data ( path = "static/internationalized-hoverbear.json" ) | json_encode | safe } } ;
21
+ const langs = Object . keys ( data ) ;
22
+ let current_lang = "english" ;
23
+ let num_languages = langs . length ;
24
+ window . setInterval ( function ( ) {
25
+ let new_lang ;
26
+ // Guard against same result.
27
+ do {
28
+ new_lang = langs [ Math . floor ( Math . random ( ) * num_languages ) ] ;
29
+ } while ( current_lang == new_lang ) ;
31
30
32
- let new_display = data [ new_lang ] . display ;
33
- let main_title = document . getElementById ( "main-link" ) ;
31
+ let new_display = data [ new_lang ] . display ;
32
+ let main_title = document . getElementById ( "main-link" ) ;
34
33
35
- // Reflow
36
- let parent = main_title . parentElement ;
37
- let old_animation = parent . style . animation ;
38
- parent . style . opacity = 0 ;
39
- parent . style . animation = 'none' ;
40
- parent . offsetHeight ;
41
- parent . style . animation = old_animation ;
42
-
43
- main_title . innerText = `${ new_display } ` ;
44
- } , 5000 ) ;
45
- } ) ( )
34
+ // Reflow
35
+ let parent = main_title . parentElement ;
36
+ let old_animation = parent . style . animation ;
37
+ parent . style . opacity = 0 ;
38
+ parent . style . animation = 'none' ;
39
+ parent . offsetHeight ;
40
+ parent . style . animation = old_animation ;
41
+
42
+ main_title . innerText = `${ new_display } ` ;
43
+ } , 5000 ) ;
44
+ } ) ( )
46
45
</ script >
47
46
{%- endif %}
48
47
0 commit comments