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
Quiz.svelte
Slider.svelte
<script>
// add questions
import Slider from './Slider.svelte'
import Quiz from './Quiz.svelte'

const handleChange = (e) => {
console.clear()
console.log(e.detail.value)
}
</script>

<!-- <Slider on:change={handleChange} /> -->

<Quiz />

<Quiz
title="A taste for precision"
question="If you were to limit PI to 4 digits after the decimal point, what number would you find?"
answer={parseFloat(Math.PI.toFixed(4))}
details="{Math.PI.toFixed(
4
)}, precise enough? If you were to ask JavaScript for the full answer, by happenstance, you'd find {Math.PI}."
min={3.14}
max={3.1499}
value={3.14}
precision={4}
/>

<style>
:global(*) {
box-sizing: border-box;
}

:global(*),
:global(body){
margin: 0;
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */