From fa2ef57a7198b61857607afa50dcbcd408f91dbd Mon Sep 17 00:00:00 2001 From: Josh Nussbaum Date: Sun, 7 Mar 2021 15:20:06 -0500 Subject: [PATCH] Adds tweening for typing forward and reverse --- src/App.svelte | 133 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 120 insertions(+), 13 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index ce25124..7b32cb5 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -5,15 +5,17 @@ import 'codemirror/mode/ruby/ruby' import 'codemirror/mode/htmlmixed/htmlmixed' import marked from 'marked' - import {onMount} from 'svelte' + import {onMount, onDestroy} from 'svelte' import { quintInOut, elasticInOut } from 'svelte/easing' import { tweened } from 'svelte/motion' import { get, derived } from 'svelte/store' import { fly, fade } from 'svelte/transition' + import * as easingFns from 'svelte/easing' let scrollX let scrollY + let tween, cleanup let current = null let stepIndex = null let language = 'javascript' @@ -141,12 +143,77 @@ function triple(a) { } ] + code = '' + language = 'htmlmixed' + steps = [ + { + type: 'add', + text: "