Skip to content

Commit

Permalink
Merge branch 'birdflop' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
saboooor committed Jun 21, 2024
2 parents 331b292 + 1909105 commit 328d291
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/routes/resources/animtab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,12 @@ export default component$(() => {
'font-mc-bold-italic': store.bold && store.italic,
}}>
{(() => {
const text = store.text != '' ? store.text : 'birdflop';
if (!store.text || !tmpstore.frames[0]) return '\u00A0';

if (!tmpstore.frames[0]) return;
const colors = tmpstore.frames[tmpstore.frame];
if (!colors) return;
if (!colors) return '\u00A0';

return text.split('').map((char: string, i: number) => (
return store.text.split('').map((char: string, i: number) => (
<span key={`char${i}`} style={`color: #${colors[i] ?? colors[i - 1] ?? colors[0]};`} class={{
'underline': store.underline,
'strikethrough': store.strikethrough,
Expand Down
8 changes: 4 additions & 4 deletions src/routes/resources/rgb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ export default component$(() => {
'font-mc-bold-italic': store.bold && store.italic,
}}>
{(() => {
const text = store.text ? store.text : 'birdflop';
if (!store.text) return '\u00A0';

const colors = sortColors(store.colors).map((color) => ({ rgb: convertToRGB(color.hex), pos: color.pos }));
if (colors.length < 2) return text;
if (colors.length < 2) return store.text;

const gradient = new Gradient(colors, text.length);
const gradient = new Gradient(colors, store.text.length);

let hex = '';
return text.split('').map((char: string, i: number) => {
return store.text.split('').map((char: string, i: number) => {
if (store.trimspaces && char == ' ') gradient.next();
else hex = convertToHex(gradient.next());
return (
Expand Down

0 comments on commit 328d291

Please sign in to comment.