smq

joined 1 month ago
[–] [email protected] 2 points 3 weeks ago

it's an open access article!

[–] [email protected] 2 points 4 weeks ago
[–] [email protected] 2 points 1 month ago

I don't know what perchance.org is but good luck!

8
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Mobile Websites: the Viewport Meta Tag

If you're starting out making a website work on mobile, the viewport meta tag is important.

My website looked so much smaller on mobile than if I just made the browser window thinner and I had no idea why. I looked it up, and most of the answers suggested using the @media (width) query to target thin screens. There were also some that suggested the viewport meta tag, but I didn't know what that was, so I thought "pfft that won't work" and ignored it.

So I tried using @media to make the font bigger if the screen width was below 500px. That solved the problem for mobile, but made the text in my thin desktop browser window huge. So I kept looking, eventually found the viewport meta tag again, tried it out of desperation, and everything just worked.

<meta name="viewport" content="width=device-width, initial-scale=1" /> 

This tag goes between <head> and </head> in your html file. (More information)

The problem was that mobile browsers, if they don't see a meta viewport tag, scales everything down, including the size of a px, etc. The content="width=device-width part tells the browser to not scale things down. The initial-scale=1 part is not important in this scenario, but a bunch of answers include it with content=, so I might as well explain it. It makes the browser's pinch-gesture zoom level be set to 1, which is the default anyways, so theoretically it won't make a difference if you take it out.

For a more detailed explation, see https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag

I think a lot of guides for responsive web design/mobile-friendly web design don't mention this, or only put it towards the end. Which is not that great. Surely it's not just me that struggled for so long with @media to no avail.

text-size-adjust

Another thing I noticed was the font would get bigger if I made my phone landscape. But not the font of the entire page, only the default body text font, so everything was not only bigger than necessary but also out of proportion. After looking it up again, I found this answer that suggested using text-size-adjust.

I put text-size-adjust: none; into my css, and it didn't work. I then tried the browser-specific versions suggested in the answer, and also set them to 100%.

-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;

That worked!

// End.

[–] [email protected] 2 points 1 month ago

I'm glad you like it!

 

Hey Lemmy!

Exactly as the title says.

I'm a user, not a server admin, so this is about deleting messages I've sent rather than cleaning old messages on a server. Ideally I'm looking for a script which I can run on a timer once a day, and each time it runs, it will delete all my messages, or my messages in some specified rooms, that are older than say two weeks. Basically an automated finger that presses the delete button repeatedly.

I know about m.room.retention but I don't want to have to set it for every room. And it doesn't seem to be reliable; it doesn't work in a matrix.org test room I set up with one minute retention. Even when I cleared the cache.

The closest I've found is this branch, but as this issue mentioned, it purges all messages rather than only messages older than X time.

If no one has a better script, I'll write one myself or fork the above script. But in case anyone here's already gone to the trouble... I won't have to learn the Matrix API :)


Edit 1:

I did make the script, but it's slow; each message deletion sent to matrix.org has to wait about 4 seconds due to rate limiting. I send a lot of messages per day, so it's barely an acceptable solution.

The whole concept also feels awkwardly inefficient because I have to send a request for each message, rather than the server and clients running their own timers.

I moved to Delta Chat for now, for its disappearing messages.

I found some nice comparison tables of instant messaging services that could be of use:

view more: ‹ prev next ›