perchance

@perchance@lemmy.world

This profile is from a federated server and may be incomplete. Browse more on the original instance.

`color:light-dark(blue,lightblue)` is now available in all modern browsers - switch text/background/etc. colors automatically depending on whether the user's device is in light mode or dark mode

It basically allows you to specify to different colors - one for if the user’s device is in light mode, and the other if they’re in dark mode. Here’s an example gen showing how to use it:...

perchance, (edited )

Here’s a simple example: perchance.org/drop-down-list-example#edit

(For future reference, there are actually a lot of example generators built and so if you type “drop down selector to choose list perchance” into google, the above link is the first result :) Also, if you wouldn’t mind, please edit your post’s title to be a summary of your question - that way it’s more easily findable via Google, which helps others who happen to type their question in a similar way that you summarized it, and so reduces the need for people on this forum to answer lots of duplicate questions. Thanks!)

Also, as a bonus: Here’s an example where multiple drop-downs are used to select a list + sub-list/item: perchance.org/multiple-drop-down-lists-example#ed…

perchance,

No problem! Btw, it looks like you edited your post’s content instead of the post’s title. Your post’s content was already fine :)

perchance, (edited )

Thank you! Should be fixed now. Sorry about that - accidentally introduced that bug when fixing the null subdomain query params issue that you reported. I was adding “?” to end of the redirect URL even when there weren’t any query params, which messed with the Cloudflare cache clearing code.

Don’t know where we’d be without all your excellent bug reports 🙏

perchance,

Hmm, yeah this has been asked for before, and the reason I haven’t done it yet is because it would make it easier for people to impersonate others. I.e. set their nickname to the same, and set their color to the same, and then rely on people not noticing that the letters are different. This might not trick many people, but it would make it more annoying since there’s a lower chance of at-a-glance check being correct.

Ideally I’d replace the letters with a dingbat font or something so there’s more visual distinction between the tags. Also now that usernames are a thing, this potentially makes the impersonation issue less relevant. I’m still a bit indecisive on this one though…

perchance, (edited )

There is a reason! But it’s a silly one, so discovering it wouldn’t be very satisfying ^^’

perchance, (edited )

Fair point! I think I can fix this (using MutationObserver), but it’ll need to be opt-in (e.g. via an extra keyword like @includeProgrammaticInputs or something [but ideally shorter…]), since it’s a “breaking change”. But before I do: Another flaw is that you can’t choose to only remember specific inputs, right? My memory is a little fuzzy and I can’t see anything about that on the page or in the code. If so, I’ll try fixing both issues at once.

perchance,

Ah good point. I think for this what I’d ideally need is a global ‘onUpdate’ function so plugins can ‘do something’ when the update function is called (as happens with the auto-reload checkbox thing). There are hacky ways to do this (effectively “wrapping” the update function), but it might be about time for a proper solution.

perchance, (edited )

Thanks for this! I was just looking into it, and I noticed this comment at the bottom of the code in create-instance-plugin:


<span style="font-style:italic;color:#969896;">// Important counter-intuitive thing to take note of: https://www.reddit.com/r/perchance/comments/nh31xq/the_best_hack_for_methods_in_list_instances/gz0rebt
</span><span style="font-style:italic;color:#969896;">// the "deep" option of the createInstance plugin is kinda messed up. I should warn people that the [child] list should ONLY have properties - no sub-lists. That basically solves everything, but it's a bit annoying in many cases. Ideally I'd have only called selectOne on a list if it has no properties (i.e. with equals sign). If it has properties it should be treated just as part of the hierarchical blueprint, and those sub-items should get fixed, rather than having selectOne called on it.
</span><span style="font-style:italic;color:#969896;">// I basically need a new plugin. createInstance2 = {import:create-instance-2-plugin}
</span><span style="font-style:italic;color:#969896;">// That's the ideal solution here.
</span><span style="font-style:italic;color:#969896;">// https://perchance.org/hiad2okk9w
</span>

Which, IIUC, is exactly what you’re talking about here.

So I was reluctant to make that change back then due to potentially breaking peoples’ generators. With the number of generators that use this, it’s possible that people are “using” this ~bug. On the other hand, it is hard to see why someone would use “deep”, and not want the deep properties fixed. It does seem like the current behavior would be causing more pain to people trying to use it right now than the pain caused by breaking old generators that actually wanted random sub-sub-properties even though they used the “deep” mode.

I.e. seems like the generator would already have to be “buggy” for this change to cause any issues. Hmm. Yeah, on balance this does seem like it should be categorized as a bug, and fixed. The lower-level lists should be treated just like the upper-level lists - intuitively, that’s exactly what is meant by “deep”. Thoughts?

perchance, (edited )

