Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<script>
import { tweened } from 'svelte/motion'
import { quadInOut as easing } from 'svelte/easing'
let value = tweened(0);
function handleInput(e) {
value.set(parseInt(e.target.value, 0), {duration: 0})
}
function handleRelease() {
if($value === 0) return;
value
.set(0, { duration: 1000, easing });
}

$: offset = $value * 3;
$: angle = $value * 14.2;
$: charge = offset / 8;
</script>

<style>
:global(body) {
background: #f2f2f2;
color: #1c1c1a;
padding: 0;
}
div {
width: 100%;
max-width: 600px;
margin: 1rem auto;
}
input {
width: 100%;
}
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */