VioneT

joined 2 years ago
MODERATOR OF
[–] VioneT@lemmy.world 1 points 2 days ago

On how you have your data, you can probably just add a url property for each instance of the source e.g.:

   {
      name: "original",
      label: "Original",
      placeholder: "Click the button below to generate an original quote.",
      data: [
        {
          quote: "Happiness beckons you once you forget you were looking for it.",
          source: "Eleanor Trent, 'Where's Joy?'",
          url: "link here"
        },
        {
          quote: "Memory is just the past asking for a permanent residence permit.",
          source: "Dr. Selim Farouk, 'The Mind's Archive'",
          url: "another link here"
        },
        {
          quote: "No one knows how Sentience is born, but we sure know how to kill it.",
          source: "Dr. Marcus Webb, 'The Philosophy of Consciousness'",
          url: "link here"
        },
        ...

Then you can access it with .url (quoteEntry.url) and set it as the href of the quoteSourceEl.

[–] VioneT@lemmy.world 1 points 3 days ago

The Automatic1111 link should have installation procedures on how to install it (and automatic installations) for your device. Here is for NVidia GPUs: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs

As for the other one, here is the steps on how to install it: https://github.com/Raxephion/Old-Perchance-Revival-WebUI/tree/main?tab=readme-ov-file#-easy-setup-windows---download--run

[–] VioneT@lemmy.world 2 points 3 days ago* (last edited 3 days ago) (2 children)

You need to make the quoteSourceEl to be an <a> tag e.g. <a id="quoteSourceEl" class="source" href="#"></a> , then after you add a href value, it would be a hyperlink.

[–] VioneT@lemmy.world 3 points 6 days ago (1 children)

There should be no problem with linking the defaultCommentOptions on JavaScript, it would be on this part of your code on the HTML:

    ...
    let othersChatDiv = document.createElement('div');
    othersChatDiv.id = 'others-chat-container';
    othersChatDiv.style.display = 'none'; // Hide others chat by default
    
    let mainChatOptions = defaultCommentOptions.createClone;
    mainChatOptions.channel = "qine-main-chat";
    mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
    mainChatOptions.onComment = function (comment) {
      // Handle new comments in Main Chat
      console.log("New comment in Main Chat:", comment);
    }
    let mainChatPlugin = commentsPlugin(mainChatOptions);
    ...

The problem is bannedUsersList is not in the generator, so it gives errors. Removing that from the defaultCommentOptions makes it work.

[–] VioneT@lemmy.world 1 points 6 days ago

Consecutive ~ will do that e.g. ~~Test~~, you can maybe just add a space or reduce the number of ~.

[–] VioneT@lemmy.world 2 points 6 days ago (3 children)

If you want ~ you can just use it as is e.g. ~Testing~ no need for escape.

[–] VioneT@lemmy.world 2 points 6 days ago (3 children)

Best way I would think is use the default comment options that you have on the Perchance lists:

defaultCommentOptions // for comments plugin: https://perchance.org/comments-plugin
  width = 100%
  height = 350
  commentPlaceholderText = Leave friendly comments..
  submitButtonText = submit comment
  bannedUsers = [bannedUsersList]
  customEmojis = {import:huge-emoji-list}
  adminFlair = 👑 Creator
  adminPasswordHash = 4b7a8a671d949baf24756f731091d13018de5c2ab4dd2cc1c1612a6643986933

As the base options like so:

let mainChatOptions = defaultCommentOptions.createClone;
mainChatOptions.channel = "qine-main-chat";
mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
mainChatOptions.onComment = function (comment) {
  // Handle new comments in Main Chat
  console.log("New comment in Main Chat:", comment);
}
let mainChatPlugin = commentsPlugin(mainChatOptions);
[–] VioneT@lemmy.world 1 points 1 week ago (5 children)

Can you link the page you are working with?

[–] VioneT@lemmy.world 2 points 1 week ago (2 children)

Instead of manipulating the iframe src, I just re-instantiated the galleries with updated options: https://perchance.org/gwn80163bc

Used createPerchanceTree to create a new perchance list for the banned prompt phrases.

[–] VioneT@lemmy.world 2 points 1 week ago

So, on your:

<div class="flex">[output]</div>

You need to enclose the [output] in a div for the Update Rows to work since it looks for the number of div on the .flex container like so:

<div class="flex"><div>[output]</div></div>

Also, you changed the start of the 'for loop' on the update rows with let i = numRows - 1 which would mean it can only update one row since the loop terminates if it exceeds the numRows. Just use the let i = 0.

If you want to only update the 'last' row, you can do:

function updateLast() {
  let lastRow = [...document.querySelector(".flex").querySelectorAll('div')].at(-1)
  lastRow.innerHTML = output
}
[–] VioneT@lemmy.world 2 points 1 week ago (2 children)

So, on the .flex container, every time you add the output on the innerHTML, it would essentially re-run the 'evaluation' of the square brackets, which would also update the container - which updates the previous images. Best way is to not alter the InnerHTML by concatenating and use .appendChild instead. Ex:

  function addImageRow() {
    let con = document.createElement('div');
    con.innerHTML = output
    document.querySelector(".flex").appendChild(con);
  }

But since this wouldn't have any square brackets, you cannot use the regular update() function to reload them. Here's a function to update them:

function updateRows() {
    let numRows = document.querySelector(".flex").querySelectorAll('div').length
    document.querySelector(".flex").innerHTML = ''
    for (let i = 0; i < numRows; i++) {
      let con = document.createElement('div');
      con.innerHTML = output
      document.querySelector(".flex").appendChild(con);
    }
  }
 

Link to the Tool

Recently made this typewriter-plugin speed and delay calculator to achieve certain results such as having multiple type happen sequentially (one at a time) and multiple type ending the same time. Feel free to check it out and let me know what you have made with it!

 

Mermaid.js Graph Plugin Link

This is a graph maker using the Mermaid.js Diagramming and Charting Tool which is a diagramming tool that makes graphs based on Markdown like code. Feel free to mess around with it and consult the syntax at their documentation.

The only thing you need to do in Perchance is to escape the Mermaid syntax (since it also uses [ ] heavily) with backslashes \ so Perchance will not execute them as lists.

2
submitted 2 years ago* (last edited 2 years ago) by VioneT@lemmy.world to c/perchance@lemmy.world
 

Just a suggestion for the links in the navbar to be a revamped on mobile since currently the navbar on mobile looks something like this:

In which we cannot access the 'community', 'tutorial', 'hub' or 'generators'. Maybe a dropdown upon clicking the 'perchance' button or a side menu popup. Thanks!

@perchance@lemmy.world

 

Welcome to the Perchance Community!

Perchance.org is a platform for sharing and creating random text generators.

This Lemmy community is for:

  • Asking for help with problems, issues, or requests about generators in Perchance
  • Sharing and showcasing your created generators, templates, plugins, or pages in Perchance
  • Starting friendly discussions about topics related to Perchance
If it is your first time in using Lemmy, please check out this message from Lemmy.World and the Support Page from Lemmy.World to get started on using Lemmy.

Posting from Mastodon

Feel free to checkout this post to know how to post in this Lemmy Community through Mastodon.

Other Community Links

Rules

Here are some rules in this community:

  • Please follow the lemmy.world instance rules.
  • 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 :)
  • Be thankful to those who try to help you.
    • If you ask a question and someone has made an 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 :)
  • Only post about stuff related to perchance.
    • Please only post about perchance related stuff like generators on it, bugs, and the site.
  • 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.

