242242 < %- partial (' post/comment' , null , { cache: true }) % >
243243 < % _ } _% >
244244 < % _ } _% >
245+ < % _ if (is_home () && theme .subtitle ? .typing ? .enable ) { _% >
246+ < %- js ({src: vendorCdn (theme .vendor .js .typed )[0 ], integrity: vendorCdnIntegrity (theme .vendor .js .typed )[0 ], crossorigin: " anonymous" , defer: true , onload: " initSubtitleTyping()" }) % >
247+ < script data- pjax>
248+ window .subtitleTypingConfig = {
249+ strings: < %- JSON .stringify (theme .subtitle .typing .strings || []) % > ,
250+ typeSpeed: < %= theme .subtitle .typing .typeSpeed || 100 % > ,
251+ backSpeed: < %= theme .subtitle .typing .backSpeed || 50 % > ,
252+ backDelay: < %= theme .subtitle .typing .backDelay || 2000 % > ,
253+ startDelay: < %= theme .subtitle .typing .startDelay || 300 % > ,
254+ loop: < %= theme .subtitle .typing .loop !== false % > ,
255+ shuffle: < %= theme .subtitle .typing .shuffle !== false % > ,
256+ showCursor: < %= JSON .stringify (theme .subtitle .typing .showCursor ) % > || true ,
257+ cursorChar: " <%= theme.subtitle.typing.cursorChar || '|' %>" ,
258+ smartBackspace: < %= JSON .stringify (theme .subtitle .typing .smartBackspace ) % > || false ,
259+ };
260+
261+ function initSubtitleTyping () {
262+ const subtitleElement = document .querySelector (' #subtitle' );
263+ if (! subtitleElement || ! window .Typed || ! window .subtitleTypingConfig ) {
264+ return ;
265+ }
266+
267+ if (window .__typedInstance ) {
268+ window .__typedInstance .destroy ();
269+ }
270+
271+ window .__typedInstance = new Typed (' #subtitle span' , window .subtitleTypingConfig );
272+ }
273+
274+ if (! window .__typedInitialized ) {
275+ window .__typedInitialized = true ;
276+
277+ if (document .readyState === ' loading' ) {
278+ document .addEventListener (' DOMContentLoaded' , initSubtitleTyping);
279+ } else {
280+ initSubtitleTyping ();
281+ }
282+ } else {
283+ initSubtitleTyping ();
284+ }
285+ < / script>
286+ < % _ } _% >
245287 < / div>
246288< / div>
247289
350392 pangu? .spacingPage ();
351393 }
352394 < / script>
353- < % _ } _% >
354-
355- < % _ if (is_home () && theme .subtitle ? .typing ? .enable ) { _% >
356- < script data- pjax>
357- window .subtitleTypingConfig = {
358- strings: < %- JSON .stringify (theme .subtitle .typing .strings || []) % > ,
359- typeSpeed: < %= theme .subtitle .typing .typeSpeed || 100 % > ,
360- backSpeed: < %= theme .subtitle .typing .backSpeed || 50 % > ,
361- backDelay: < %= theme .subtitle .typing .backDelay || 2000 % > ,
362- startDelay: < %= theme .subtitle .typing .startDelay || 300 % > ,
363- loop: < %= theme .subtitle .typing .loop !== false % > ,
364- shuffle: < %= theme .subtitle .typing .shuffle !== false % > ,
365- showCursor: < %= JSON .stringify (theme .subtitle .typing .showCursor ) % > || true ,
366- cursorChar: " <%= theme.subtitle.typing.cursorChar || '|' %>" ,
367- smartBackspace: < %= JSON .stringify (theme .subtitle .typing .smartBackspace ) % > || false ,
368- };
369-
370- function initSubtitleTyping () {
371- const subtitleElement = document .querySelector (' #subtitle' );
372- if (! subtitleElement || ! window .Typed || ! window .subtitleTypingConfig ) {
373- return ;
374- }
375-
376- if (window .__typedInstance ) {
377- window .__typedInstance .destroy ();
378- }
379-
380- window .__typedInstance = new Typed (' #subtitle' , window .subtitleTypingConfig );
381- }
382-
383- if (! window .__typedInitialized ) {
384- window .__typedInitialized = true ;
385-
386- if (document .readyState === ' loading' ) {
387- document .addEventListener (' DOMContentLoaded' , initSubtitleTyping);
388- } else {
389- initSubtitleTyping ();
390- }
391- } else {
392- initSubtitleTyping ();
393- }
394- < / script>
395- < %- js ({src: vendorCdn (theme .vendor .js .typed )[0 ], integrity: vendorCdnIntegrity (theme .vendor .js .typed )[0 ], crossorigin: " anonymous" , defer: true , onload: " initSubtitleTyping()" }) % >
396395< % _ } _% >
0 commit comments