From 36eb1f6387e459ef8a640e90a928d212daa97ba1 Mon Sep 17 00:00:00 2001 From: CST1229 <68464103+CST1229@users.noreply.github.com> Date: Sun, 12 Sep 2021 17:40:29 +0200 Subject: [PATCH 1/4] Add list icon --- scratch2/blocks.js | 1 + scratch2/style.js | 92 ++++++++++++++++++++++++++++++++++++++++++++++ scratch3/blocks.js | 1 + scratch3/style.js | 38 ++++++++++++++++++- syntax/model.js | 1 + 5 files changed, 132 insertions(+), 1 deletion(-) diff --git a/scratch2/blocks.js b/scratch2/blocks.js index 9ab627ce..6d532c5f 100644 --- a/scratch2/blocks.js +++ b/scratch2/blocks.js @@ -109,6 +109,7 @@ IconView.icons = { loopArrow: { width: 14, height: 11 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, + list: { width: 12, height: 14, dx: -1, dy: -1 }, } /* Input */ diff --git a/scratch2/style.js b/scratch2/style.js index 7754e009..45c96d34 100644 --- a/scratch2/style.js +++ b/scratch2/style.js @@ -154,6 +154,98 @@ var Style = (module.exports = { { id: "loopArrow", } + ), + SVG.setProps( + SVG.group([ + SVG.el("rect", { + x: "0", + y: "0", + width: "12", + height: "14", + fill: "#000", + opacity: "0.25", + }), + SVG.el("rect", { + x: "1", + y: "1", + width: "1", + height: "13", + fill: "#fff", + }), + SVG.el("rect", { + x: "11", + y: "1", + width: "1", + height: "13", + fill: "#fff", + }), + SVG.el("rect", { + x: "2", + y: "1", + width: "9", + height: "1", + fill: "#fff", + }), + SVG.el("rect", { + x: "2", + y: "5", + width: "9", + height: "1", + fill: "#fff", + }), + SVG.el("rect", { + x: "2", + y: "9", + width: "9", + height: "1", + fill: "#fff", + }), + SVG.el("rect", { + x: "2", + y: "13", + width: "9", + height: "1", + fill: "#fff", + }), + SVG.el("rect", { + x: "2", + y: "2", + width: "9", + height: "2", + fill: "#ea8d1c", + }), + SVG.el("rect", { + x: "2", + y: "6", + width: "9", + height: "2", + fill: "#ea8d1c", + }), + SVG.el("rect", { + x: "2", + y: "10", + width: "9", + height: "2", + fill: "#ea8d1c", + }), + SVG.el("rect", { + x: "11", + y: "0", + width: "1", + height: "1", + fill: "#ea8d1c", + }), + SVG.el("rect", { + x: "0", + y: "13", + width: "1", + height: "1", + fill: "#ea8d1c", + }), + ]), + { + id: "list", + } ), ] }, diff --git a/scratch3/blocks.js b/scratch3/blocks.js index 727b46ed..f0eeff96 100644 --- a/scratch3/blocks.js +++ b/scratch3/blocks.js @@ -97,6 +97,7 @@ IconView.icons = { loopArrow: { width: 24, height: 24 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, + list: { width: 11, height: 13 }, musicBlock: { width: 40, height: 40 }, penBlock: { width: 40, height: 40 }, videoBlock: { width: 40, height: 40, dy: 10 }, diff --git a/scratch3/style.js b/scratch3/style.js index ad6b7625..1d7f69b2 100644 --- a/scratch3/style.js +++ b/scratch3/style.js @@ -220,7 +220,43 @@ var Style = (module.exports = { id: "sb3-loopArrow", } ), - + + SVG.setProps( + SVG.group([ + SVG.el("rect", { + x: "0", + y: "0", + width: "11", + height: "13", + fill: "#fff", + }), + SVG.el("rect", { + x: "1", + y: "1", + width: "9", + height: "3", + fill: "#ff920f", + }), + SVG.el("rect", { + x: "1", + y: "5", + width: "9", + height: "3", + fill: "#ff920f", + }), + SVG.el("rect", { + x: "1", + y: "9", + width: "9", + height: "3", + fill: "#ff920f", + }), + ]), + { + id: "sb3-list", + } + ), + SVG.setProps( SVG.group([ SVG.el("path", { diff --git a/syntax/model.js b/syntax/model.js index 244e4301..aadf0eca 100644 --- a/syntax/model.js +++ b/syntax/model.js @@ -74,6 +74,7 @@ Icon.icons = { loopArrow: true, addInput: true, delInput: true, + list: true, } Icon.prototype.stringify = function() { From 498e58e3d08f4f9f8b54d170a460045cfa9e37bb Mon Sep 17 00:00:00 2001 From: CST1229 <68464103+CST1229@users.noreply.github.com> Date: Sun, 12 Sep 2021 17:41:17 +0200 Subject: [PATCH 2/4] Format code --- scratch2/style.js | 96 +++++++++++++++++++++++----------------------- scratch3/blocks.js | 2 +- scratch3/style.js | 36 ++++++++--------- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/scratch2/style.js b/scratch2/style.js index 45c96d34..49a87f81 100644 --- a/scratch2/style.js +++ b/scratch2/style.js @@ -155,91 +155,91 @@ var Style = (module.exports = { id: "loopArrow", } ), - SVG.setProps( + SVG.setProps( SVG.group([ SVG.el("rect", { x: "0", - y: "0", - width: "12", - height: "14", + y: "0", + width: "12", + height: "14", fill: "#000", opacity: "0.25", }), - SVG.el("rect", { + SVG.el("rect", { x: "1", - y: "1", - width: "1", - height: "13", + y: "1", + width: "1", + height: "13", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "11", - y: "1", - width: "1", - height: "13", + y: "1", + width: "1", + height: "13", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "1", - width: "9", - height: "1", + y: "1", + width: "9", + height: "1", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "5", - width: "9", - height: "1", + y: "5", + width: "9", + height: "1", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "9", - width: "9", - height: "1", + y: "9", + width: "9", + height: "1", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "13", - width: "9", - height: "1", + y: "13", + width: "9", + height: "1", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "2", - width: "9", - height: "2", + y: "2", + width: "9", + height: "2", fill: "#ea8d1c", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "6", - width: "9", - height: "2", + y: "6", + width: "9", + height: "2", fill: "#ea8d1c", }), - SVG.el("rect", { + SVG.el("rect", { x: "2", - y: "10", - width: "9", - height: "2", + y: "10", + width: "9", + height: "2", fill: "#ea8d1c", }), - SVG.el("rect", { + SVG.el("rect", { x: "11", - y: "0", - width: "1", - height: "1", + y: "0", + width: "1", + height: "1", fill: "#ea8d1c", }), - SVG.el("rect", { + SVG.el("rect", { x: "0", - y: "13", - width: "1", - height: "1", + y: "13", + width: "1", + height: "1", fill: "#ea8d1c", }), ]), diff --git a/scratch3/blocks.js b/scratch3/blocks.js index f0eeff96..a946d6a0 100644 --- a/scratch3/blocks.js +++ b/scratch3/blocks.js @@ -97,7 +97,7 @@ IconView.icons = { loopArrow: { width: 24, height: 24 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, - list: { width: 11, height: 13 }, + list: { width: 11, height: 13 }, musicBlock: { width: 40, height: 40 }, penBlock: { width: 40, height: 40 }, videoBlock: { width: 40, height: 40, dy: 10 }, diff --git a/scratch3/style.js b/scratch3/style.js index 1d7f69b2..aedc4d50 100644 --- a/scratch3/style.js +++ b/scratch3/style.js @@ -220,35 +220,35 @@ var Style = (module.exports = { id: "sb3-loopArrow", } ), - - SVG.setProps( + + SVG.setProps( SVG.group([ SVG.el("rect", { x: "0", - y: "0", - width: "11", - height: "13", + y: "0", + width: "11", + height: "13", fill: "#fff", }), - SVG.el("rect", { + SVG.el("rect", { x: "1", - y: "1", - width: "9", - height: "3", + y: "1", + width: "9", + height: "3", fill: "#ff920f", }), - SVG.el("rect", { + SVG.el("rect", { x: "1", - y: "5", - width: "9", - height: "3", + y: "5", + width: "9", + height: "3", fill: "#ff920f", }), - SVG.el("rect", { + SVG.el("rect", { x: "1", - y: "9", - width: "9", - height: "3", + y: "9", + width: "9", + height: "3", fill: "#ff920f", }), ]), @@ -256,7 +256,7 @@ var Style = (module.exports = { id: "sb3-list", } ), - + SVG.setProps( SVG.group([ SVG.el("path", { From 81a3a7ccb81f0e0537440dd427b78f008a22eb46 Mon Sep 17 00:00:00 2001 From: CST1229 <68464103+CST1229@users.noreply.github.com> Date: Sun, 12 Sep 2021 17:55:55 +0200 Subject: [PATCH 3/4] Make 3.0 list icons about 1.5x larger, remove positioning on 2.0 list icons --- scratch2/blocks.js | 2 +- scratch3/blocks.js | 2 +- scratch3/style.js | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scratch2/blocks.js b/scratch2/blocks.js index 6d532c5f..9109c518 100644 --- a/scratch2/blocks.js +++ b/scratch2/blocks.js @@ -109,7 +109,7 @@ IconView.icons = { loopArrow: { width: 14, height: 11 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, - list: { width: 12, height: 14, dx: -1, dy: -1 }, + list: { width: 12, height: 14 }, } /* Input */ diff --git a/scratch3/blocks.js b/scratch3/blocks.js index a946d6a0..1553f2a6 100644 --- a/scratch3/blocks.js +++ b/scratch3/blocks.js @@ -97,7 +97,7 @@ IconView.icons = { loopArrow: { width: 24, height: 24 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, - list: { width: 11, height: 13 }, + list: { width: 16, height: 19 }, musicBlock: { width: 40, height: 40 }, penBlock: { width: 40, height: 40 }, videoBlock: { width: 40, height: 40, dy: 10 }, diff --git a/scratch3/style.js b/scratch3/style.js index aedc4d50..4b5b1394 100644 --- a/scratch3/style.js +++ b/scratch3/style.js @@ -226,29 +226,29 @@ var Style = (module.exports = { SVG.el("rect", { x: "0", y: "0", - width: "11", - height: "13", + width: "16", + height: "19", fill: "#fff", }), SVG.el("rect", { x: "1", y: "1", - width: "9", - height: "3", + width: "13", + height: "4", fill: "#ff920f", }), SVG.el("rect", { x: "1", - y: "5", - width: "9", - height: "3", + y: "7", + width: "13", + height: "4", fill: "#ff920f", }), SVG.el("rect", { x: "1", - y: "9", - width: "9", - height: "3", + y: "13", + width: "13", + height: "4", fill: "#ff920f", }), ]), From c3e911f4098f7ca558ec4ba13722c0d95c04b466 Mon Sep 17 00:00:00 2001 From: CST1229 <68464103+CST1229@users.noreply.github.com> Date: Sun, 12 Sep 2021 17:58:31 +0200 Subject: [PATCH 4/4] Adjust 3.0 list icon size --- scratch3/blocks.js | 2 +- scratch3/style.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scratch3/blocks.js b/scratch3/blocks.js index 1553f2a6..1eb54cc6 100644 --- a/scratch3/blocks.js +++ b/scratch3/blocks.js @@ -97,7 +97,7 @@ IconView.icons = { loopArrow: { width: 24, height: 24 }, addInput: { width: 4, height: 8 }, delInput: { width: 4, height: 8 }, - list: { width: 16, height: 19 }, + list: { width: 15, height: 18 }, musicBlock: { width: 40, height: 40 }, penBlock: { width: 40, height: 40 }, videoBlock: { width: 40, height: 40, dy: 10 }, diff --git a/scratch3/style.js b/scratch3/style.js index 4b5b1394..0f560547 100644 --- a/scratch3/style.js +++ b/scratch3/style.js @@ -226,8 +226,8 @@ var Style = (module.exports = { SVG.el("rect", { x: "0", y: "0", - width: "16", - height: "19", + width: "15", + height: "18", fill: "#fff", }), SVG.el("rect", {