UPD: Feedback type buttons

This commit is contained in:
Robert Kossessa
2024-01-29 15:45:49 +01:00
parent cdfc597edf
commit 417fe62532
6 changed files with 10 additions and 60 deletions

View File

@@ -9,7 +9,7 @@
:src="icon" alt="connection-type-icon"
class="w-24 size-w mb-2"
:class="{'invert': selected}">
<ScrambleText ref="title" class="text-xs text-wrap" :text="title" />
<ScrambleText ref="title" :resize="false" class="text-xs text-wrap" :text="title" />
</button>
</template>
<script setup>

View File

@@ -1,15 +1,15 @@
<template>
<button
class="flex-1 flex flex-col justify-center items-center py-2"
class="flex-1 flex flex-col items-center py-2"
:class="{'text-black bg-zinc-200 hover:bg-zinc-100': selected,
'hover:bg-zinc-800 text-muted-foreground' : !selected}"
@click="$emit('select'); $refs.title.scramble()">
<img
draggable="false"
:src="icon" alt="connection-type-icon"
class="p-4"
class="w-16 py-2"
:class="{'invert': selected}">
<ScrambleText ref="title" class="text-xs text-wrap" :text="title" />
<ScrambleText ref="title" :resize="false" class="text-xs text-wrap p-1" :text="title" />
</button>
</template>
<script setup>

View File

@@ -37,6 +37,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
resize: {
type: Boolean,
default: true,
},
delay: {
type: Number,
default: 0,
@@ -78,7 +82,7 @@ function replaceContent(text = props.text, replaceInterval = props.replaceInterv
function scramble(scrambleAmount = props.scrambleAmount, replaceInterval = props.replaceInterval, fillInterval = props.fillInterval, characterSet = props.characterSet, text = props.text, fillText = props.text) {
content.value = ''
const spec = Math.random() > 0.99
const spec = props.resize && (Math.random() > 0.99)
let i = 0
const specChars = atob('S09TUk8tRUFTVEVSRUdH')
const fillContent = function() {