From 9ee9165d7b7567fadf2999e39b25f1a34aade0b2 Mon Sep 17 00:00:00 2001 From: Guuq <50501321+Guuq@users.noreply.github.com> Date: Tue, 29 Oct 2019 18:12:35 +0100 Subject: [PATCH] 29-10 #6 --- canvas/canvas.js | 5 ++ canvas/index.html | 7 ++- {resources/css => color}/color.css | 0 color/index.html | 6 +- {resources/css => contact}/contact.css | 0 contact/index.html | 6 +- resources/css.css => css.css | 0 {resources/css => downloads}/downloads.css | 0 {resources/js => downloads}/downloads.json.js | 0 downloads/index.html | 10 ++-- .../js => downloads}/insertDownloads.js | 0 index.html | 8 +-- resources/js/home.js => js.js | 0 resources/{ => css}/cssall.css | 3 - resources/js/canvas.js | 6 -- resources/js/canvasLib.js | 58 +++++++++++++++++++ resources/{ => js}/javall.js | 0 17 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 canvas/canvas.js rename {resources/css => color}/color.css (100%) rename {resources/css => contact}/contact.css (100%) rename resources/css.css => css.css (100%) rename {resources/css => downloads}/downloads.css (100%) rename {resources/js => downloads}/downloads.json.js (100%) rename {resources/js => downloads}/insertDownloads.js (100%) rename resources/js/home.js => js.js (100%) rename resources/{ => css}/cssall.css (96%) delete mode 100644 resources/js/canvas.js create mode 100644 resources/js/canvasLib.js rename resources/{ => js}/javall.js (100%) diff --git a/canvas/canvas.js b/canvas/canvas.js new file mode 100644 index 0000000..1541214 --- /dev/null +++ b/canvas/canvas.js @@ -0,0 +1,5 @@ +var d = document.querySelector.bind(document) +var can = d("canvas"); +var c = can.getContext("2d"); + +arc(120, 120, 50, black); diff --git a/canvas/index.html b/canvas/index.html index 32a9ca0..42036ab 100644 --- a/canvas/index.html +++ b/canvas/index.html @@ -4,7 +4,7 @@ - + @@ -15,9 +15,10 @@ - + + - + diff --git a/resources/css/color.css b/color/color.css similarity index 100% rename from resources/css/color.css rename to color/color.css diff --git a/color/index.html b/color/index.html index a3630f9..90df476 100644 --- a/color/index.html +++ b/color/index.html @@ -4,8 +4,8 @@ - - + + @@ -14,7 +14,7 @@ - + diff --git a/resources/css/contact.css b/contact/contact.css similarity index 100% rename from resources/css/contact.css rename to contact/contact.css diff --git a/contact/index.html b/contact/index.html index e0a3ce2..3b43ef2 100644 --- a/contact/index.html +++ b/contact/index.html @@ -4,8 +4,8 @@ - - + + Contact @@ -19,8 +19,8 @@ + - diff --git a/resources/css.css b/css.css similarity index 100% rename from resources/css.css rename to css.css diff --git a/resources/css/downloads.css b/downloads/downloads.css similarity index 100% rename from resources/css/downloads.css rename to downloads/downloads.css diff --git a/resources/js/downloads.json.js b/downloads/downloads.json.js similarity index 100% rename from resources/js/downloads.json.js rename to downloads/downloads.json.js diff --git a/downloads/index.html b/downloads/index.html index 3ad4e66..96bae9e 100644 --- a/downloads/index.html +++ b/downloads/index.html @@ -7,8 +7,8 @@ - - + + @@ -21,9 +21,9 @@ - - - + + + diff --git a/resources/js/insertDownloads.js b/downloads/insertDownloads.js similarity index 100% rename from resources/js/insertDownloads.js rename to downloads/insertDownloads.js diff --git a/index.html b/index.html index d831d01..c94ccbd 100644 --- a/index.html +++ b/index.html @@ -9,8 +9,8 @@ Home - - + + @@ -112,9 +112,9 @@ - + - + diff --git a/resources/js/home.js b/js.js similarity index 100% rename from resources/js/home.js rename to js.js diff --git a/resources/cssall.css b/resources/css/cssall.css similarity index 96% rename from resources/cssall.css rename to resources/css/cssall.css index 3d41cc1..652c5d6 100644 --- a/resources/cssall.css +++ b/resources/css/cssall.css @@ -3,9 +3,6 @@ html { height: 100%; } -img[alt="www.000webhost.com"] { - display: none; -} body { font-family: Raleway, sans-serif!important; background-image: url(/resources/img/wallpaper.png); diff --git a/resources/js/canvas.js b/resources/js/canvas.js deleted file mode 100644 index 095abb3..0000000 --- a/resources/js/canvas.js +++ /dev/null @@ -1,6 +0,0 @@ -var c = document.getElementById("canvas"); -var ctx = c.getContext("2d"); - -ctx.moveTo(0, 0); -ctx.lineTo(200, 100); -ctx.stroke(); diff --git a/resources/js/canvasLib.js b/resources/js/canvasLib.js new file mode 100644 index 0000000..75ab488 --- /dev/null +++ b/resources/js/canvasLib.js @@ -0,0 +1,58 @@ +var d = document.querySelector.bind(document) + +function random(e, t) { + return t++, Math.floor(Math.random() * (t - e)) + e +} +function arc(x, y, w, col, stroke) { + c.beginPath(); + c.arc(x, y, w, 0, Math.PI * 2, false); + c.fillStyle = col; + c.strokeStyle = col; + if (!stroke) { + c.fill(); + } else { + c.stroke() + } + c.closePath(); +} + +function stroke(x, y, x2, y2, w, col) { + c.beginPath(); + c.moveTo(x, y); + c.lineTo(x2, y2); + c.lineWidth = w; + c.strokeStyle = col; + c.stroke(); +} + +function rect(x, y, w, h, col, fill) { + c.beginPath(); + c.rect(x, y, w, h); + if (!fill) { + c.fillStyle = col; + c.fill() + } else { + c.strokeStyle = col + c.stroke() + } +} +function rotate(deg) { + c.rotate(deg*Math.PI/180) +} +function clear() { + c.clearRect(0, 0, can.width, can.height) +} +function image(img,x,y,w,h) { + c.drawImage(img,x,y,w,h) +} +function newImage(url) { + var img = new Image() + img.src = url + ".png" + return img +} +function zero(hms) { + if (hms < 10) { + return '0' + hms; + } + return hms; + } diff --git a/resources/javall.js b/resources/js/javall.js similarity index 100% rename from resources/javall.js rename to resources/js/javall.js