Skip to content

Commit

Permalink
future changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefterv committed Jan 9, 2021
1 parent 363688d commit 276f5c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions components/preview/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<template>
<div class="preview">
<h4>Preview</h4>
<svg v-if="state.possiblePlan" :viewBox="preview.viewBox">
<svg v-if="preview" :viewBox="preview.viewBox">
<line
v-for="motion in preview.motions"
:key="motion.id"
:class="{ drawn: state.motionIdx > motion.id, penDown: motion.penDown }"
:class="{
drawn: state.motionIdx > motion.id,
current: state.motionIdx == motion.id,
penDown: motion.penDown,
}"
:x1="motion.p1.x"
:x2="motion.p2.x"
:y1="motion.p1.y"
Expand All @@ -20,8 +24,8 @@ export default {
inject: ["state"],
computed: {
preview() {
let plan = this.state.possiblePlan;
if (!plan) return {};
let plan = this.state.plan || this.state.possiblePlan;
if (!plan) return;
let penDown = false;
let motions = plan.motions
.map((motion, index) => {
Expand Down Expand Up @@ -80,6 +84,9 @@ line {
stroke: black;
}
&.drawn {
stroke: green;
}
&.current {
stroke: red;
}
}
Expand Down
Empty file added pages/figma/finished.vue
Empty file.

0 comments on commit 276f5c3

Please sign in to comment.