From 6489163518fc13bf3f56c057a9aa7a3bd9dbd3d9 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 20 Mar 2019 14:07:32 -0700 Subject: [PATCH] Remove logo glow to optimize gif generation (#1894) * remove glow effect * adding more config * added workspace * pass width to screenshot info * set max number of frames * bum pxt --- microbit.code-workspace | 13 +++++++++++++ pxtarget.json | 4 +++- sim/dalboard.ts | 4 ++-- sim/visuals/microbit.ts | 18 +++--------------- 4 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 microbit.code-workspace diff --git a/microbit.code-workspace b/microbit.code-workspace new file mode 100644 index 00000000..c925e61c --- /dev/null +++ b/microbit.code-workspace @@ -0,0 +1,13 @@ +{ + "folders": [ + { + "path": "../pxt" + }, + { + "path": "../pxt-common-packages" + }, + { + "path": "." + } + ] +} \ No newline at end of file diff --git a/pxtarget.json b/pxtarget.json index 49a77599..cb0b6442 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -444,6 +444,8 @@ "0": "v0" }, "scriptManager": true, - "simGifTransparent": "rgba(0,0,0,0)" + "simGifTransparent": "rgba(0,0,0,0)", + "simGifMaxFrames": 44, + "simScreenshotMaxUriLength": 300000 } } diff --git a/sim/dalboard.ts b/sim/dalboard.ts index 78a94383..689cb5b4 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -147,8 +147,8 @@ namespace pxsim { return Promise.resolve(); } - screenshotAsync(): Promise { - return this.viewHost.screenshotAsync(); + screenshotAsync(width?: number): Promise { + return this.viewHost.screenshotAsync(width); } } diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index a496b96e..4c67f4c7 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -85,18 +85,6 @@ namespace pxsim.visuals { } /* animations */ - .sim-theme-glow { - animation-name: sim-theme-glow-animation; - animation-timing-function: ease-in-out; - animation-direction: alternate; - animation-iteration-count: infinite; - animation-duration: 1.25s; - } - @keyframes sim-theme-glow-animation { - from { opacity: 1; } - to { opacity: 0.75; } - } - .sim-flash { animation-name: sim-flash-animation; animation-duration: 0.1s; @@ -824,9 +812,9 @@ path.sim-board { // head this.head = svg.child(this.g, "g", { class: "sim-head no-drag" }); svg.child(this.head, "circle", { cx: 258, cy: 75, r: 100, fill: "transparent" }) - this.logos.push(svg.path(this.head, "sim-theme sim-theme-glow", "M269.9,50.2L269.9,50.2l-39.5,0v0c-14.1,0.1-24.6,10.7-24.6,24.8c0,13.9,10.4,24.4,24.3,24.7v0h39.6c14.2,0,24.8-10.6,24.8-24.7C294.5,61,284,50.3,269.9,50.2 M269.7,89.2L269.7,89.2l-39.3,0c-7.7-0.1-14-6.4-14-14.2c0-7.8,6.4-14.2,14.2-14.2h39.1c7.8,0,14.2,6.4,14.2,14.2C283.9,82.9,277.5,89.2,269.7,89.2")); - this.logos.push(svg.path(this.head, "sim-theme sim-theme-glow", "M230.6,69.7c-2.9,0-5.3,2.4-5.3,5.3c0,2.9,2.4,5.3,5.3,5.3c2.9,0,5.3-2.4,5.3-5.3C235.9,72.1,233.5,69.7,230.6,69.7")); - this.logos.push(svg.path(this.head, "sim-theme sim-theme-glow", "M269.7,80.3c2.9,0,5.3-2.4,5.3-5.3c0-2.9-2.4-5.3-5.3-5.3c-2.9,0-5.3,2.4-5.3,5.3C264.4,77.9,266.8,80.3,269.7,80.3")); + this.logos.push(svg.path(this.head, "sim-theme", "M269.9,50.2L269.9,50.2l-39.5,0v0c-14.1,0.1-24.6,10.7-24.6,24.8c0,13.9,10.4,24.4,24.3,24.7v0h39.6c14.2,0,24.8-10.6,24.8-24.7C294.5,61,284,50.3,269.9,50.2 M269.7,89.2L269.7,89.2l-39.3,0c-7.7-0.1-14-6.4-14-14.2c0-7.8,6.4-14.2,14.2-14.2h39.1c7.8,0,14.2,6.4,14.2,14.2C283.9,82.9,277.5,89.2,269.7,89.2")); + this.logos.push(svg.path(this.head, "sim-theme", "M230.6,69.7c-2.9,0-5.3,2.4-5.3,5.3c0,2.9,2.4,5.3,5.3,5.3c2.9,0,5.3-2.4,5.3-5.3C235.9,72.1,233.5,69.7,230.6,69.7")); + this.logos.push(svg.path(this.head, "sim-theme", "M269.7,80.3c2.9,0,5.3-2.4,5.3-5.3c0-2.9-2.4-5.3-5.3-5.3c-2.9,0-5.3,2.4-5.3,5.3C264.4,77.9,266.8,80.3,269.7,80.3")); this.headText = svg.child(this.g, "text", { x: 310, y: 100, class: "sim-text" }) // https://www.microbit.co.uk/device/pins