PageSourceSearch

https://digital.asahi.com/games/app/_nuxt/DZGkjwAb.js

js asahi.com collected 2026-09-24 06:54:42 UTC 4,547 bytes, 1 lines download raw bytes

1import{P as a}from"./D99M7vOG.js";import{GAME_CONFIG as t}from"./C5fh7875.js";import{GameState as E,PhaseType as g}from"./CsyEZvn4.js";import"#entry";import"./DngGbMvG.js";import"./DOe0k_16.js";import"./Cs29sOAR.js";import"./Bug1BbnW.js";import"./_5Sk-Mpa.js";class O{constructor(e){this.scene=e}scene;event;timerText;barFillImg;displayProgress;targetProgress;darkOverlay;nearTimeOverTween=null;isResetTimerProgress=!1;gaugeMask;gaugeGraphics;gameState=E();gaugeBarY=60;barFillImgWRatio=.5;barFillImgHRatio=1;setup(){this.gameState.setTime(t.GAME_PLAY.MEMORY_TIME_SEC),this.setupTimerUI(),this.setupTimerGauge(),this.resetProgress()}destroy(){this.scene.time.removeEvent(this.event),this.nearTimeOverTween?.stop(),this.nearTimeOverTween?.remove(),this.nearTimeOverTween=null,this.timerText?.destroy(),this.barFillImg?.destroy(),this.darkOverlay?.destroy(),this.gaugeGraphics?.destroy()}setupTimerUI(){const e=this.scene.add.image(t.SCREEN.CENTER.x,t.PLAY_FIELD.TOP*2.1,"icon_timer");e.setOrigin(.5),e.setTintFill(6184023),this.barFillImg=this.scene.add.image(t.SCREEN.CENTER.x,t.PLAY_FIELD.TOP*2.1,"icon_timer"),this.barFillImg.setOrigin(.5),this.timerText=this.scene.add.text(e.x,e.y-10,"",{fontSize:"50px",color:t.STYLE.COLOR.BASE_TEXT,fontStyle:t.STYLE.FONT_STYLE,fontFamily:t.STYLE.FONT_FAMILY}).setOrigin(.5)}setupTimerGauge(){this.gaugeGraphics=this.scene.add.graphics();const e=this.barFillImg.x,s=this.barFillImg.y,i=this.barFillImg.width*this.barFillImgWRatio,r=this.barFillImg.height*this.barFillImgHRatio;this.drawGaugeMask(e,s,i,r,1),this.gaugeMask=this.gaugeGraphics.createGeometryMask(),this.barFillImg.setMask(this.gaugeMask),this.gaugeGraphics.setVisible(!1)}drawGaugeMask(e,s,i,r,m){const l=Math.PI,o=a.Math.Linear(0,l,1-m);this.gaugeGraphics.clear(),this.gaugeGraphics.fillStyle(6184023),this.gaugeGraphics.beginPath(),this.gaugeGraphics.moveTo(e,s-this.gaugeBarY);for(let h=0;h<=60;h++){const n=a.Math.Linear(0,o,h/60),c=e+i*Math.cos(n),T=s-this.gaugeBarY+r*Math.sin(n);this.gaugeGraphics.lineTo(c,T)}this.gaugeGraphics.closePath(),this.gaugeGraphics.fillPath()}startMemoryPhase(e){this.event=this.scene.time.addEvent({delay:t.GAME_PLAY.MEMORY_TIME_MS,callback:e,callbackScope:this.scene})}startAnswerPhase(e){this.scene.time.delayedCall(500,()=>{this.event=this.scene.time.addEvent({delay:t.GAME_PLAY.ANSWER_TIME_MS,callback:e,callbackScope:this.scene})})}update(e){this.gameState.state.timerRunning&&(this.updateTime(e),this.updateUi())}updateTime(e){const s=e===g.Answer?t.GAME_PLAY.ANSWER_TIME_SEC:t.GAME_PLAY.MEMORY_TIME_SEC;if(this.event&&this.event.getProgress()<1){const i=s-this.event.getElapsedSeconds();this.gameState.setTime(Math.max(0,i))}this.updateProgress(e)}updateProgress(e){const s=e===g.Memory?t.GAME_PLAY.MEMORY_TIME_SEC:t.GAME_PLAY.ANSWER_TIME_SEC;this.targetProgress=a.Math.Clamp(this.gameState.state.timeLeft/s,0,1),this.displayProgress=a.Math.Linear(this.displayProgress,this.targetProgress,.2)}updateUi(){this.updateGauge(),this.updateTimerText(),this.nearTimeOverAnimation()}updateGauge(){if(!this.gaugeGraphics)return;const e=this.barFillImg.x,s=this.barFillImg.y,i=this.barFillImg.width*this.barFillImgWRatio,r=this.barFillImg.height*this.barFillImgHRatio;this.drawGaugeMask(e,s,i,r,this.displayProgress)}updateTimerText(){this.timerText.setText(Math.floor(this.gameState.state.timeLeft).toString())}resetProgress(){this.targetProgress=1,this.displayProgress=1,this.timerText.setText(String(t.GAME_PLAY.ANSWER_TIME_SEC)),this.isResetTimerProgress=!0}resetTimerEvent(){this.event&&(this.scene.time.removeEvent(this.event),this.event=null)}retryTimerEvent(){this.event&&(this.gameState.setTime(t.GAME_PLAY.ANSWER_TIME_SEC),this.resetProgress(),this.event.reset(this.event))}nearTimeOverAnimation(){this.isResetTimerProgress&&this.gameState.state.timeLeft<=3&&!this.nearTimeOverTween&&(this.nearTimeOverTween=this.scene.tweens.add({targets:this.timerText,scale:1.3,yoyo:!0,repeat:-1,duration:500,ease:"Sine.easeInOut"}),this.darkOverlay=this.createDarkBg())}resetNearTimeOverAnimation(){this.nearTimeOverTween&&(this.isResetTimerProgress=!1,this.nearTimeOverTween.stop(),this.nearTimeOverTween.remove(),this.nearTimeOverTween=null,this.darkOverlay?.destroy(),this.darkOverlay=null,this.timerText.setScale(1))}createDarkBg(){const e=this.scene.add.rectangle(t.SCREEN.WIDTH/2,t.SCREEN.HEIGHT/2,t.SCREEN.WIDTH,t.SCREEN.HEIGHT,0,1).setScrollFactor(0).setDepth(-99.5).setAlpha(0);return this.scene.tweens.add({targets:e,alpha:.2,yoyo:!0,repeat:-1,duration:500,ease:"Sine.easeInOut"}),e}}export{O as Timer};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.