{"id":15108,"date":"2026-07-16T10:43:34","date_gmt":"2026-07-16T09:43:34","guid":{"rendered":"https:\/\/www.keris-studio.fr\/blog\/?p=15108"},"modified":"2026-07-27T13:20:56","modified_gmt":"2026-07-27T12:20:56","slug":"surreal-prompt-generator","status":"publish","type":"post","link":"https:\/\/www.keris-studio.fr\/blog\/?p=15108","title":{"rendered":"Surreal Prompt Generator"},"content":{"rendered":"<style>\n  :root {\n    --bg: #0f172a;\n    --surface: #1e293b;\n    --surface-hover: #334155;\n    --border: #334155;\n    --text-primary: #f1f5f9;\n    --text-secondary: #94a3b8;\n    --text-tertiary: #64748b;\n    --accent: #6366f1;\n    --accent-hover: #4f46e5;\n  }\n  * { box-sizing: border-box; }\n  body {\n    margin: 0;\n    padding: 24px;\n    font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n    background: var(--bg);\n    color: var(--text-primary);\n    min-height: 100vh;\n    display: flex;\n    justify-content: center;\n    align-items: flex-start;\n  }\n  .container {\n    width: 100%;\n    max-width: 600px;\n    padding: 32px;\n    background: var(--surface);\n    border-radius: 16px;\n    border: 1px solid var(--border);\n    box-shadow: 0 20px 60px rgba(0,0,0,0.4);\n  }\n  h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 8px 0; }\n  .subtitle { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.95rem; }\n  label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }\n  textarea {\n    width: 100%; padding: 14px; border-radius: 10px;\n    border: 1px solid var(--border); background: var(--bg); color: var(--text-primary);\n    font-size: 1rem; resize: vertical; font-family: inherit;\n  }\n  textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }\n  .sliders { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; }\n  .slider-group { flex: 1; min-width: 160px; }\n  .slider-group label { color: var(--text-secondary); font-size: 0.8rem; }\n  input[type=\"range\"] { width: 100%; accent-color: var(--accent); cursor: pointer; }\n  .slider-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-tertiary); margin-top: 2px; }\n  .checkbox-row { margin-bottom: 20px; }\n  .checkbox-row label { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; font-weight: 500; }\n  input[type=\"checkbox\"] { accent-color: var(--accent); width: 18px; height: 18px; cursor: pointer; }\n  button#generateBtn {\n    width: 100%; padding: 14px; background: var(--accent); color: white;\n    border: none; border-radius: 10px; font-weight: 600; font-size: 1.05rem;\n    cursor: pointer; transition: background 0.2s, transform 0.1s;\n  }\n  button#generateBtn:hover { background: var(--accent-hover); }\n  button#generateBtn:active { transform: scale(0.98); }\n  .output-area { margin-top: 24px; display: none; }\n  .output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }\n  .output-header label { font-size: 0.9rem; margin: 0; }\n  button#copyBtn {\n    padding: 6px 14px; border: 1px solid var(--border); background: var(--bg);\n    border-radius: 8px; font-size: 0.8rem; color: var(--text-secondary);\n    cursor: pointer; transition: all 0.2s;\n  }\n  button#copyBtn:hover { background: var(--surface-hover); color: var(--text-primary); }\n  #resultText {\n    padding: 18px; background: var(--bg); border: 1px solid var(--border);\n    border-radius: 10px; font-size: 1.05rem; line-height: 1.7;\n    color: var(--text-primary); min-height: 70px; word-wrap: break-word;\n  }\n  .history-area { margin-top: 28px; display: none; }\n  .history-area label { margin-bottom: 10px; }\n  .history-item {\n    padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);\n    border-radius: 8px; font-size: 0.92rem; color: var(--text-primary);\n    cursor: pointer; transition: background 0.15s; margin-bottom: 8px;\n    word-wrap: break-word;\n  }\n  .history-item:hover { background: var(--surface-hover); }\n  .history-item:first-child { border-left: 3px solid var(--accent); }\n  .footer { margin-top: 24px; text-align: center; font-size: 0.75rem; color: var(--text-tertiary); }\n<\/style>\n<p><\/head><br \/>\n<body><\/p>\n<div class=\"container\">\n<h1>&#x1f300; Surreal Prompt Generator<\/h1>\n<p class=\"subtitle\">Enter a base text. We&rsquo;ll scramble it and swap random words for surreal alternatives.<\/p>\n<div>\n    <label for=\"baseText\">Base Text<\/label><br \/>\n    <textarea id=\"baseText\" rows=\"4\" placeholder=\"e.g. A cat sitting on a chair in a sunny room\"><\/textarea>\n  <\/div>\n<div class=\"sliders\">\n<div class=\"slider-group\">\n      <label for=\"scrambleSlider\">Scramble Intensity<\/label><br \/>\n      <input type=\"range\" id=\"scrambleSlider\" min=\"0\" max=\"100\" value=\"30\"><\/p>\n<div class=\"slider-labels\"><span>None<\/span><span>Chaos<\/span><\/div>\n<\/p><\/div>\n<div class=\"slider-group\">\n      <label for=\"swapSlider\">Word Swap Chance<\/label><br \/>\n      <input type=\"range\" id=\"swapSlider\" min=\"0\" max=\"100\" value=\"40\"><\/p>\n<div class=\"slider-labels\"><span>None<\/span><span>Max<\/span><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"checkbox-row\">\n    <label><input type=\"checkbox\" id=\"keepStructure\" checked> Keep sentence structure (don&rsquo;t scramble word order)<\/label>\n  <\/div>\n<p>  <button id=\"generateBtn\">&#x2728; Generate Surreal Prompt<\/button><\/p>\n<div class=\"output-area\" id=\"outputArea\">\n<div class=\"output-header\">\n      <label>Result<\/label><br \/>\n      <button id=\"copyBtn\">&#x1f4cb; Copy<\/button>\n    <\/div>\n<div id=\"resultText\"><\/div>\n<\/p><\/div>\n<div class=\"history-area\" id=\"historyArea\">\n    <label>History<\/label><\/p>\n<div id=\"historyList\"><\/div>\n<\/p><\/div>\n<div class=\"footer\">Surreal Prompt Generator \u2014 runs entirely in your browser<\/div>\n<\/div>\n<p><script>\n(function() {\n  const surrealWords = {\n    nouns: ['octopus','telescope','melancholy','crystal','whisper','clockwork','jellyfish','mirage','labyrinth','nebula','pomegranate','silhouette','vortex','echo','marble','lantern','cascade','phantom','symphony','glacier','carnival','moss','satellite','tide','origami','volcano','harpsichord','constellation','moth','prism','umbrella','cinnamon','avalanche','butterfly','fossil','lighthouse','quicksand','riddle','saffron','tornado','willow','zenith','alchemy','bazaar','chimera','dandelion','enigma','fable','gossamer','horizon'],\n    verbs: ['dissolve','melt','shatter','bloom','whisper','drift','ignite','unravel','levitate','echo','vibrate','transform','crystallize','spiral','dissipate','shimmer','tremble','luminize','fracture','oscillate','materialize','evaporate','resonate','fragment','illuminate','distort','multiply','invert','suspend','radiate'],\n    adjectives: ['iridescent','luminous','ethereal','fractured','velvet','infinite','liquid','silent','golden','crystalline','twisted','ancient','electric','delicate','vast','shattered','dreamlike','invisible','burning','frozen','whispering','tangled','spectral','molten','drifting','haunted','prismatic','suspended','radiant','phantom'],\n    places: ['attic','ocean floor','clock tower','desert','greenhouse','library','observatory','cave','ballroom','rooftop','forest','cathedral','laboratory','garden','station','ruins','harbor','meadow','tundra','oasis','marketplace','cellar','bridge','island','temple','workshop','courtyard','archive','sanctuary']\n  };\n  const allSurrealWords = [...surrealWords.nouns, ...surrealWords.verbs, ...surrealWords.adjectives, ...surrealWords.places];<\/p>\n<p>  function getReplacement(word) {\n    const w = word.toLowerCase();\n    let pool = surrealWords.nouns;\n    if (surrealWords.verbs.includes(w)) pool = surrealWords.verbs;\n    else if (surrealWords.adjectives.includes(w)) pool = surrealWords.adjectives;\n    else if (surrealWords.places.includes(w)) pool = surrealWords.places;\n    let r;\n    do { r = pool[Math.floor(Math.random() * pool.length)]; } while (r.toLowerCase() === w);\n    return r;\n  }<\/p>\n<p>  function scrambleWord(word, intensity) {\n    if (word.length <= 3 || intensity === 0) return word;\n    const chars = word.split('');\n    const swaps = Math.max(1, Math.floor((chars.length - 2) * (intensity \/ 100) * 0.6));\n    for (let i = 0; i < swaps; i++) {\n      const idx1 = Math.floor(Math.random() * (chars.length - 2)) + 1;\n      const idx2 = Math.floor(Math.random() * (chars.length - 2)) + 1;\n      [chars[idx1], chars[idx2]] = [chars[idx2], chars[idx1]];\n    }\n    return chars.join('');\n  }\n\n  function generate() {\n    const baseText = document.getElementById('baseText').value.trim();\n    if (!baseText) return;\n    const scrambleIntensity = parseInt(document.getElementById('scrambleSlider').value);\n    const swapChance = parseInt(document.getElementById('swapSlider').value);\n    const keepStructure = document.getElementById('keepStructure').checked;\n\n    let words = baseText.split(\/(\\s+)\/);\n    let resultWords = [];\n    for (let i = 0; i < words.length; i++) {\n      let word = words[i];\n      if (\/^\\s+$\/.test(word)) { resultWords.push(word); continue; }\n      const clean = word.replace(\/[^a-zA-Z]\/g, '');\n      if (!clean) { resultWords.push(word); continue; }\n\n      const doSwap = Math.random() * 100 < swapChance;\n      const doScramble = Math.random() * 100 < scrambleIntensity;\n      let processed = word;\n\n      if (doSwap &#038;&#038; clean.length > 2) {\n        const replacement = getReplacement(clean);\n        const prefix = word.match(\/^[^a-zA-Z]*\/)?.[0] || '';\n        const suffix = word.match(\/[^a-zA-Z]*$\/)?.[0] || '';\n        const cap = clean[0] === clean[0].toUpperCase();\n        processed = prefix + (cap ? replacement[0].toUpperCase() + replacement.slice(1) : replacement) + suffix;\n      } else if (doScramble) {\n        const prefix = word.match(\/^[^a-zA-Z]*\/)?.[0] || '';\n        const suffix = word.match(\/[^a-zA-Z]*$\/)?.[0] || '';\n        const core = clean;\n        const cap = core[0] === core[0].toUpperCase();\n        const scrambled = scrambleWord(core.toLowerCase(), scrambleIntensity);\n        processed = prefix + (cap ? scrambled[0].toUpperCase() + scrambled.slice(1) : scrambled) + suffix;\n      }\n      resultWords.push(processed);\n    }<\/p>\n<p>    let result = resultWords.join('');\n    if (!keepStructure) {\n      const tokens = result.split(\/\\s+\/).filter(w => w.length > 0);\n      for (let i = tokens.length - 1; i > 0; i--) {\n        if (Math.random() < 0.15) { const j = Math.floor(Math.random() * (i + 1)); [tokens[i], tokens[j]] = [tokens[j], tokens[i]]; }\n      }\n      result = tokens.join(' ');\n    }\n\n    document.getElementById('resultText').textContent = result;\n    document.getElementById('outputArea').style.display = 'block';\n\n    const historyList = document.getElementById('historyList');\n    document.getElementById('historyArea').style.display = 'block';\n    const item = document.createElement('div');\n    item.className = 'history-item';\n    item.textContent = result;\n    item.onclick = () => { document.getElementById('baseText').value = result; };\n    historyList.insertBefore(item, historyList.firstChild);\n    if (historyList.children.length > 10) historyList.removeChild(historyList.lastChild);\n  }<\/p>\n<p>  document.getElementById('generateBtn').addEventListener('click', generate);\n  document.getElementById('copyBtn').addEventListener('click', function() {\n    const text = document.getElementById('resultText').textContent;\n    navigator.clipboard.writeText(text).then(() => {\n      this.textContent = '&#x2705; Copied!';\n      setTimeout(() => this.textContent = '&#x1f4cb; Copy', 1500);\n    });\n  });\n  document.getElementById('baseText').addEventListener('keydown', function(e) {\n    if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) generate();\n  });\n})();\n<\/script><br \/>\n<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f300; Surreal Prompt Generator Enter a base text. We&rsquo;ll scramble it and swap random words for surreal alternatives. Base Text Scramble Intensity NoneChaos Word Swap Chance NoneMax Keep sentence structure (don&rsquo;t scramble word order) &#x2728; Generate Surreal Prompt Result &#x1f4cb; Copy History Surreal Prompt Generator \u2014 runs entirely in your browser<\/p>\n","protected":false},"author":2,"featured_media":15233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[593],"tags":[546],"class_list":["post-15108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial","tag-artificial-intelligence"],"_links":{"self":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15108"}],"version-history":[{"count":1,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15108\/revisions"}],"predecessor-version":[{"id":15109,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15108\/revisions\/15109"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/media\/15233"}],"wp:attachment":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}