work on score calculations

This commit is contained in:
dev sp
2024-01-17 08:45:14 +00:00
parent 85924a90e6
commit 62565a5bf2
4 changed files with 61 additions and 36 deletions

View File

@@ -23,7 +23,7 @@ import Layout from '../../layouts/Layout.astro';
noticeWidth = 100;
noticeHeight = 0;
downloadWidth = 67;
downloadHeight = 200;
downloadHeight = 160;
learningWidth = 200;
learningHeight = 400
} else {
@@ -117,8 +117,8 @@ import Layout from '../../layouts/Layout.astro';
.then(({ data }) => {
// console.log(data.colors)
const screenCenterX = this.cameras.main.worldView.x + this.cameras.main.width / 2;
const baseFontSize = 15;
const responsiveFontSize = (window.innerWidth / 280) * baseFontSize;
const baseFontSize = 22;
const responsiveFontSize = (window.innerWidth / 800) * baseFontSize;
const descrptText = this.add.text(screenCenterX, 70, data.description, { font: `${responsiveFontSize}px quicksand`, fill: '#7c4c23', }).setOrigin(0.5);
// this.add.text(customWidth / 2 - learningWidth, customHeight / 2 - learningHeight, data.LearningArea, {font: `20px`}).setTint(0X7C4C23)
// this.add.text(customWidth / 2 - learningWidth, customHeight / 2 - learningHeight + 20, data.LearningSubArea, {font: `20px`}).setTint(0X7C4C23)
@@ -230,7 +230,7 @@ import Layout from '../../layouts/Layout.astro';
// const colors = data.colors;
// var colors = colorList;
const colors = ['#ff0000'];
const buttonSize = 50;
const buttonSize = 60;
const buttonSpacing = 15;
// Create a container div for the color buttons
const colorButtonsContainer = document.createElement('div');
@@ -452,7 +452,7 @@ import Layout from '../../layouts/Layout.astro';
// };
// Add a "Save Snapshot" button
if(isMobile){
snapWidth = 50;
snapWidth = 70;
snapHeight = 70;
} else {
snapWidth = 200;
@@ -468,10 +468,12 @@ import Layout from '../../layouts/Layout.astro';
snapNotice.setVisible(false);
}
function captureSnapshot(drawingZone) {
submitButton.setVisible(false);
// snapNotice.setVisible(true);
snapshotButton.setVisible(false);
customCursor.setVisible(false);
drawingZone.renderer.snapshot((image) => {
submitButton.setVisible(true);
snapshotButton.setVisible(true);
customCursor.setVisible(true);
image.style.width = '160px';