this post was submitted on 23 Jul 2025
0 points (50.0% liked)

Perchance - Create a Random Text Generator

977 readers
12 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 2 years ago
MODERATORS
 

yep just like it looks it is a comprehensive perchance text field text all around cosmetics controller, currently it has planned all of these

rawCSS for dynamic applicatios and storing atuff kike custok fonta i plan to add some of those aswell making them pre available upon imoorting this plugin bellow is just the main function call standard $output function plugin all i know is something is wrong with the plugins javascript formating / syntax / that or its brackets. use url attached to this post to go to its pubkic generator import of plugin generator. if i can get this thing working i plan to maintain upgrade and keep these features available to all for free and allow copying and or redefining my plugin. Id just want soke help you know fuxing it. ..

/ Usage: // [txtFx(txt, font, fxType, gradDir, fxDur, strk, strkCol, strkWid, shd3d, shd3dCol, shd3dX, shd3dY, glow, glowAnim, glowDur, glowBlur, glowTrans, glowColSpec, ...cols)] // // Parameters (use null or "" to skip optional parameters and use defaults): // txt: (String) The content of the text. // font: (String, optional CSS font-family name. // // fxType: (String) "none", "gradient", "animatedGradient", "colorCycle", "colorFlash", "randomColorCycle". // gradDir: (String, optional) For gradients. // fxDur: (String, optional) For animated text effects. // // strk: ("O" / "on" / true for on; "I" / "off" / false for off). Stroke enabled. // strkCol: (String, optional) Color of stroke. // strkWid: (String, optional) Width of stroke. // // shd3d: ("O" / "on" / true for on; "I" / "off" / false for off). 3D Shadow enabled. // shd3dCol: (String, optional) Color of 3D shadow. // shd3dX: (String, optional) Horizontal offset. // shd3dY: (String, optional) Vertical offset. // // glow: ("O" / "on" / true for on; "I" / "off" / false for off). Glow enabled. // glowAnim: (String, optional) "colorCycle", "pulsate". // glowDur: (String, optional) Duration of glow animation. // glowBlur: (String, optional) Blur radius. // glowTrans: (String, optional) "fade", "flash". // // glowColSpec: (String/Number) // - "1", "2", "3", "4", "5": Specifies the number of glow colors to read from ...cols. // - A color string (e.g., "red"): Specifies a single, static glow color. // - null or "": Uses default glow colors (white, or 2 colors if animationType is colorCycle). // // ...cols: (Variable) This is where you list your glow colors (if glowColSpec is a number) // followed by your text effect colors.

it even makes use of rawCSS block importation and storing //


CSS Definitions (rawCSS block)


rawCSS

//


Global Helper for Dynamic Style Injection


addDynamicStyle = (cssContent, id) => if(!window._txtFxDynamicStyles) { window._txtFxDynamicStyles = {}; } if(!window._txtFxDynamicStyles[id]){ let styleTag = document.createElement('style'); styleTag.id = id; styleTag.innerHTML = cssContent; document.head.appendChild(styleTag); window._txtFxDynamicStyles[id] = true; }

//


$output Function


$output(txt, font = null, fxType = "none", gradDir = null, fxDur = null, strk = false, strkCol = null, strkWid = null, shd3d = false, shd3dCol = null, shd3dX = null, shd3dY = null, glow = false, glowAnim = null, glowDur = null, glowBlur = null, glowTrans = null, glowColSpec = null, ...cols) => let outputStr = ""; let styleStr = ""; let textShadows = []; let uniqueId = Math.random().toString(36).substring(7);

let isOn = (val) => { return (val === "O" || val === "on" || val === true); };