Posting

Here are some optional tags to add in your title to categorize the posts. These are merely tags, you still need to title your post effectively.

  • [Bug] - if you think you find any bug in Perchance, use this tag.
  • [Question] or [Help] - this is to denote that your post is a question or requesting for help
  • [Suggestion] - for any suggestions in Perchance
  • [Feedback] or [Appreciation] - for any feedback or appreciation to any generator or to Perchance in general.
  • [{Generator Category}] - Used to share any generator with the specified category
    • Text, Image, Template, Hub, Plugin, Preprocessor, Community/RP, Game, Experiment, Useful Generator
  • [Fluff] or [Non-Generator] - Non-generator posts but about Perchance
  • [Tutorial] or [Guide] - for any Perchance related tutorials or guides to help others

AI Plugins Posts

Here is a FAQ for the AI tools in Perchance.

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?"

There are guides, tutorials, and resources on the internet that can be applied when prompting in the AI tools in Perchance.

We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

If you need help in prompting, please post on the 'sister' forum at Casual Perchance

Getting Started with Perchance

To get started with Perchance, check out the Perchance Tutorial or the Beginner Tutorial at the Perchance Hub Learn Tab to get to know the website.

Asking for help

Feel free to ask for help but please check out these tips on searching for an answer:

  • Check the following pages, to see if your question has already been answered or talked about or a plugin has been made for it. We recommend using the browser's search function (ctrl+f) and searching for similar keywords to your question/problem.
  • If you didn't find anything about your problem there, feel free to search through the posts/articles here:
  • If you can't still find anything related to your problem, feel free to post a thread here.
    • Please title your post effectively.
    • Please provide a link to your generator with your attempts of solving the problem.
    • Try to explain what you want it to do and what example output it should be doing.
 

EDIT: It is now Fixed!

Please take a look at the following images: Between 855px and 820px the 'save' button disappears on mobile.

But around >855px and <820px the 'save' button appears

@perchance@lemmy.world

2
submitted 2 years ago* (last edited 2 years ago) by VioneT@lemmy.world to c/perchance@lemmy.world
 

Feel free to use the Lemmy Community @ perchance@lemmy.world like Reddit where you can ask for help, share your generators, and start friendly discussions at your leisure :)

view more: next ›