@@ -104,22 +104,26 @@ function updateGameUI() {
104104 const levelIndex = Math . min ( eggCount , LEVELS . length - 1 ) ;
105105 const rank = LEVELS [ levelIndex ] ;
106106
107+ // 1. Level Elements
107108 const badge = document . getElementById ( 'level-badge' ) ;
108109 const nameLabel = document . getElementById ( 'level-name' ) ;
109110 const numLabel = document . getElementById ( 'level-number' ) ;
110111 const progressBar = document . getElementById ( 'level-progress' ) ;
111112
113+ // 2. XP Display Element
114+ const xpDisplay = document . getElementById ( 'total-xp-display' ) ;
115+ if ( xpDisplay ) {
116+ // Show current XP toward next level (or cumulative if you prefer)
117+ xpDisplay . innerText = currentXP ;
118+ }
119+
112120 if ( levelIndex >= 10 ) {
113121 document . body . classList . add ( 'level-architect' ) ;
114- } else {
115- document . body . classList . remove ( 'level-architect' ) ;
116122 }
117123
118124 if ( badge ) {
119125 badge . innerText = rank . emoji ;
120126 badge . style . backgroundColor = rank . color ;
121- badge . classList . add ( 'animate-bounce' ) ;
122- setTimeout ( ( ) => badge . classList . remove ( 'animate-bounce' ) , 1000 ) ;
123127 }
124128
125129 if ( nameLabel ) {
@@ -130,7 +134,9 @@ function updateGameUI() {
130134 if ( numLabel ) numLabel . innerText = levelIndex ;
131135
132136 if ( progressBar ) {
133- const progressPercent = ( levelIndex / ( LEVELS . length - 1 ) ) * 100 ;
137+ // Logic for progress bar between levels
138+ // currentXP / XP_PER_LEVEL gives the % toward NEXT level
139+ const progressPercent = ( currentXP / XP_PER_LEVEL ) * 100 ;
134140 progressBar . style . width = `${ progressPercent } %` ;
135141 progressBar . style . backgroundColor = rank . color ;
136142 }
@@ -214,6 +220,9 @@ function toggleTheme() {
214220 const current = localStorage . getItem ( 'theme' ) || 'light' ;
215221 const next = current === 'light' ? 'dark' : ( current === 'dark' ? 'random' : 'light' ) ;
216222 applyTheme ( next ) ;
223+
224+ // Maintenance XP Trigger
225+ addMaintenanceXP ( ) ;
217226}
218227
219228function updateThemeIcon ( theme ) {
@@ -535,13 +544,19 @@ document.addEventListener('DOMContentLoaded', () => {
535544 * 9. ENHANCED XP & SKILL MINING SYSTEM
536545 */
537546let currentXP = JSON . parse ( localStorage . getItem ( 'userXP' ) ) || 0 ;
538- const XP_PER_LEVEL = 20 ; // Adjust this to make leveling harder/easier
547+ const XP_PER_LEVEL = 45 ; // Adjust this to make leveling harder/easier
539548
540549function addExperience ( amount ) {
541550 // Stop XP if at Max Level or if system is locked (Self-Destruct)
542551 const isLocked = document . getElementById ( 'dev-tools' ) ?. hasAttribute ( 'data-lock' ) ;
543552 if ( unlockedEggs . length >= LEVELS . length - 1 || isLocked ) return ;
544553
554+ const xpNum = document . getElementById ( 'total-xp-display' ) ;
555+ if ( xpNum ) {
556+ xpNum . classList . add ( 'xp-pulse' ) ;
557+ setTimeout ( ( ) => xpNum . classList . remove ( 'xp-pulse' ) , 100 ) ;
558+ }
559+
545560 currentXP += amount ;
546561
547562 // Check for Level Up
@@ -555,24 +570,24 @@ function addExperience(amount) {
555570 updateGameUI ( ) ;
556571}
557572
558- function createFloatingXP ( event ) {
573+ function createFloatingXP ( event , type = "skill" ) {
559574 const float = document . createElement ( 'div' ) ;
560- // Color matches Level 5 "Data Miner" Cyan
561- const levelColor = LEVELS [ unlockedEggs . length ] ?. color || '#06b6d4' ;
575+ const levelIndex = unlockedEggs . length ;
576+ const rankColor = LEVELS [ levelIndex ] ?. color || '#06b6d4' ;
577+
578+ float . innerText = type === "maintenance" ? "+5 XP (MAINT)" : "+1 XP" ;
562579
563- float . innerText = '+1 XP' ;
564580 float . style . cssText = `
565581 position: fixed;
566582 left: ${ event . clientX } px;
567583 top: ${ event . clientY } px;
568- color: ${ levelColor } ;
569- font-family: monospace;
584+ color: ${ rankColor } ;
585+ font-family: 'JetBrains Mono', monospace;
570586 font-weight: 900;
571- font-size: 14px;
587+ font-size: ${ type === "maintenance" ? ' 14px' : '12px' } ;
572588 pointer-events: none;
573589 z-index: 10000;
574590 animation: float-up 0.8s ease-out forwards;
575- text-shadow: 0 0 10px rgba(0,0,0,0.5);
576591 ` ;
577592
578593 document . body . appendChild ( float ) ;
@@ -602,3 +617,17 @@ function initSkillXP() {
602617
603618// Re-initialize skills after Surprise scroll or any DOM changes
604619window . addEventListener ( 'DOMContentLoaded' , initSkillXP ) ;
620+
621+ /**
622+ * SYS ADMIN XP (Level 6 Mechanic)
623+ */
624+ function addMaintenanceXP ( ) {
625+ // Sys Admins get more XP for system-level interactions
626+ const bonus = unlockedEggs . length >= 6 ? 5 : 2 ;
627+ addExperience ( bonus ) ;
628+
629+ // Console log for that "hacker" feel
630+ if ( unlockedEggs . length >= 6 ) {
631+ console . log ( "%c [SYS_ADMIN] System optimized: +5 XP" , "color: #ec4899; font-weight: bold;" ) ;
632+ }
633+ }
0 commit comments