diff --git a/public/assets/letter/a_l1.svg b/public/assets/letter/a_l1.svg index 5833902..76b3436 100755 --- a/public/assets/letter/a_l1.svg +++ b/public/assets/letter/a_l1.svg @@ -7,23 +7,262 @@ viewBox="0 0 100 100" version="1.1" id="svg5" + inkscape:export-filename="a.l1svg" + inkscape:export-xdpi="96" + inkscape:export-ydpi="96" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + sodipodi:docname="a.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + + + + + + + + + id="defs2"> + + + + + + + + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + style="display:inline"> + + style="display:inline;fill:none;fill-opacity:1;stroke:#009e40;stroke-width:5.49547;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 49.392708,9.2082826 C 49.531367,8.0491252 27.044036,72.244814 27.044036,72.244814" + id="path127" + sodipodi:nodetypes="cc" /> + + 1 + + diff --git a/public/assets/letter/a_l2.svg b/public/assets/letter/a_l2.svg index 87f9e3f..9139d32 100755 --- a/public/assets/letter/a_l2.svg +++ b/public/assets/letter/a_l2.svg @@ -7,23 +7,257 @@ viewBox="0 0 100 100" version="1.1" id="svg5" + inkscape:export-filename="a_l1.svg" + inkscape:export-xdpi="96" + inkscape:export-ydpi="96" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + sodipodi:docname="a_l2.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + + + + + + + + + id="defs2"> + + + + + + + + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + style="display:inline"> + diff --git a/public/assets/letter/a_l3.svg b/public/assets/letter/a_l3.svg index 4b60569..25f5f49 100755 --- a/public/assets/letter/a_l3.svg +++ b/public/assets/letter/a_l3.svg @@ -7,23 +7,253 @@ viewBox="0 0 100 100" version="1.1" id="svg5" + inkscape:export-filename="a_l3.svg" + inkscape:export-xdpi="96" + inkscape:export-ydpi="96" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + sodipodi:docname="a.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + + + + + + + + + id="defs2"> + + + + + + + + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + style="display:inline"> + diff --git a/public/assets/svg/tick.svg b/public/assets/svg/tick.svg new file mode 100644 index 0000000..b29eb10 --- /dev/null +++ b/public/assets/svg/tick.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/pages/tracing/temp.astro b/src/pages/tracing/temp.astro index 4bb7339..b0d7b4b 100644 --- a/src/pages/tracing/temp.astro +++ b/src/pages/tracing/temp.astro @@ -1,29 +1,131 @@ -
-
- -
- This is the div to hide. +--- +import Layout from "../../layouts/Layout.astro"; +--- + +
+
-
-
+ + + \ No newline at end of file diff --git a/src/pages/tracing/temp2.astro b/src/pages/tracing/temp2.astro new file mode 100644 index 0000000..45821ba --- /dev/null +++ b/src/pages/tracing/temp2.astro @@ -0,0 +1,196 @@ +--- +import Layout from "../../layouts/Layout.astro"; +--- + +
+
+
+ +
+
+ \ No newline at end of file diff --git a/src/pages/tracing/temp4.astro b/src/pages/tracing/temp4.astro new file mode 100644 index 0000000..641b404 --- /dev/null +++ b/src/pages/tracing/temp4.astro @@ -0,0 +1,158 @@ +--- +import Layout from "../../layouts/Layout.astro"; +--- + +
+
+
+ +
+
+ \ No newline at end of file diff --git a/src/pages/tracing/test.astro b/src/pages/tracing/test.astro new file mode 100644 index 0000000..cf55596 --- /dev/null +++ b/src/pages/tracing/test.astro @@ -0,0 +1,184 @@ +--- +import Layout from "../../layouts/Layout.astro"; +--- + +
+
+
+ +
+
+ \ No newline at end of file diff --git a/src/pages/tracing/tracing-importeat.astro b/src/pages/tracing/tracing-importeat.astro new file mode 100644 index 0000000..a83d56d --- /dev/null +++ b/src/pages/tracing/tracing-importeat.astro @@ -0,0 +1,49 @@ + + \ No newline at end of file diff --git a/src/pages/tracing/tracing3.astro b/src/pages/tracing/tracing3.astro index f1c5806..cf55596 100644 --- a/src/pages/tracing/tracing3.astro +++ b/src/pages/tracing/tracing3.astro @@ -38,101 +38,147 @@ import Layout from "../../layouts/Layout.astro"; const customHeight = window.innerHeight; let firstLayer, secondLayer, thirdLayer; let graphics; + let isDrawing = false; + function preload() { this.load.svg('letterA', '/assets/letter/a.svg'); this.load.svg('layer1', '/assets/letter/a_l1.svg'); this.load.svg('layer2', '/assets/letter/a_l2.svg'); this.load.svg('layer3', '/assets/letter/a_l3.svg'); - this.load.audio('letterAAudio1', '/assets/audio/hook-arround-snake.mp3'); this.load.audio('slantLeft', '/assets/audio/slant-left.mp3'); this.load.audio('slantRight', '/assets/audio/slant-right.mp3'); this.load.audio('slide', '/assets/audio/slide.mp3'); + this.load.image('topLogo', '/assets/top_logo.png'); + this.load.svg('succesImage', '/assets/svg/tick.svg'); } + function create() { + this.add.image(customWidth / 2 * 1.6 - 0.5, 50, 'topLogo'); + this.add.text(customWidth / 10, 20, "Letter : A", { font: '700 40px quicksand', fill: '#05b3a4', }); const firstScreen = this.add.image(customWidth / 2, customHeight / 2, 'letterA'); + const screenCenterX = this.cameras.main.worldView.x + this.cameras.main.width / 2; + const baseFontSize = 20; + const responsiveFontSize = (window.innerWidth / 480) * baseFontSize; + const descrptText = this.add.text(screenCenterX, 90, 'Let`s learn to write letter : A', { font: `${responsiveFontSize}px quicksand`, fill: '#7c4c23', fontWeight : 'bold'}).setOrigin(0.5); this.time.delayedCall(2000, () => { - firstScreen.setVisible(false); - showLayers.call(this); + this.tweens.add({ + targets: firstScreen, + alpha: 0, + scaleX: 0.5, + scaleY: 0.5, + duration: 1000, + onComplete: () => { + firstScreen.setVisible(false); + firstScreen.setScale(1); + showLayersWithFadeIn.call(this); + } + }); }, [], this); } - - function showLayers() { - let textX, textY; - - firstLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer1'); - textX = isMobile ? customWidth / 3 : customWidth * 0.75; - textY = isMobile ? customHeight / 5 : customHeight / 2; - const firstTextLayer = this.add.text(textX, textY, '1. Slant Left').setTint(0x05b3a4); - const slantLeftAudio = this.sound.add('slantLeft'); - slantLeftAudio.play(); - firstLayer.setDepth(1); - firstLayer.setAlpha(0.5); - firstLayer.setInteractive({ draggable: true }); - - secondLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer2'); - textX = isMobile ? customWidth / 3 : customWidth * 0.75; - const secondTextLayer = this.add.text(textX, textY, '2. Slant Right').setTint(0x05b3a4); - const slantRightAudio = this.sound.add('slantRight'); - secondTextLayer.setVisible(false); - secondLayer.setDepth(1); - secondLayer.setAlpha(0.5); - secondLayer.setInteractive({ draggable: true }); - secondLayer.setVisible(false); - - thirdLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer3'); - textX = isMobile ? customWidth / 3 : customWidth * 0.75; - const thirdTextLayer = this.add.text(textX, textY, '3. Slide').setTint(0x05b3a4); - const slideAudio = this.sound.add('slide'); - thirdTextLayer.setVisible(false); - thirdLayer.setDepth(1.1); - thirdLayer.setScale(1.15); - thirdLayer.setAlpha(0.5); - thirdLayer.setInteractive({ draggable: true }); - thirdLayer.setVisible(false); - - firstLayer.on('drag', (pointer) => { - if (pointer.isDown) { - firstTextLayer.setVisible(false); - secondTextLayer.setVisible(true); - slantRightAudio.play(); - secondLayer.setVisible(true); - firstLayer.setAlpha(1); - secondLayer.setAlpha(0.5); - thirdLayer.setAlpha(0.5); - } else { - firstLayer.setAlpha(0.5); - } + function showLayersWithFadeIn() { + this.tweens.add({ + targets: [firstLayer, secondLayer, thirdLayer], + alpha: 1, + duration: 1000, // Duration of the tween in milliseconds + delay: 500, // Delay before the fade-in starts + ease: 'Power2', // Easing function (e.g., 'Linear', 'Cubic', 'Elastic', etc.) }); + + let textX, textY; - secondLayer.on('drag', (pointer) => { - if (pointer.isDown) { - graphics = this.add.graphics(); - graphics.lineStyle(50, 0x5e17eb); - secondTextLayer.setVisible(false); - thirdTextLayer.setVisible(true); - slideAudio.play(); - thirdLayer.setVisible(true); - secondLayer.setAlpha(1); - thirdLayer.setAlpha(0.5); - } else { - secondLayer.setAlpha(0.5); - } - }); + firstLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer1'); + textX = isMobile ? customWidth / 3 : customWidth * 0.75; + textY = isMobile ? customHeight / 5 : customHeight / 2; + const firstTextLayer = this.add.text(textX, textY, '1. Slant Left', { font: '700 40px quicksand', fill: '#05b3a4'}); + const slantLeftAudio = this.sound.add('slantLeft'); + slantLeftAudio.play(); + firstLayer.setDepth(1); + firstLayer.setAlpha(0.5); + firstLayer.setInteractive({ draggable: true }); - thirdLayer.on('drag', (pointer) => { - if (pointer.isDown) { - thirdLayer.setAlpha(1); - } else { - thirdLayer.setAlpha(0.5); - } - }); + secondLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer2'); + textX = isMobile ? customWidth / 3 : customWidth * 0.75; + const secondTextLayer = this.add.text(textX, textY, '2. Slant Right', { font: '700 40px quicksand', fill: '#05b3a4'}); + const slantRightAudio = this.sound.add('slantRight'); + secondTextLayer.setVisible(false); + secondLayer.setDepth(1); + secondLayer.setAlpha(0.5); + secondLayer.setInteractive({ draggable: true }); + secondLayer.setVisible(false); + + thirdLayer = this.add.image(customWidth / 2, customHeight / 2, 'layer3'); + textX = isMobile ? customWidth / 3 : customWidth * 0.75; + const thirdTextLayer = this.add.text(textX, textY, '3. Slide', { font: '700 40px quicksand', fill: '#05b3a4'}); + const slideAudio = this.sound.add('slide'); + thirdTextLayer.setVisible(false); + thirdLayer.setDepth(1.1); + // thirdLayer.setScale(1.15); + thirdLayer.setAlpha(0.5); + thirdLayer.setInteractive({ draggable: true }); + thirdLayer.setVisible(false); + + firstLayer.on('drag', (pointer) => { + if (pointer.isDown) { + firstTextLayer.setVisible(false); + secondTextLayer.setVisible(true); + slantRightAudio.play(); + secondLayer.setVisible(true); + firstLayer.setAlpha(1); + secondLayer.setAlpha(0.5); + thirdLayer.setAlpha(0.5); + } else { + firstLayer.setAlpha(0.5); + } + }); + + secondLayer.on('drag', (pointer) => { + if (pointer.isDown) { + secondTextLayer.setVisible(false); + thirdTextLayer.setVisible(true); + slideAudio.play(); + thirdLayer.setVisible(true); + secondLayer.setAlpha(1); + thirdLayer.setAlpha(0.5); + } else { + secondLayer.setAlpha(0.5); + } + }); + + thirdLayer.on('drag', (pointer) => { + if (pointer.isDown) { + thirdLayer.setAlpha(1); + thirdTextLayer.setVisible(false); + // const succesImage = this.add.image(customWidth / 2, customHeight / 2, 'succesImage').setDepth(2); + // succesImage.setAlpha(0.2); + // this.add.text(customWidth / 2, customHeight / 2, 'OK', { font: '700 40px quicksand', fill: '#05b3a4'}).setDepth(2); + } else { + thirdLayer.setAlpha(0.5); + } + }); + graphics = this.add.graphics(); + graphics.lineStyle(15, 0x05b3a4, 2).setDepth(2); // Set line style (width, color, alpha) + + this.input.on('pointerdown', function (pointer) { + isDrawing = true; + graphics.moveTo(pointer.x, pointer.y); + }); + + this.input.on('pointerup', function () { + isDrawing = false; + }); + + this.input.on('pointermove', function (pointer) { + if (!isDrawing) return; + + graphics.lineTo(pointer.x, pointer.y); + graphics.strokePath(); + }); } function update() { // Update any game logic if needed } - \ No newline at end of file