Guilherme Dea on Nostr: I was coding a javascript function to create a grid with equal sides. When ...
I was coding a javascript function to create a grid with equal sides. When calculating height and width, I calculated 100 / number of columns/rows. This made flexbox act weird, pushing the last square of the row to the next row, leaving a solitary square on the last row. I fixed it by changing width to 95 / number. But it left gaps between the rows...which I fixed by reverting the height calc to 100 / number.
Now, I want to understand why the hell I had to do all this and how it worked???
Published at
2024-06-28 01:06:55Event JSON
{
"id": "9f80738b698f832be13cd3134cc0960017bf9b36fb83dffb04eadb15aa2c66a0",
"pubkey": "1a1dca6ef3bb570c06d9772d9dbdd7badef8c9872432d1b2f9348e7faa1e581c",
"created_at": 1719536815,
"kind": 1,
"tags": [
[
"proxy",
"https://masto.ai/@guilhermedea/112691564711140209",
"web"
],
[
"proxy",
"https://masto.ai/users/guilhermedea/statuses/112691564711140209",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://masto.ai/users/guilhermedea/statuses/112691564711140209",
"pink.momostr"
],
[
"expiration",
"1722128818"
]
],
"content": "I was coding a javascript function to create a grid with equal sides. When calculating height and width, I calculated 100 / number of columns/rows. This made flexbox act weird, pushing the last square of the row to the next row, leaving a solitary square on the last row. I fixed it by changing width to 95 / number. But it left gaps between the rows...which I fixed by reverting the height calc to 100 / number.\n\nNow, I want to understand why the hell I had to do all this and how it worked???",
"sig": "1495062df8581a182827d7bf4eeb483aaea640a9d28b30e36afdeb32c09a395ef5ccd3e5345f134b49f900299d09a0de10f06387d1d183e2033e7293eca95cdf"
}