This commit is contained in:
Suvodip
2024-06-24 19:15:56 +05:30
parent 5c233bafa6
commit cf51757537
28 changed files with 257 additions and 132 deletions

View File

@@ -52,6 +52,7 @@ import Layout from '../../layouts/Layout.astro';
<script src="/saveGameData.js" is:inline></script>
<script is:inline>
const isMobile = window.innerWidth <= 768; // Define your mobile breakpoint as needed
const isTab = window.innerWidth > 768 && window.innerWidth <= 1416;
const drawingZone = {
x: isMobile ? 0 : window.innerWidth / 4, // Set x to 0 on mobile, else 1/4 of screen width
y: window.innerHeight / 4,
@@ -72,12 +73,28 @@ import Layout from '../../layouts/Layout.astro';
let blockMatches;
let retryButtonWidth;
let leftTargetZoneW;
if(isMobile){
topLogoWidth = 4.5;
muteIconWidth = 1.8;
resetIconWidth = 1.47;
tickIconWidth = 1.24;
cancelIconWidth = 1.08;
}else if(isTab){
topLogoWidth = 4.5;
muteIconWidth = 1.6;
resetIconWidth = 1.43;
tickIconWidth = 1.29;
cancelIconWidth = 1.18;
}else{
topLogoWidth = 6;
muteIconWidth = 1.3;
resetIconWidth = 1.26;
tickIconWidth = 1.222;
cancelIconWidth = 1.185;
}
if(isMobile){
topLogoWidth = 4.5;
muteIconWidth = 1.8;
resetIconWidth = 1.5;
tickIconWidth = 1.28;
cancelIconWidth = 1.12;
noticeWidth = 100;
noticeHeight = 0;
buttonWidth = 67;
@@ -87,11 +104,6 @@ import Layout from '../../layouts/Layout.astro';
leftTargetZoneW = window.innerWidth * 0.9 - 30;
rightTargetZoneW = window.innerWidth / 6;
} else {
topLogoWidth = 6;
muteIconWidth = 1.3;
resetIconWidth = 1.26;
tickIconWidth = 1.222;
cancelIconWidth = 1.185;
noticeWidth = 100;
noticeHeight = 0;
buttonWidth = 100;
@@ -326,7 +338,7 @@ import Layout from '../../layouts/Layout.astro';
fetch(`https://game-du.teachertrainingkolkata.in/items/game_drag_v3/${encodeURIComponent(paramsID)}?filter[status][_eq]=published`)
.then(response => response.json())
.then(({ data }) => {
console.log(data)
// console.log(data)
blockMatches = [
{
blockName: "blocks1",
@@ -566,7 +578,7 @@ import Layout from '../../layouts/Layout.astro';
}
//resultView scoreTotal
const match = blockMatches.find((m) => m.blockName === blockName && m.targetName === targetName);
console.log(match)
// console.log(match)
if(match){
scoreTotal++;
resultView = this.add.text(window.innerWidth / 2 - 100, window.innerHeight / 2 - 100, `Your Score: ${scoreTotal}`, {font: `24px`, fill: `#7c4c23`}).setVisible(false);