Thomas Michael Semmler on Nostr: I am facing a somewhat new challenge, which is that I am attempting to calculate a ...
I am facing a somewhat new challenge, which is that I am attempting to calculate a font-sizes with javascript, that will make sure that a user-provided text will always fit a box.
As in, if I just type a single character, it is supposed to be as large as possible and if I type a lot, it is supposed to be as small as necessary to still fit the whole text.
Haven't done something like this before tbh.
#webdev #javascript #css
Published at
2024-07-31 12:59:46Event JSON
{
"id": "3de1f00cb6622fbbc63d42d126dac72a8cca2b4da8f88eee04147e3aaa0bd7a0",
"pubkey": "f86500d735ea38e3a46676bcd70601111127eb346aa80670240772c8b73bebc5",
"created_at": 1722430786,
"kind": 1,
"tags": [
[
"t",
"css"
],
[
"t",
"javascript"
],
[
"proxy",
"https://indieweb.social/@nachtfunke/112881224053764954",
"web"
],
[
"t",
"webdev"
],
[
"proxy",
"https://indieweb.social/users/nachtfunke/statuses/112881224053764954",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://indieweb.social/users/nachtfunke/statuses/112881224053764954",
"pink.momostr"
],
[
"-"
]
],
"content": "I am facing a somewhat new challenge, which is that I am attempting to calculate a font-sizes with javascript, that will make sure that a user-provided text will always fit a box.\n\nAs in, if I just type a single character, it is supposed to be as large as possible and if I type a lot, it is supposed to be as small as necessary to still fit the whole text.\n\nHaven't done something like this before tbh.\n\n#webdev #javascript #css",
"sig": "b7060b2a54e7fb4e3b2fe340f9d4544691f608c3f73d5d57c1f7d57e650cfe3bb58a61417e848f69a3fa3f580ab3dc1416e12107f4ff2c9fccb13e539256a7b7"
}