this post was submitted on 17 Jun 2023
21 points (100.0% liked)

Lemmy Plugins and Userscripts

375 readers
1 users here now

A general repository for user scripts and plugins used to enhance the Lemmy browsing experience.

Post (or cross-post) your favorite Lemmy enhancements here!

General posting suggestions:

Thanks!

founded 1 year ago
MODERATORS
21
submitted 1 year ago* (last edited 1 year ago) by 0485919158191 to c/[email protected]
 

Thanks for using my script. I will keep this thread updated with all the changes. Just look at the changelog.

If you have any tips on features and/or improvements then leave a comment and I'll take a look!


Changelog:

Version 0.5

The nav will now be sticky and move when you scroll down so you always have access to it!

Version 0.4

Removed bold as default...


Version 0.3

Added separators and colors codes for every link. Now you can edit the TextColor when you add a new custom link

{ title: 'Plugins', url: 'https://lemmy.world/c/[email protected]', textColor: "#000000" }

Feel free to add or remove the separators as well

{ title: '|', url: '#', textColor: "#000000" }

Also added an option to change font weight:

link.style.fontWeight = "bold" = Bold

link.style.fontWeight = "" = Regular


Version 0.2

Some code update...


Version 0.1

Just replace the titles and urls with your own links after you install the script

top 22 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (2 children)

This is great!

I'm wondering how to change the color of various labels and to add a separator or two in the bar.

Edit: NVM, I figured it out, added a variable for color for each of the labels and just used a '|' character for a separator, so I can have the communities I moderate as one color, and other ones I want in there as another. So now it looks something like this:

[–] 0485919158191 1 points 1 year ago

Awesome. That looks great!

[–] 0485919158191 1 points 1 year ago

I took your example and updated the code with separators and colors! Thanks for the tip!

[–] [email protected] 3 points 1 year ago (1 children)
[–] 0485919158191 1 points 1 year ago
[–] [email protected] 3 points 1 year ago (2 children)

Is it possible to make the navbar stick at the top of the browser and not scroll when the page is scrolled?

[–] 0485919158191 1 points 1 year ago

That's a great suggestion. I have updated the script. It should now be sticky and scroll with you.

Edit: I see that your comment already suggested the behavior I originally had. I thought you wanted it to be sticky and scroll when you do. Anyways, I've added it and it's cool!

[–] [email protected] 1 points 1 year ago

I see this has been added in 0.5. That's awesome!

[–] miked 2 points 1 year ago (1 children)
[–] 0485919158191 2 points 1 year ago

Thank you! :)

[–] Frellwit 2 points 1 year ago (1 children)

Rather than manually adding communities, could it be made to fetch active/hot communities from for example: https://lemmy.world/api/v3/community/list?sort=Active ?

[–] 0485919158191 1 points 1 year ago

It could! It’s not hard to implement. Not sure if people want it. Could make it as a separate script.

[–] [email protected] 2 points 1 year ago (1 children)

Interesting. Somebody in another thread was asking about a sidebar with links to their subscriptions and this gives me an idea...

[–] 0485919158191 3 points 1 year ago

I saw that too. I was gonna do it but then my kid woke up. I managed to whip this together in a few minutes. Might get back to that sub sidebar though.

[–] miked 2 points 1 year ago (1 children)
[–] 0485919158191 2 points 1 year ago

You’re welcome!

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I like the addition of the font.Weight. I changed mine to "300" so it's just slightly lighter than normal. "400" is normal (so same as ""), "100" is the lightest, and "900" is the boldest. "700" is the same as "bold".

[–] 0485919158191 1 points 1 year ago

Yeah that makes sense! :D

[–] miked 2 points 1 year ago (1 children)

I have Firefox set to the dark theme. Is there a way to have the colors similar to the theme?

[–] 0485919158191 2 points 1 year ago (1 children)

Yes!

In the code you can change the navbar.style.backgroundcolor to which ever hex color you have as your background.

Then change the style.color hex value as well to white or what ever text color you want.

[–] miked 2 points 1 year ago* (last edited 1 year ago) (1 children)
[–] 0485919158191 1 points 1 year ago
load more comments
view more: next ›