-
Notifications
You must be signed in to change notification settings - Fork 8
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 #90 from LittleFoxCompany/feature/remove-tailwind-…
…dependancy Remove Tailwind Utility classes from functions
- Loading branch information
Showing
2 changed files
with
25 additions
and
25 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,43 +1,44 @@ | ||
<template> | ||
<Example class="flex"> | ||
<ExampleInputs class="flex flex-col"> | ||
<div class="flex gap-4"> | ||
<FormInput v-model="value" label="Title" /> | ||
<FormSelect v-model="splitBy" label="Select" name="select" placeholder="Select an option"> | ||
<div class="flex gap-4 w-full"> | ||
<FormInput v-model="value" label="Title" /> | ||
<FormSelect v-model="splitBy" label="Select" name="select" placeholder="Select an option"> | ||
<option value="word">Word</option> | ||
<option value="character">Character</option> | ||
</FormSelect> | ||
</div> | ||
<div class="flex gap-4 w-full"> | ||
<FormInput v-model="time" label="Time" type="number" name="time" value="100" placeholder="Time" /> | ||
<FormSelect v-model="unit" label="Unit" name="unit" placeholder="Select an option"> | ||
<option value="ms">ms</option> | ||
<option value="s">s</option> | ||
</FormSelect> | ||
</div> | ||
<div class="flex gap-4"> | ||
<FormInput v-model="time" label="Time" type="number" name="time" value="100" placeholder="Time" /> | ||
<FormSelect v-model="unit" label="Unit" name="unit" placeholder="Select an option"> | ||
<option value="ms">ms</option> | ||
<option value="s">s</option> | ||
</FormSelect> | ||
</div> | ||
</div> | ||
<FormInput v-model="className" label="Classes" type="text" name="classes" placeholder="Classes" /> | ||
</ExampleInputs> | ||
|
||
<ExampleResult> | ||
<h1 :key="animationKey" v-html="animated" class="text-balance text-center font-bold leading-[1.25em] text-4xl text-gray-900 dark:text-white"></h1> | ||
</ExampleResult> | ||
</Example> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref, computed, watch } from 'vue'; | ||
import { ref, computed, watch } from 'vue' | ||
const value = ref('Zippy little utils for your JavaScript projects.'); | ||
const splitBy = ref('word'); | ||
const time = ref(100); | ||
const unit = ref('ms'); | ||
const className = ref('animate-fade-in-up'); | ||
const animationKey = ref(0); | ||
const value = ref('Zippy little utils for your JavaScript projects.') | ||
const splitBy = ref('word') | ||
const time = ref(100) | ||
const unit = ref('ms') | ||
const className = ref('animate-fade-in-up') | ||
const animationKey = ref(0) | ||
const animated = computed(() => { | ||
return animateText(value.value, { splitBy: splitBy.value, time: time.value, unit: unit.value, class: className.value }); | ||
}); | ||
return animateText(value.value, { splitBy: splitBy.value, time: time.value, unit: unit.value, class: className.value }) | ||
}) | ||
watch([value, splitBy, time, unit, className], () => { | ||
animationKey.value += 1; | ||
}); | ||
animationKey.value += 1 | ||
}) | ||
</script> |
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