@@ -172,7 +172,8 @@ const BS_CONVERTER_URL = "https://cdn.jsdelivr.net/npm/nepali-date-library@1.1.9
172172const THEME_STORAGE_KEY = "neoThemeVariant.v1" ;
173173const ACTION_STORAGE_KEY = "neoAutoAction.v1" ;
174174const HERO_TYPED_KEY = "neoHeroTyped.v1" ;
175- const MINI_PROMPT = "╰─❯" ;
175+ const MINI_PROMPT_NERD = "╰─❯" ;
176+ const MINI_PROMPT_FALLBACK = "$" ;
176177const NERD_FONT_FAMILIES = [
177178 "JetBrainsMono Nerd Font" ,
178179 "FiraCode Nerd Font" ,
@@ -214,6 +215,7 @@ let blackflagShotLockUntil = 0;
214215let pulseWaveLayer = null ;
215216let pulseWaveRing = null ;
216217let pulseCoreFlash = null ;
218+ let pulseFallbackTimeout = 0 ;
217219const typewriterTokens = new WeakMap ( ) ;
218220const heroTaglineVariants = [
219221 "Aura Farmer // Chaotic Fun 🚀" ,
@@ -556,37 +558,57 @@ function triggerPulseBackdrop(clientX = null, clientY = null) {
556558 pulseCoreFlash . style . left = `${ x } px` ;
557559 pulseCoreFlash . style . top = `${ y } px` ;
558560
561+ pulseWaveLayer . classList . remove ( "pulse-active" ) ;
562+ pulseCoreFlash . classList . remove ( "pulse-active" ) ;
563+ // Reflow so fallback class animation retriggers on rapid launches.
564+ void pulseWaveLayer . offsetWidth ;
565+ pulseWaveLayer . classList . add ( "pulse-active" ) ;
566+ pulseCoreFlash . classList . add ( "pulse-active" ) ;
567+ if ( pulseFallbackTimeout ) window . clearTimeout ( pulseFallbackTimeout ) ;
568+ pulseFallbackTimeout = window . setTimeout ( ( ) => {
569+ pulseWaveLayer ?. classList . remove ( "pulse-active" ) ;
570+ pulseCoreFlash ?. classList . remove ( "pulse-active" ) ;
571+ } , 920 ) ;
572+
573+ if ( typeof pulseWaveLayer . animate !== "function" || typeof pulseCoreFlash . animate !== "function" ) {
574+ return ;
575+ }
576+
559577 pulseWaveLayer . getAnimations ( ) . forEach ( ( animation ) => animation . cancel ( ) ) ;
560578 pulseWaveRing ?. getAnimations ( ) . forEach ( ( animation ) => animation . cancel ( ) ) ;
561579 pulseCoreFlash . getAnimations ( ) . forEach ( ( animation ) => animation . cancel ( ) ) ;
562580
563581 const waveDuration = isConstrained ? 640 : 820 ;
564582 const waveScaleTo = isConstrained ? 1.12 : 1.2 ;
565- pulseWaveLayer . animate (
566- [
567- { transform : "scale(0.92)" , opacity : 0 } ,
568- { opacity : isFirefoxLike ? 0.62 : 0.82 , offset : 0.18 } ,
569- { opacity : 0.3 , offset : 0.6 } ,
570- { transform : `scale(${ waveScaleTo } )` , opacity : 0 } ,
571- ] ,
572- { duration : waveDuration , easing : "cubic-bezier(0.16, 0.82, 0.27, 1)" , fill : "forwards" }
573- ) ;
574-
575- pulseWaveRing ?. animate (
576- [
577- { transform : "translate(-50%, -50%) scale(0.34)" , opacity : 0.95 } ,
578- { transform : `translate(-50%, -50%) scale(${ isConstrained ? 9.5 : 13 } )` , opacity : 0 } ,
579- ] ,
580- { duration : waveDuration , easing : "ease-out" , fill : "forwards" }
581- ) ;
582-
583- pulseCoreFlash . animate (
584- [
585- { transform : "translate(-50%, -50%) scale(0.45)" , opacity : 0.9 } ,
586- { transform : "translate(-50%, -50%) scale(3.4)" , opacity : 0 } ,
587- ] ,
588- { duration : isConstrained ? 320 : 420 , easing : "cubic-bezier(0.2, 0.7, 0.3, 1)" , fill : "forwards" }
589- ) ;
583+ try {
584+ pulseWaveLayer . animate (
585+ [
586+ { transform : "scale(0.92)" , opacity : 0 } ,
587+ { opacity : isFirefoxLike ? 0.62 : 0.82 , offset : 0.18 } ,
588+ { opacity : 0.3 , offset : 0.6 } ,
589+ { transform : `scale(${ waveScaleTo } )` , opacity : 0 } ,
590+ ] ,
591+ { duration : waveDuration , easing : "cubic-bezier(0.16, 0.82, 0.27, 1)" , fill : "forwards" }
592+ ) ;
593+
594+ pulseWaveRing ?. animate (
595+ [
596+ { transform : "translate(-50%, -50%) scale(0.34)" , opacity : 0.95 } ,
597+ { transform : `translate(-50%, -50%) scale(${ isConstrained ? 9.5 : 13 } )` , opacity : 0 } ,
598+ ] ,
599+ { duration : waveDuration , easing : "ease-out" , fill : "forwards" }
600+ ) ;
601+
602+ pulseCoreFlash . animate (
603+ [
604+ { transform : "translate(-50%, -50%) scale(0.45)" , opacity : 0.9 } ,
605+ { transform : "translate(-50%, -50%) scale(3.4)" , opacity : 0 } ,
606+ ] ,
607+ { duration : isConstrained ? 320 : 420 , easing : "cubic-bezier(0.2, 0.7, 0.3, 1)" , fill : "forwards" }
608+ ) ;
609+ } catch ( error ) {
610+ // Class-based fallback above already guarantees a visible pulse.
611+ }
590612}
591613
592614function playPulseSound ( pulseCount = 1 ) {
@@ -786,12 +808,11 @@ function applyTheme(theme, notify = false) {
786808
787809function initThemeSwitcher ( ) {
788810 let savedTheme = "neo" ;
789- let urlTheme = null ;
790811 try {
791- urlTheme = getThemeFromUrl ( ) ;
812+ const urlTheme = getThemeFromUrl ( ) ;
792813 const storedTheme = window . localStorage . getItem ( THEME_STORAGE_KEY ) ;
793- savedTheme = storedTheme || urlTheme || "neo" ;
794- if ( ! storedTheme && urlTheme ) {
814+ savedTheme = urlTheme || storedTheme || "neo" ;
815+ if ( urlTheme && urlTheme !== storedTheme ) {
795816 window . localStorage . setItem ( THEME_STORAGE_KEY , urlTheme ) ;
796817 }
797818 } catch ( error ) {
@@ -802,7 +823,7 @@ function initThemeSwitcher() {
802823 window . addEventListener ( "pageshow" , ( ) => {
803824 let latestTheme = "neo" ;
804825 try {
805- latestTheme = window . localStorage . getItem ( THEME_STORAGE_KEY ) || getThemeFromUrl ( ) || "neo" ;
826+ latestTheme = getThemeFromUrl ( ) || window . localStorage . getItem ( THEME_STORAGE_KEY ) || "neo" ;
806827 } catch ( error ) {
807828 latestTheme = "neo" ;
808829 }
@@ -950,6 +971,13 @@ function appendTerminalLine(text, type = "out") {
950971 miniTerminalOutput . scrollTop = miniTerminalOutput . scrollHeight ;
951972}
952973
974+ function getMiniPrompt ( ) {
975+ if ( document . body . classList . contains ( "no-nerd-font" ) || document . body . classList . contains ( "force-terminal-fallback" ) ) {
976+ return MINI_PROMPT_FALLBACK ;
977+ }
978+ return MINI_PROMPT_NERD ;
979+ }
980+
953981function clearTerminalOutput ( ) {
954982 if ( ! miniTerminalOutput ) return ;
955983 miniTerminalOutput . innerHTML = "" ;
@@ -1001,7 +1029,7 @@ function runTerminalCommand(rawCommand) {
10011029 const command = rawCommand . trim ( ) ;
10021030 if ( ! command ) return ;
10031031
1004- appendTerminalLine ( `${ MINI_PROMPT } ${ command } ` , "cmd" ) ;
1032+ appendTerminalLine ( `${ getMiniPrompt ( ) } ${ command } ` , "cmd" ) ;
10051033 const [ actionRaw , ...rest ] = command . split ( / \s + / ) ;
10061034 const action = actionRaw . toLowerCase ( ) ;
10071035 const arg = rest . join ( " " ) ;
0 commit comments