Skip to content

Commit 6489163

Browse files
authored
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
1 parent be617f6 commit 6489163

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

microbit.code-workspace

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "../pxt"
5+
},
6+
{
7+
"path": "../pxt-common-packages"
8+
},
9+
{
10+
"path": "."
11+
}
12+
]
13+
}

pxtarget.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@
444444
"0": "v0"
445445
},
446446
"scriptManager": true,
447-
"simGifTransparent": "rgba(0,0,0,0)"
447+
"simGifTransparent": "rgba(0,0,0,0)",
448+
"simGifMaxFrames": 44,
449+
"simScreenshotMaxUriLength": 300000
448450
}
449451
}

sim/dalboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ namespace pxsim {
147147
return Promise.resolve();
148148
}
149149

150-
screenshotAsync(): Promise<ImageData> {
151-
return this.viewHost.screenshotAsync();
150+
screenshotAsync(width?: number): Promise<ImageData> {
151+
return this.viewHost.screenshotAsync(width);
152152
}
153153
}
154154

sim/visuals/microbit.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,6 @@ namespace pxsim.visuals {
8585
}
8686
8787
/* animations */
88-
.sim-theme-glow {
89-
animation-name: sim-theme-glow-animation;
90-
animation-timing-function: ease-in-out;
91-
animation-direction: alternate;
92-
animation-iteration-count: infinite;
93-
animation-duration: 1.25s;
94-
}
95-
@keyframes sim-theme-glow-animation {
96-
from { opacity: 1; }
97-
to { opacity: 0.75; }
98-
}
99-
10088
.sim-flash {
10189
animation-name: sim-flash-animation;
10290
animation-duration: 0.1s;
@@ -824,9 +812,9 @@ path.sim-board {
824812
// head
825813
this.head = <SVGGElement>svg.child(this.g, "g", { class: "sim-head no-drag" });
826814
svg.child(this.head, "circle", { cx: 258, cy: 75, r: 100, fill: "transparent" })
827-
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"));
828-
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"));
829-
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"));
815+
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"));
816+
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"));
817+
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"));
830818
this.headText = <SVGTextElement>svg.child(this.g, "text", { x: 310, y: 100, class: "sim-text" })
831819

832820
// https://www.microbit.co.uk/device/pins

0 commit comments

Comments
 (0)