Hmm. Thinking about this more, I’m really reluctant to do this in case it breaks old generators - even though it’s hard to imagine someone relying on this ‘bug’ on purpose. So what I might do instead is expose a new window.generatorLastEditTime variable (like window.generatorName and window.generatorPublicId), and only enable the new behavior if the last save time of the generator is newer than today. So if people are still actively working on their generator now then they’ll get the new behavior, and if it does break something they’ll be able to notice and fix it. But for old generators, they get to keep the old behavior until the author comes back to it and makes an edit.

I think that strikes a good balance here. What do you think?

perchance, (edited )

Hmm, I think I misunderstood some stuff with my earlier comments. With the caveat that this is frying my brain a little, I think there are cases that this change would break - e.g. perchance.org/bm1vp6py5a#edit Try swapping the plugin import to see the behavior change.

If it turns out it isn’t really possible to fix this issue, then it may be time for me to make a new plugin which fixes this issue and some others, and perhaps introduces some handy features that people tend to need. Let me know if you have any requests in that department - e.g. everything gets fixed by default, but if a property name begins with * (or something), like *foo, then character.foo would be a random property, instead of being fixed/resolved. And another thing I think is to call evaluateItem after selectOne if the selected item has no children. Not sure though - would definitely need feedback on this from people who use the plugin extensively.

Another alternative is to just add an extra “mode” to create-instance-plugin (like the existing “deep” one), which fixes all the issues and makes everything intuitive, but that might make it a bit more complicated and cumbersome, since the behavior would vary so much, which could be confusing to newbies.

perchance,

Thanks for reporting this issue! It’s working fine for me in Chrome, so it might be related to a Chrome extension that you have, or some other issue specific to your machine. If you click your profile pic in chrome in the top-right, and then click “Guest” it’ll open up a browser window without any Chrome extensions enabled. See if it works in that window.

Also, in normal browsing mode (i.e. not Guest), can you please press Ctrl+Shift+J while on that page, and see if there are any red messages in the console that appear after a few seconds? Please screenshot if possible.

perchance,

Can you share what fixed it? This will help me to prevent future instances for you and other users. Or did it just randomly start working again?

Super Fetch Plugin does not work with `user-uploads.perchance.org`

So, after a bit of testing with the example from the super-fetch-plugin, I’ve tried different kinds of websites and it worked, including a URL from comments-plugin.perchance.org, which I got from inspecting a comments plugin iframe from the DevTools. But in this case, not from user-uploads.perchance.org, it kept having the...

perchance,

Sorry about that - this has randomly happened to me a few weeks ago too. I think an erroneous response is getting cached in the browser sometimes. I’ve added a fix so this won’t happen with super-fetch-plugin. Previously perchance upload URLs were skipping the proxy because it’s actually not needed (perchance uploads allow normal fetch from perchance generators), but due to this cached error thing I’ve made it so it falls back to using the proxy if there are any issues with a normal fetch. I’ll hopefully get a chance to look into the root cause soon.

TL;DR: It should work fine now, regardless of the browser caching the rare error responses. Thanks for the bug report! Thought it might have just been something weird with my browser, so I didn’t fix it when I came across it.

cc @VioneT

perchance, (edited )

No, it must be user-uploads.perchance.org URL. I don’t like seeing generators break, due to people using random file hosts that later shut down (or worse, using random links to e.g. pinterest images, fandom/wiki images, etc. which are often only temporary CDN urls), so my plugins in the future will require using perchance URL uploads in most cases.

perchance,

Thanks! Fixed.

perchance,

Okay, I made it so it falls back to the default pattern rather than emptying the pattern in case of broken pattern. Hopefully that’s a better fallback. Thanks!

AI bots in your comments, and more: `c = commentsPlugin(options), c.submit("hello world!")` (perchance.org)

(To be clear, since I realized just now that to non-devs the title might be misleading: This feature does not add AI bots to your comments plugin by default! The comments plugin and the AI plugins are completely distinct. But plugins can of course interact with one another, and this new feature of the comments plugin allows for...

perchance,

Yep, you can do that with: com.setNicknameForNextComment(“blah”) and their next comment will have “blah” as the nickname. I added this a few days ago but didn’t announce it

perchance,

Thanks! Good feature request. I’ve just added comment.autoSent, and it’s true if it was programmatically submitted. Let me know if there are any issues.

perchance,

Can you share screenshot? Not sure what you mean by message bubble buttons

perchance, (edited )

Ohh, specifically the admin “delete” button, you mean? If so, thanks! Fixed. I’ve just placed it properly between the reply and block buttons.

perchance,

Thanks! 🙏 Should be fixed now.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • tacticalgear
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • Durango
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ngwrru68w68
  • kavyap
  • GTA5RPClips
  • provamag3
  • ethstaker
  • InstantRegret
  • Leos
  • normalnudes
  • everett
  • khanakhh
  • osvaldo12
  • cisconetworking
  • modclub
  • anitta
  • tester
  • megavids
  • lostlight
  • All magazines