-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from fdnd-agency/55-component-checkbox
- Loading branch information
Showing
3 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script> | ||
export let answer; // Het antwoord object dat je doorgeeft | ||
export let bindGroup; // Voor het binden van de groep aan het antwoord | ||
</script> | ||
|
||
<label> | ||
<input type="radio" name="answer" value={answer.score} bind:group={bindGroup}> | ||
{answer.answer} | ||
</label> | ||
|
||
<style> | ||
label { | ||
background-color: var(--D-base-bk); | ||
border-radius: 1rem; | ||
border: 0.1rem solid var(--D-mid-bk); | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 1rem; | ||
cursor: pointer; | ||
} | ||
label:hover{ | ||
background-color: var(--D-t-support); | ||
border: 0.1rem solid var(--D-t-support); | ||
font-weight: 600; | ||
color: var(--D-white); | ||
transition: 2s transform ease-in-out; | ||
} | ||
input[type="radio"] { | ||
-webkit-appearance: none; | ||
appearance: none; | ||
background-color: var(--D-white); | ||
margin: 0 0.5rem 0 0; | ||
font: inherit; | ||
color: var(--D-mid-bk); | ||
width: 1.15rem; | ||
height: 1.15rem; | ||
border: 0.15rem solid var(--D-mid-bk); | ||
border-radius: 50%; | ||
display: grid; | ||
place-content: center; | ||
} | ||
input[type="radio"]::before { | ||
content: ""; | ||
width: 0.65rem; | ||
height: 0.65rem; | ||
border-radius: 50%; | ||
transform: scale(0); | ||
transition: 120ms transform ease-in-out; | ||
box-shadow: inset 1rem 1rem var(--D-dark-support); | ||
} | ||
input[type="radio"]:checked::before { | ||
transform: scale(1); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
<script> | ||
export let data; | ||
import { goto } from '$app/navigation'; | ||
import { onMount } from 'svelte'; | ||
onMount(() => { | ||
goto('/Inlog'); | ||
}); | ||
import Checkbox from '$lib/checkbox.svelte'; | ||
</script> | ||
|
||
<h1>{data.person.name}</h1> | ||
|
||
<div> | ||
{#each {length: 4} as _, i} | ||
<Checkbox/> | ||
{/each} | ||
</div> | ||
|
||
|
||
<a href="/inlog">login</a> | ||
<a href="/overview">overzicht</a> | ||
<style> | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 1rem; | ||
gap: 1rem; | ||
font-family: Arial, Helvetica, sans-serif; | ||
} | ||
</style> |