;; if(fxType == "animatedGradient") { styleStr += background-size: 200% auto; animation: text-effects-gradient-bg-animation ${fxDur || "5s"} linear infinite;; } } else if(fxType == "colorCycle" || fxType == "colorFlash" || fxType == "randomColorCycle") { let textEffectAnimationName = "text-effect-anim-" + uniqueId; let textColorsToUse = (fxType == "randomColorCycle" && effectiveTextColors.length == 0) ? "red, orange, yellow, green, blue, indigo, violet, purple, pink, cyan, magenta, lime".split(", ").shuffle : effectiveTextColors; let textColorsKeyframes = textColorsToUse.map(function(color, index) { let percentage = (index / textColorsToUse.length) * 100; return ${percentage}% { color: ${color}; }; }).join("\n"); textColorsKeyframes += \n100% { color: ${textColorsToUse[0]}; }; let textEffectAnimationCSS = @keyframes ${textEffectAnimationName} { ${textColorsKeyframes} } ; addDynamicStyle(textEffectAnimationCSS, textEffectAnimationName); let timingFunction = (fxType == "colorFlash" ? "steps(1)" : "linear"); styleStr += animation: ${textEffectAnimationName} ${fxDur || "5s"} ${timingFunction} infinite;`; }

if(isOn(strk)) { let finalStrokeColor = strkCol || "black"; let finalStrokeWidth = strkWid || "1px"; styleStr += -webkit-text-stroke: ${finalStrokeWidth} ${finalStrokeColor}; text-stroke: ${finalStrokeWidth} ${finalStrokeColor};; }

if(isOn(shd3d)) { let finalShadow3dColor = shd3dCol || "rgba(0,0,0,0.5)"; let finalShadow3dOffsetX = shd3dX || "1px"; let finalShadow3dOffsetY = shd3dY || "1px"; let shadows = []; for(let i = 1; i <= 5; i++) { shadows.push(${parseFloat(finalShadow3dOffsetX) * i}px ${parseFloat(finalShadow3dOffsetY) * i}px 0 ${finalShadow3dColor}); } textShadows.push(shadows.join(", ")); }

if(isOn(glow)) { let finalGlowColors = parsedGlowColors.length > 0 ? parsedGlowColors : ["rgba(255, 255, 255, 0.7)"]; let numGlowColors = finalGlowColors.length; let baseGlowColor = finalGlowColors[0]; let finalGlowBlur = glowBlur || "5px"; let finalGlowDuration = glowDur || "3s"; let finalGlowAnimationType = glowAnim || (numGlowColors > 1 ? "colorCycle" : "none"); let finalGlowTransitionType = glowTrans || "fade";

if(finalGlowAnimationType == "colorCycle" && numGlowColors > 1) {
  let glowAnimationName = "glow-anim-" + uniqueId;
  let timingFunction = (finalGlowTransitionType == "flash" ? "steps(1)" : "linear");
  let glowColorsKeyframes = finalGlowColors.map(function(color, index) {
    let percentage = (index / finalGlowColors.length) * 100;
    let shadow = `0 0 ${finalGlowBlur} ${color}, 0 0 ${parseFloat(finalGlowBlur) * 1.5}px ${color}`;
    return `${percentage}% { text-shadow: ${shadow}; }`;
  }).join("\n");
  glowColorsKeyframes += `\n100% { text-shadow: 0 0 ${finalGlowBlur} ${finalGlowColors[0]}, 0 0 ${parseFloat(finalGlowColors[0]) * 1.5}px ${finalGlowColors[0]}; }`;
  let glowAnimationCSS = `
    @keyframes ${glowAnimationName} {
      ${glowColorsKeyframes}
    }
  `;
  addDynamicStyle(glowAnimationCSS, glowAnimationName);
  textShadows.push(`animation: ${glowAnimationName} ${finalGlowDuration} ${timingFunction} infinite;`);
} else if(finalGlowAnimationType == "pulsate") {
  let glowAnimationName = "glow-anim-" + uniqueId;
  let minBlur = (parseFloat(finalGlowBlur) / 3) + "px";
  let maxBlur = finalGlowBlur;
  let glowAnimationCSS = `
    @keyframes ${glowAnimationName} {
      0% { text-shadow: 0 0 ${minBlur} ${baseGlowColor}, 0 0 ${parseFloat(minBlur) * 1.5}px ${baseGlowColor}; opacity: 0.7; }
      50% { text-shadow: 0 0 ${maxBlur} ${baseGlowColor}, 0 0 ${parseFloat(maxBlur) * 1.5}px ${baseGlowColor}; opacity: 1; }
      100% { text-shadow: 0 0 ${minBlur} ${baseGlowColor}, 0 0 ${parseFloat(minBlur) * 1.5}px ${baseGlowColor}; opacity: 0.7; }
    }
  `;
  addDynamicStyle(glowAnimationCSS, glowAnimationName);
  textShadows.push(`animation: ${glowAnimationName} ${finalGlowDuration} linear infinite;`);
} else {
  textShadows.push(`0 0 ${finalGlowBlur} ${baseGlowColor}, 0 0 ${parseFloat(finalGlowBlur) * 1.5}px ${baseGlowColor}`);
}

}

if(textShadows.length > 0){ styleStr += text-shadow: ${textShadows.join(", ")};; }

return <span class="text-effects-base" style="${styleStr}">${txt}</span>;

top 1 comments
sorted by: hot top controversial new old

A list of and an update to Stroke Params how you write them and how i will be coding it to handle them which is as simple strings that quickly define a Line Strokes static &or static artifacting, alternatively you can define stroke animation type vs static stroke types. Then you enter the identifying code into the middle of this string , lastly a final entry of 3 lowercase letters defines the shape of your stroke lines.

...Stk... = .../Stroke/... types/.../...&.../.../shapes

Types of animated effects, or solid/artifacting effects, of..Stk.line-Stroke prefixes

non-Animated solid &or line artifacting effects


sldStk...: fbnStk...: sdaStk...: ldaStk...: rdaStk...: dotStk...: crdStk...:


Animated stroke line effects


lodStk...: loiStk...: lijStk...: flcStk...: fdiStk...: fdoStk...: blcStk...: rlcStk...: snaStk...:


Line-Stroke Shapes


...Stkthr: ...Stktop: ...Stkrow: ...Stkund: ...Stkclu: ...Stkclm: ...Stkcln: ...Stkbox: