Skip to content

Commit

Permalink
chore: small app and klmbr tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
av committed Jan 19, 2025
1 parent 598c46e commit 48c39c5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const TOGGLE_DELAY = 250;
export const LoaderElements = {
linear: <progress className="progress my-2 max-w-56"></progress>,
overlay: (
<div className="absolute inset-0 p-6 flex items-center justify-center bg-base-200/60 pointer-events-none rounded-box">
<div className="absolute inset-0 p-6 flex items-center justify-center bg-base-200/60 pointer-events-none rounded-box z-10">
<progress className="progress"></progress>
</div>
),
Expand Down
2 changes: 1 addition & 1 deletion app/src/home/ServiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const ServiceCard = (
className={`p-4 rounded-box cursor-default bg-base-200/50 relative ${gradientClass}`}
>
<h2 className="flex items-center gap-1 text-2xl pb-2">
<span className="font-bold">{service.handle}</span>
<span className="font-bold shrink-1">{service.handle}</span>

{canLaunch && (
<>
Expand Down
2 changes: 1 addition & 1 deletion app/src/home/ServiceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const ServiceList = () => {
</div>
}
children={
<div className="relative rounded-box">
<div className="rounded-box">
<Loader loading={loading} loader="overlay" />
{error && <div className="my-2">{error.message}</div>}
{services && (
Expand Down
24 changes: 22 additions & 2 deletions boost/src/modules/klmbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,37 @@ def diacritic(chars, idx):
return chars[idx]


def is_standalone_vowel(chars, idx):
if not chars or idx < 0 or idx >= len(chars):
return False

vowels = 'aeiouAEIOU'
if chars[idx] not in vowels:
return False

prev_is_space = idx == 0 or chars[idx-1].isspace()
next_is_space = idx == len(chars)-1 or chars[idx+1].isspace()

return prev_is_space or next_is_space


def leetspeak(chars, idx):
return leetspeak_map.get(chars[idx].lower(), chars[idx])
if is_standalone_vowel(chars, idx):
return chars[idx]

return leetspeak_map.get(chars[idx].lower(), chars[idx])

def remove_vowel(chars, idx):
if chars[idx].lower() in "aeiou":
if not is_standalone_vowel(chars, idx) and chars[idx].lower() in "aeiou":
return ""

return chars[idx]


def invert_180(chars, idx):
if is_standalone_vowel(chars, idx):
return chars[idx]

return invert_map.get(chars[idx], chars[idx])


Expand Down

0 comments on commit 48c39c5

Please sign in to comment.