From 9a4d6be0ca9cb86ef56acdbf8bcc1fe9f920a19c Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sun, 2 Apr 2023 00:30:04 +0300 Subject: plakat Done, all Games Done!! --- rannak/mangud/direktor/loosung/index.html | 2 +- rannak/mangud/partorg/plakat.bak/img/avatar.png | Bin 657556 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/lenin.png | Bin 37366 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/nazi.png | Bin 20381 -> 0 bytes .../mangud/partorg/plakat.bak/img/normalSelect.cur | Bin 4286 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/redStar.png | Bin 39590 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/stalin.jpg | Bin 168805 -> 0 bytes .../mangud/partorg/plakat.bak/img/stalinAddOn.png | Bin 976997 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/testImg.jpg | Bin 498451 -> 0 bytes rannak/mangud/partorg/plakat.bak/img/veekogud.jpg | Bin 223291 -> 0 bytes rannak/mangud/partorg/plakat.bak/index.html | 125 --------- rannak/mangud/partorg/plakat.bak/main.js | 224 ---------------- rannak/mangud/partorg/plakat.bak/style.css | 188 ------------- rannak/mangud/partorg/plakat/img/malevBlank.png | Bin 0 -> 690413 bytes rannak/mangud/partorg/plakat/img/stalinBlank.png | Bin 0 -> 25223827 bytes rannak/mangud/partorg/plakat/img/veekogudBlank.png | Bin 0 -> 21683348 bytes .../mangud/partorg/plakat/img/viisAastakBlank.png | Bin 0 -> 12708001 bytes rannak/mangud/partorg/plakat/index.html | 148 ++++++----- rannak/mangud/partorg/plakat/script.js | 294 +++++++++++++++++---- rannak/mangud/partorg/plakat/styles.css | 64 +++-- 20 files changed, 369 insertions(+), 676 deletions(-) delete mode 100644 rannak/mangud/partorg/plakat.bak/img/avatar.png delete mode 100644 rannak/mangud/partorg/plakat.bak/img/lenin.png delete mode 100644 rannak/mangud/partorg/plakat.bak/img/nazi.png delete mode 100644 rannak/mangud/partorg/plakat.bak/img/normalSelect.cur delete mode 100644 rannak/mangud/partorg/plakat.bak/img/redStar.png delete mode 100644 rannak/mangud/partorg/plakat.bak/img/stalin.jpg delete mode 100644 rannak/mangud/partorg/plakat.bak/img/stalinAddOn.png delete mode 100644 rannak/mangud/partorg/plakat.bak/img/testImg.jpg delete mode 100644 rannak/mangud/partorg/plakat.bak/img/veekogud.jpg delete mode 100644 rannak/mangud/partorg/plakat.bak/index.html delete mode 100644 rannak/mangud/partorg/plakat.bak/main.js delete mode 100644 rannak/mangud/partorg/plakat.bak/style.css create mode 100644 rannak/mangud/partorg/plakat/img/malevBlank.png create mode 100644 rannak/mangud/partorg/plakat/img/stalinBlank.png create mode 100644 rannak/mangud/partorg/plakat/img/veekogudBlank.png create mode 100644 rannak/mangud/partorg/plakat/img/viisAastakBlank.png diff --git a/rannak/mangud/direktor/loosung/index.html b/rannak/mangud/direktor/loosung/index.html index b3dc5d5..aff0e19 100644 --- a/rannak/mangud/direktor/loosung/index.html +++ b/rannak/mangud/direktor/loosung/index.html @@ -92,7 +92,7 @@ - + diff --git a/rannak/mangud/partorg/plakat.bak/img/avatar.png b/rannak/mangud/partorg/plakat.bak/img/avatar.png deleted file mode 100644 index 485a70c..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/avatar.png and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/lenin.png b/rannak/mangud/partorg/plakat.bak/img/lenin.png deleted file mode 100644 index e36df3d..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/lenin.png and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/nazi.png b/rannak/mangud/partorg/plakat.bak/img/nazi.png deleted file mode 100644 index 87e616e..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/nazi.png and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/normalSelect.cur b/rannak/mangud/partorg/plakat.bak/img/normalSelect.cur deleted file mode 100644 index fdd943c..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/normalSelect.cur and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/redStar.png b/rannak/mangud/partorg/plakat.bak/img/redStar.png deleted file mode 100644 index b6eee79..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/redStar.png and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/stalin.jpg b/rannak/mangud/partorg/plakat.bak/img/stalin.jpg deleted file mode 100644 index bc0a3a5..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/stalin.jpg and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/stalinAddOn.png b/rannak/mangud/partorg/plakat.bak/img/stalinAddOn.png deleted file mode 100644 index d3e05fd..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/stalinAddOn.png and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/testImg.jpg b/rannak/mangud/partorg/plakat.bak/img/testImg.jpg deleted file mode 100644 index d88d950..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/testImg.jpg and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/img/veekogud.jpg b/rannak/mangud/partorg/plakat.bak/img/veekogud.jpg deleted file mode 100644 index 23f04ab..0000000 Binary files a/rannak/mangud/partorg/plakat.bak/img/veekogud.jpg and /dev/null differ diff --git a/rannak/mangud/partorg/plakat.bak/index.html b/rannak/mangud/partorg/plakat.bak/index.html deleted file mode 100644 index 4754c9b..0000000 --- a/rannak/mangud/partorg/plakat.bak/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Plakat - - - - - - -
- -
- -
-

Kujunda Plakatit

-

Vali välja üks plakat ja muuda/lisa selle kujundust vastavalt enda äranägemisele.

- - - - - - -
- -
-
-

- - -

- -

- - -

- - -
-
- - - - -

Vali Plakat

-
- Jossup Saloninjo Plakat - Veekogude Plakat - Veekogude Plakat -
- - - - -
- - - - -
- -
- - -
- - - - - - - - - - - - - - - - diff --git a/rannak/mangud/partorg/plakat.bak/main.js b/rannak/mangud/partorg/plakat.bak/main.js deleted file mode 100644 index 11809cb..0000000 --- a/rannak/mangud/partorg/plakat.bak/main.js +++ /dev/null @@ -1,224 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - let btn = document.querySelector('.modalButton'); - btn.click(); -}); - - -console.log("FAAAAK"); - -/* Inital Setup*/ - -const canvas = document.getElementById('drawing-board'); -const toolbar = document.getElementById('toolbar'); -const ctx = canvas.getContext('2d'); - -let canvasOffsetX = canvas.offsetLeft; -let canvasOffsetY = canvas.offsetTop; - -let CurImage = document.getElementById("stalin"); - -canvas.width = window.innerWidth - canvasOffsetX; -canvas.height = window.innerHeight - canvasOffsetY; - - - -function copyImageToCanvas(image, x, y) { - ctx.drawImage(image, 0, 0, canvas.width, canvas.height) -} - - - - -// Initial Drawring -setTimeout(() => { - copyImageToCanvas(CurImage, canvasOffsetX, canvasOffsetY); -}, 300); - - - -window.onresize = () => { - canvasOffsetX = canvas.offsetLeft; - canvasOffsetY = canvas.offsetTop; - canvas.width = window.innerWidth - canvasOffsetX; - canvas.height = window.innerHeight - canvasOffsetY; - copyImageToCanvas(CurImage, canvasOffsetX, canvasOffsetY); -} - - - - -/* EventHandlers and stuff*/ - -let addOnHasBeenAdded = false; -let addOnActive = false; -let newAddOn; -let hasPainted = false; - -let isPainting = false; -let lineWidth = 5; -let startX; -let startY; - -const pildid = new Array(); -const addOns = new Array(); - -toolbar.addEventListener('click', e => { - - - //Plakatid - const stalinImg = document.getElementById("stalin"); - const veekogudImg = document.getElementById("veekogud"); - const testing = document.getElementById("testing"); - - pildid.push(stalinImg); - pildid.push(veekogudImg); - pildid.push(testing); - - - //Addons - - const naziImg = document.getElementById("nazi"); - const lenin = document.getElementById("lenin"); - const redStar = document.getElementById("redStar"); - const stalinAddOn = document.getElementById("stalinAddOn"); - - addOns.push(naziImg); - addOns.push(lenin); - addOns.push(redStar); - addOns.push(stalinAddOn); - - - - - if (e.target.id === "stalin" || e.target.id === "veekogud" || e.target.id === "testing") { - for (el in pildid) { - pildid[el].classList.remove("picked"); - } - let newPicked = document.getElementById(e.target.id); - newPicked.classList.add("picked"); - - // Draw New Pick - CurImage = newPicked; - copyImageToCanvas(CurImage, canvasOffsetX, canvasOffsetY); - moveOnDisable(); - } - - - else if (e.target.id === 'clear') { - ctx.clearRect(0, 0, canvas.width, canvas.height); - copyImageToCanvas(CurImage, canvasOffsetX, canvasOffsetY); - moveOnDisable(); - } - - - else if (e.target.id === 'nazi' || e.target.id === 'lenin' || e.target.id === 'redStar' || e.target.id === 'stalinAddOn') { - addOnActive = true; - document.body.style.cursor = "url('img/normalSelect.cur'), auto"; - - for (el in addOns) { - addOns[el].classList.remove("addOnPicked"); - } - - newAddOn = document.getElementById(e.target.id); - newAddOn.classList.add("addOnPicked"); - } - - -}); - - - -canvas.addEventListener('click', e => { - - if(addOnActive == true){ - addOnActive = false; - document.body.style.cursor = "auto"; - - for (el in addOns) { - addOns[el].classList.remove("addOnPicked"); - } - - let xCord = e.offsetX - (newAddOn.clientWidth / 2) - let yCord = e.offsetY - (newAddOn.clientHeight / 2) - ctx.drawImage(newAddOn, xCord, yCord, newAddOn.clientWidth, newAddOn.clientHeight); - - - addOnHasBeenAdded = true; - if (hasPainted) - moveOnEnable(); - } -}); - - - - - - - - -/* Drawing stuff from here */ - -toolbar.addEventListener('change', e => { - if(e.target.id === 'stroke') { - ctx.strokeStyle = e.target.value; - } - - if(e.target.id === 'lineWidth') { - lineWidth = e.target.value; - } - -}); - - - -const draw = (e) => { - if(!isPainting) { - return; - } - - ctx.lineWidth = lineWidth; - ctx.lineCap = 'round'; - - ctx.lineTo(e.clientX - canvasOffsetX, e.clientY); - //ctx.lineTo(e.clientX - abiOffset, e.clientY); - ctx.stroke(); - - hasPainted = true; - if (addOnHasBeenAdded) - moveOnEnable(); -} - - - -canvas.addEventListener('mousedown', (e) => { - isPainting = true; - startX = e.clientX; - startY = e.clientY; -}); - - - -canvas.addEventListener('mouseup', e => { - isPainting = false; - ctx.stroke(); - ctx.beginPath(); -}); - - -canvas.addEventListener('mousemove', draw); - - - - -// Move On Stuff - -function moveOnEnable(){ - const btn = document.querySelector(".moveOn"); - btn.disabled = false; - btn.onclick = () => location.href = "../sonaragastik"; -} - -function moveOnDisable(){ - const btn = document.querySelector(".moveOn"); - btn.disabled = true; -} diff --git a/rannak/mangud/partorg/plakat.bak/style.css b/rannak/mangud/partorg/plakat.bak/style.css deleted file mode 100644 index 215c073..0000000 --- a/rannak/mangud/partorg/plakat.bak/style.css +++ /dev/null @@ -1,188 +0,0 @@ -body { - height: 100%; - overflow: hidden; - color: white; - background-color: #43464b; -} - -h1 { - color: #a1000e; - font-weight: bold; -} - - -/* Move on ja Sissejuhatus Button */ - -.avatar { - border-radius: 20px; - width: 100%; - max-width: 15rem; -} - - -.modalHeaderWrapper{ - text-align: center; - margin: 0; - width: 100%; -} - -button:disabled{ - opacity: 0.5; - cursor: not-allowed; -} - -.moveOn{ - display: inline-block; - border: none; - padding: 6px 12px; - margin-botton: 0; - font-size: 1rem; - font-weight: normal; - text-align: center; - cursor: pointer; - border-radius: 4px; - background-color: #4BB543; - color: white; -} - -/* Modal Stuff */ - - -.closeModalButton { - border-radius: 50px; -} - -.modalButton{ - background-color: rgba(0,136,169,1); - border: none; - border-radius: 50px; - cursor: pointer; - transition: all 0.3 ease 0; - font-size: 1.2rem; - text-align: center; - margin-left: 30px; -} - -.modalButton:hover{ - background-color: rgba(0,136,169,0.8); -} - - - -/* Main */ - -.wrapper { - height: 100%; - display: flex; -} - -/* Toolbar */ -.intro{ - text-align: center; - border-bottom: 2px solid gray; - padding: 7px; -} - - -#toolbar { - display: flex; - flex-direction: column; - align-items: center; - padding: 5px; - width: 20%; - min-width:350px; - background-color: #43464b; -} - -#clear{ - background-color: #1565c0; - border: none; - border-radius: 4px; - font-size:1.3rem; - color:white; - padding: 2px; -} - -#toolbar * {margin-bottom: 6px;} -#toolbar input {width: 4rem;} - -.toolbarDiv {width: 100%;} - -form { - display: flex; - align-items: center; -} - -label { - display: table-cell; - font-size: 1.2rem; -} - - - -/* Img Picker */ -.pickingSec { - height: 50%; - overflow: hidden; - overflow-y: scroll; -} - - -.valiTxt { - border-bottom: 4px solid gray; - padding-top: 10px; -} - - -.picked{ - border: 2px solid lime; -} - - -.addOnPicked{ - border: 2px solid aqua; -} - - - -.pickImg { - width: 50%; - height: auto; - padding: 10px; - margin-left: calc(25% - 5px); -} - - - -/* Canvas */ -canvas{ - display: block; - margin: 0 auto; -} - - - - - -/* Responsivness */ - -@media screen and (max-width: 1400px) { - .pickImg { - width: 30%; - height: auto; - padding: 7px; - margin-left: calc(7% - 21px); - } - -} - - -@media screen and (max-width: 900px) { - .pickImg { - width: 24%; - height: auto; - padding: 3px; - margin-left: calc(1% - 10px); - } - -} diff --git a/rannak/mangud/partorg/plakat/img/malevBlank.png b/rannak/mangud/partorg/plakat/img/malevBlank.png new file mode 100644 index 0000000..85c10f1 Binary files /dev/null and b/rannak/mangud/partorg/plakat/img/malevBlank.png differ diff --git a/rannak/mangud/partorg/plakat/img/stalinBlank.png b/rannak/mangud/partorg/plakat/img/stalinBlank.png new file mode 100644 index 0000000..7efdc4e Binary files /dev/null and b/rannak/mangud/partorg/plakat/img/stalinBlank.png differ diff --git a/rannak/mangud/partorg/plakat/img/veekogudBlank.png b/rannak/mangud/partorg/plakat/img/veekogudBlank.png new file mode 100644 index 0000000..85570b1 Binary files /dev/null and b/rannak/mangud/partorg/plakat/img/veekogudBlank.png differ diff --git a/rannak/mangud/partorg/plakat/img/viisAastakBlank.png b/rannak/mangud/partorg/plakat/img/viisAastakBlank.png new file mode 100644 index 0000000..fc0215c Binary files /dev/null and b/rannak/mangud/partorg/plakat/img/viisAastakBlank.png differ diff --git a/rannak/mangud/partorg/plakat/index.html b/rannak/mangud/partorg/plakat/index.html index 85bb6bc..0ac5e90 100644 --- a/rannak/mangud/partorg/plakat/index.html +++ b/rannak/mangud/partorg/plakat/index.html @@ -14,10 +14,10 @@

Plakatid

-

Leia iga plakati õige ajastu, ning muuda ka plakati teksti. -
- Kui oled valinud õige ajastu ja muutunud plakati lause, muutub see roheliseks, - näitamaks, et sellega on kõik korras. +

+ Leia iga plakati õige ajastu, ning muuda ka plakati teksti. +
+ NB: Uut loosungit saad lisada pärast seda, kui oled valinud õige ajastu.

@@ -102,31 +102,36 @@