Skip to content

Commit

Permalink
Add squares animation
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoTheThird committed Sep 28, 2021
1 parent fefd732 commit 35dfdf0
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/plugins/adb/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AdbPlugin extends Plugin {
action__format({ partition }) {
return Promise.resolve()
.then(() => {
this.event.emit("user:write:working", "particles");
this.event.emit("user:write:working", "squares");
this.event.emit(
"user:write:status",
"Preparing system for installation",
Expand All @@ -91,7 +91,7 @@ class AdbPlugin extends Plugin {
*/
action__sideload({ group, file }) {
return Promise.resolve().then(() => {
this.event.emit("user:write:working", "particles");
this.event.emit("user:write:working", "circuit");
this.event.emit("user:write:status", `Sideloading ${group}`, true);
this.event.emit(
"user:write:under",
Expand Down
4 changes: 2 additions & 2 deletions src/core/plugins/fastboot/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class FastbootPlugin extends Plugin {
*/
action__erase({ partition }) {
return Promise.resolve().then(() => {
this.event.emit("user:write:working", "particles");
this.event.emit("user:write:working", "squares");
this.event.emit("user:write:status", "Cleaning up", true);
this.event.emit(
"user:write:under",
Expand All @@ -205,7 +205,7 @@ class FastbootPlugin extends Plugin {
*/
action__format({ partition, type, size }) {
return Promise.resolve().then(() => {
this.event.emit("user:write:working", "particles");
this.event.emit("user:write:working", "squares");
this.event.emit("user:write:status", "Cleaning up", true);
this.event.emit(
"user:write:under",
Expand Down
2 changes: 1 addition & 1 deletion src/core/plugins/heimdall/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class HeimdallPlugin extends Plugin {
*/
action__flash({ partitions }) {
return Promise.resolve().then(() => {
this.event.emit("user:write:working", "particles");
this.event.emit("user:write:working", "circuit");
this.event.emit("user:write:status", "Flashing firmware", true);
this.event.emit(
"user:write:under",
Expand Down
7 changes: 7 additions & 0 deletions src/ui/partials/Animation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { animationType } from "../../stores.mjs";
import { tsParticles } from "tsparticles";
import CircuitBoard from "./CircuitBoard.svelte";
import Squares from "./Squares.svelte";
onMount(updateAnimations);
animationType.subscribe(updateAnimations);
Expand Down Expand Up @@ -57,11 +58,17 @@
HACK particles can not be conditionally rendered to be reliably shown when transitioning from one working view to the next. We thus hide and show them using css rather than svelte's built-in conditional rendering. Unfortunately, svelte does not yet posess an equivalet to Vue's v-show field.
-->
<div id="tsparticles" class="animation" />

{#if $animationType === "circuit"}
<div class="animation">
<CircuitBoard />
</div>
{/if}
{#if $animationType === "squares"}
<div class="animation">
<Squares />
</div>
{/if}
{#if $animationType === "download"}
<div class="download-animation animation" />
{/if}
Expand Down
55 changes: 55 additions & 0 deletions src/ui/partials/Squares.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<div class="square" />
<div class="square" />
<div class="square" />
<div class="square" />
<div class="square" />
<div class="square" />

<style>
.square {
position: absolute;
top: 80vh;
left: 45vw;
width: 10px;
height: 10px;
border: solid 1px #6c757d;
transform-origin: top left;
transform: scale(0) rotate(0deg) translate(-50%, -50%);
animation: