-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0513c3
commit d282d6e
Showing
6 changed files
with
34 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{isLogin: boolean}>() | ||
const emit = defineEmits<(e: 'update:isLogin', value: boolean) => void>() | ||
const handleCheckboxChange = () => { | ||
emit('update:isLogin', !props.isLogin) | ||
} | ||
</script> | ||
|
||
<template> | ||
<label class="flex p-2 relative w-full cursor-pointer border-2 border-primary/30 rounded-xl bg-white/30"> | ||
<input type="checkbox" class="sr-only" @change="handleCheckboxChange"> | ||
<button | ||
class="flex p-2 relative w-full cursor-pointer border-2 border-primary/30 rounded-xl bg-white/30 outline-none focus:border-primary/60 duration-200 transition-colors" | ||
aria-label="Przełącznik rejestracji i logowania" | ||
@click="emit('update:isLogin', !props.isLogin)" | ||
> | ||
<span | ||
:class="{ 'translate-x-full' : props.isLogin}" | ||
:class="{ 'translate-x-full' : props.isLogin }" | ||
class="left-2 w-[calc(50%-.5rem)] absolute h-[calc(100%-1rem)] rounded-md bg-primary duration-200" | ||
/> | ||
<span :class="{ 'text-white': !props.isLogin}" class="z-10 w-full text-center duration-200 py-3 text-primary font-bold">Rejestracja</span> | ||
<span :class="{ 'text-white': !props.isLogin }" class="z-10 w-full text-center duration-200 py-3 text-primary font-bold">Rejestracja</span> | ||
<span :class="{ 'text-white': props.isLogin }" class="z-10 w-full text-center duration-200 py-3 text-primary font-bold">Logowanie</span> | ||
</label> | ||
<div aria-live="assertive" class="sr-only"> | ||
{{ props.isLogin ? 'Logowanie' : 'Rejestracja' }} | ||
</div> | ||
</button> | ||
</template> |
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
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
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