Skip to content

Commit f69a4e7

Browse files
committed
feat(new tool): Zalgo Generator/Cleaner
Fix #319
1 parent 40fb4b7 commit f69a4e7

3 files changed

Lines changed: 1011 additions & 0 deletions

File tree

src/tools/zalgo/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Artboard } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Zalgo Generator/Banner',
6+
path: '/zalgo',
7+
description: 'Generate Zalgo text and clean zalgo generated text',
8+
keywords: ['zalgo', 'text', 'generation'],
9+
component: () => import('./zalgo.vue'),
10+
icon: Artboard,
11+
createdAt: new Date('2026-02-21'),
12+
category: 'Text',
13+
});

src/tools/zalgo/zalgo.vue

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<script setup lang="ts">
2+
import { useCopy } from '@/composable/copy';
3+
import { useQueryParamOrStorage } from '@/composable/queryParams';
4+
import { lunicode } from '@/utils/lunicode';
5+
6+
const textInput = ref('');
7+
const intensity = useQueryParamOrStorage({ name: 'intensity', storageName: 'zalgo:i', defaultValue: 8 });
8+
watch(intensity, () => {
9+
if (textInput.value) {
10+
doZalgo();
11+
}
12+
});
13+
const zalgoOutput = ref('');
14+
function doZalgo() {
15+
lunicode.tools.creepify.options.maxHeight = intensity.value;
16+
zalgoOutput.value = lunicode.tools.creepify.encode(textInput.value);
17+
}
18+
const { copy: copyZalgoOutput } = useCopy({ source: zalgoOutput, text: 'Zalgo text copied!' });
19+
20+
const zalgoInput = ref('');
21+
const textOutput = ref('');
22+
function unZalgo() {
23+
textOutput.value = lunicode.tools.creepify.decode(zalgoInput.value);
24+
}
25+
</script>
26+
27+
<template>
28+
<c-card title="Zalgo Text Generation">
29+
<c-input-text
30+
v-model:value="textInput"
31+
multiline
32+
placeholder="Put your string here..."
33+
rows="5"
34+
label="Text to decorate with Zalgo"
35+
raw-text
36+
mb-2
37+
/>
38+
39+
<n-form-item label="Intensity:" label-placement="left" mb-3>
40+
<NSlider v-model:value="intensity" :min="1" :max="300" :step="1" />
41+
</n-form-item>
42+
43+
<n-space justify="center" mb-2>
44+
<n-button
45+
type="primary"
46+
@click="doZalgo"
47+
>
48+
Generate
49+
</n-button>
50+
</n-space>
51+
52+
<div v-if="zalgoOutput">
53+
<n-card title="Zalgo text" mb-2>
54+
<div :style="{ lineHeight: intensity / 3, textAlign: 'center' }">
55+
{{ zalgoOutput }}
56+
</div>
57+
</n-card>
58+
59+
<div flex justify-center>
60+
<c-button @click="copyZalgoOutput()">
61+
Copy
62+
</c-button>
63+
</div>
64+
</div>
65+
</c-card>
66+
67+
<c-card title="Zalgo cleaner">
68+
<c-input-text
69+
v-model:value="zalgoInput"
70+
multiline
71+
placeholder="Put zalgo text to clean here..."
72+
rows="5"
73+
label="Zalgo text to clean"
74+
mb-5
75+
/>
76+
77+
<n-space justify="center" mb-2>
78+
<n-button
79+
type="primary"
80+
@click="unZalgo"
81+
>
82+
Clean
83+
</n-button>
84+
</n-space>
85+
86+
<TextareaCopyable
87+
v-if="textOutput"
88+
v-model:value="textOutput"
89+
label="Cleaned text"
90+
placeholder="Clean zalgo text will appear here..."
91+
mb-5
92+
/>
93+
</c-card>
94+
</template>

0 commit comments

Comments
 (0)