this post was submitted on 18 Aug 2024
1 points (100.0% liked)

Perchance - Create a Random Text Generator

448 readers
13 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 1 year ago
MODERATORS
 

I'm not too studied-up on CORS, but I know what it's there for. Currently there's a number of things that are not possible to do because our generator is on a different subdomain than other generators or iframes, etc. etc. and even the top-level page we're actually on.

With that allowed (I think CORS can allow this), there's a lot more customisation we can do of things like t2i image iframes and gallery iframes, reading/changing the top-level url, etc. Maybe that's something you don't want to allow, but I for one have wanted to do these things for completely benign legit reasons multiple times.

you are viewing a single comment's thread
view the rest of the comments
[–] wthit56 1 points 2 months ago (1 children)
  1. 👍 :target works too!
  2. 👍 And it updates from using it in the editor without actually booting you out of the editor, which is a nice touch as well!
  3. 👍
  4. 👍 And you can call just "?params" too in the regular method, which works in perchance as well. Maybe you could only allow that. Make sure it only starts with "?" or something. A note about the error it gives you when it's a disallowed path... not being able to see the path it's received is a bit annoying. When I throw, I like to give as much info as I can about the thing I'm throwing about, so they don't have go and start logging things out or breakpointing just to understand the reason it threw. (Wait--generatorName is a thing?! I'll make use of that for one of my private plugins 👍 Should I scour the windows object for such hidden gems??)
  5. 👍 I can also replaceState with "#hash". 👍 And doesn't scroll, though the normal method doesn't scroll so that's okay.
    • The :target doesn't change though, when it does for the normal method.
    • And if you do this from the editor preview, it does add all the params from the preview iframe. Which... is probably okay, fine by me. Presumably those won't show up unless you're in the editor anyway.
    • Worth people noting, clicking a link to #edit does not go to edit mode, neither does setting .hash, or doing it with replaceState. Also fine.
  6. 👍
  7. Gallery buttons setting 👍 I'M SO HAPPY! :D

Test page I used for trying all these out: https://perchance.org/testing-features-19-aug-24-498573958#edit

[–] perchance 1 points 2 months ago (1 children)

:target

What's this?

not being able to see the path it’s received is a bit annoying

Fixed, thanks!

Should I scour the windows object for such hidden gems

Nope, just https://perchance.org/advanced-tutorial - and if you find something that you want to use, but isn't documented there, please let me know

[–] wthit56 1 points 2 months ago

:target is a css pseudo-selector. So you could put a:target { color:red; }, and then links will be red if they have the id of the #hash. Lets you visually change elements when they're the one being linked to.

Ah, admittedly I did sorta skim that doc; I'd read so much stuff that day from everywhere else 😅