|
7 | 7 | <p class="text-sm font-normal mt-2 text-slate-300">
|
8 | 8 | Tiny Language Detector, simply detect the language of a unicode UTF-8 text
|
9 | 9 | </p>
|
| 10 | + <div class="flex justify-between mt-4"> |
| 11 | + <div class="flex items-center px-4 py-2 rounded border border-gray-200 dark:border-gray-700 bg-slate-200"> |
| 12 | + <input id="bordered-radio-2" type="radio" v-model="flavor" value="tinyld-light" name="bordered-radio" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"> |
| 13 | + <label for="bordered-radio-2" class="ml-2 w-full text-sm font-medium text-gray-900 dark:text-gray-300">TinyLD Light <span class="text-slate-400">~65KB</span></label> |
| 14 | + </div> |
| 15 | + <div class="flex items-center px-4 py-2 rounded border border-gray-200 dark:border-gray-700 bg-slate-200"> |
| 16 | + <input id="bordered-radio-1" type="radio" v-model="flavor" value="tinyld" name="bordered-radio" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"> |
| 17 | + <label for="bordered-radio-1" class="ml-2 w-full text-sm font-medium text-gray-900 dark:text-gray-300">TinyLD <span class="text-slate-400">~500KB</span></label> |
| 18 | + </div> |
| 19 | + <div class="flex items-center px-4 py-2 rounded border border-gray-200 dark:border-gray-700 bg-slate-200"> |
| 20 | + <input id="bordered-radio-3" type="radio" v-model="flavor" value="tinyld-heavy" name="bordered-radio" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"> |
| 21 | + <label for="bordered-radio-3" class="ml-2 w-full text-sm font-medium text-gray-900 dark:text-gray-300">TinyLD Heavy <span class="text-slate-400">~2MB</span></label> |
| 22 | + </div> |
| 23 | + </div> |
10 | 24 | <textarea
|
11 | 25 | rows="8"
|
12 | 26 | v-model="input"
|
|
68 | 82 | <script setup>
|
69 | 83 | import { ref, computed } from 'vue'
|
70 | 84 | import { detectAll } from 'tinyld'
|
| 85 | +import { detectAll as detectAllLight } from 'tinyld/light' |
| 86 | +import { detectAll as detectAllHeavy } from 'tinyld/heavy' |
71 | 87 | import { useClipboard } from '@vueuse/core'
|
72 | 88 |
|
73 | 89 | const input = ref('')
|
| 90 | +const flavor = ref('tinyld') |
74 | 91 | const results = computed(() => {
|
| 92 | + if (flavor.value === "tinyld-light") return detectAllLight(input.value) |
| 93 | + if (flavor.value === "tinyld-heavy") return detectAllHeavy(input.value) |
75 | 94 | return detectAll(input.value)
|
76 | 95 | })
|
| 96 | +
|
77 | 97 | const link = computed(() => {
|
78 | 98 | return `https://tinyld.vercel.app/?text=${encodeURIComponent(input.value)}`
|
79 | 99 | })
|
|
0 commit comments