{"id":6800,"date":"2025-10-27T11:18:46","date_gmt":"2025-10-27T11:18:46","guid":{"rendered":"https:\/\/proposte.it\/?page_id=6800"},"modified":"2026-01-30T14:40:23","modified_gmt":"2026-01-30T14:40:23","slug":"proposte-2","status":"publish","type":"page","link":"https:\/\/proposte.it\/en\/","title":{"rendered":"Proposte | Unruly for real"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"6800\" class=\"elementor elementor-6800\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3a3ef93 e-con-full e-flex e-con e-parent\" data-id=\"3a3ef93\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b7c175a elementor-widget elementor-widget-html\" data-id=\"b7c175a\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style>\n  #animCanvas{\n    position:fixed;\n    inset:0;\n    width:100%;\n    height:100%;\n    display:block;\n    background:#000;\n    z-index:9999;\n  }\n<\/style>\n\n<canvas id=\"animCanvas\"><\/canvas>\n\n<script>\ndocument.addEventListener('DOMContentLoaded', () => {\n  \/\/ === CANVAS ===\n  const canvas = document.getElementById(\"animCanvas\");\n  const ctx = canvas.getContext(\"2d\");\n  ctx.globalCompositeOperation = \"source-over\";\n  ctx.globalAlpha = 1.0;\n\n  \/\/ === STATE ===\n  let w = 0, h = 0, layoutCache = null;\n  let particles = [];\n  let phase = \"scatter\";\n  let frame = 0, globalTime = 0;\n  let edgeNoiseProgress = 0;\n\tlet menuShown = false;\nconst menuEl = document.getElementById('menuHP');\nfunction showMenuHP(){\n  if (!menuShown && menuEl){\n    menuShown = true;\n    menuEl.classList.add('show');\n  }\n}\n\n\n  \/\/ === COLORS (come tua base) ===\n  const COLOR_VARIANTS = [\"#b50610\",\"#c90611\",\"#e30712\",\"#f10b18\",\"#ff1a24\",\"#be2a32\"];\n\n  \/\/ === PARAMETRI ANIMAZIONE (come i tuoi) ===\n  const TARGET_PARTICLES = 62000;\n  const FORCE_MULT   = 0.8;\n  const MAX_STEP     = 16;\n  const CLOSE_ENOUGH = 1.5;\n\n  \/\/ === BORDO \u201cVIVO\u201d (ampio + fluido) ===\n  const NOISE_START_DIST = 35;  \/\/ inizia frastagliatura gi\u00e0 vicino ma non a target\n  const EDGE_MARGIN      = 150; \/\/ profondit\u00e0 bordo vivo (ampio)\n  const EDGE_INTENSITY   = 2.5; \/\/ ampiezza movimento ai bordi\n  const NOISE_SPEED      = 0.05;\/\/ velocit\u00e0 oscillazione bordo\n\n  \/\/ === LOCK per evitare rimbalzo e stoppare prima del perfetto allineamento ===\n  const LOCK_DIST = 10; \/\/ blocca particelle ~10px prima del target per evitare frame \u201cperfetto\u201d\n\n  function resize(){\n    w = canvas.width = window.innerWidth;\n    h = canvas.height = window.innerHeight;\n    layoutCache = null;\n  }\n  resize();\n  window.addEventListener(\"resize\", resize);\n\n  function getLogoLayout(){\n    if (layoutCache) return layoutCache;\n    const totalHeight = h * 0.7;   \/\/ ~70vh\n    const gapRatio    = 0.3;       \/\/ 30% del totale \u00e8 gap\n    const gap         = totalHeight * gapRatio;\n    const squareSize  = (totalHeight - gap) \/ 2;\n\n    const topStartY    = (h \/ 2) - (totalHeight \/ 2);\n    const bottomStartY = topStartY + squareSize + gap;\n    const startX       = (w \/ 2) - (squareSize \/ 2);\n\n    layoutCache = { squareSize, gap, startX, topStartY, bottomStartY };\n    return layoutCache;\n  }\n\n  \/\/ Helpers colore (per la pulsazione iniziale che avevi gi\u00e0)\n  function hexToRGB(hex){ const v=hex.replace(\"#\",\"\"); return {r:parseInt(v.slice(0,2),16), g:parseInt(v.slice(2,4),16), b:parseInt(v.slice(4,6),16)}; }\n  function clamp(v,min,max){ return v<min?min:(v>max?max:v); }\n  function modulateColor(hex, amt){\n    const {r,g,b}=hexToRGB(hex);\n    return `rgb(${clamp(Math.round(r+r*amt),0,255)},${clamp(Math.round(g+g*amt),0,255)},${clamp(Math.round(b+b*amt),0,255)})`;\n  }\n  function getPulsedColor(p){\n    const osc = Math.sin(globalTime * 0.09 + p.pulseOffset);\n    const amt = osc * 0.35;\n    return modulateColor(p.baseColor, amt);\n  }\n\n  \/\/ === Particelle iniziali ===\n  function initParticlesScatter(){\n    particles = [];\n    const spawnMinX = -w * 0.5, spawnMaxX =  w * 1.5;\n    const spawnMinY = -h * 0.5, spawnMaxY =  h * 1.5;\n    for(let i=0;i<TARGET_PARTICLES;i++){\n      particles.push({\n        x:  spawnMinX + Math.random()*(spawnMaxX - spawnMinX),\n        y:  spawnMinY + Math.random()*(spawnMaxY - spawnMinY),\n        vx: (Math.random()-0.5)*0.5,\n        vy: (Math.random()-0.5)*0.5,\n        size: 2,\n        baseColor: COLOR_VARIANTS[Math.floor(Math.random()*COLOR_VARIANTS.length)],\n        pulseOffset: Math.random()*Math.PI*2,\n        tx: null, ty: null,\n        \/\/ lock & bordo\n        locked:false,  \/\/ quando true smette di essere attratta\n        ax:0, ay:0,    \/\/ anchor = target \u201ccongelato\u201d\n        isEdge:false   \/\/ appartiene alla fascia bordo?\n      });\n    }\n  }\n\n  \/\/ === Target nei due quadrati ===\n  function assignTargetsForLogo(){\n    const { squareSize, startX, topStartY, bottomStartY } = getLogoLayout();\n    const pxStep = 2;\n    const targets = [];\n    for (let y = 0; y < squareSize; y += pxStep){\n      for (let x = 0; x < squareSize; x += pxStep){\n        targets.push({ tx: startX + x, ty: topStartY + y });\n        targets.push({ tx: startX + x, ty: bottomStartY + y });\n      }\n    }\n    \/\/ shuffle per traiettorie organiche\n    for (let i = targets.length - 1; i > 0; i--){\n      const j = Math.floor(Math.random()*(i+1));\n      [targets[i],targets[j]] = [targets[j],targets[i]];\n    }\n    const tLen = targets.length;\n    for (let i=0; i<particles.length; i++){\n      const t = targets[i % tLen];\n      particles[i].tx = t.tx; particles[i].ty = t.ty;\n    }\n  }\n\n  \/\/ === Attrazione verso target con lock a ~10px (no rimbalzo) ===\n  function pullParticlesTowardTargets(){\n    let maxRemainingDist = 0;\n    const { squareSize, startX, topStartY, bottomStartY } = getLogoLayout();\n\n    for (let p of particles){\n      if (p.locked) continue;\n\n      const dx = p.tx - p.x;\n      const dy = p.ty - p.y;\n      const dist = Math.sqrt(dx*dx + dy*dy) || 1;\n\n      \/\/ lock poco prima del target per evitare frame perfetto & rimbalzo\n      if (dist < LOCK_DIST){\n        p.locked = true;\n        p.ax = p.tx; p.ay = p.ty;\n\n        \/\/ marca se \u00e8 in fascia bordo\n        const inTop   = p.ty < (topStartY + squareSize);\n        const sqY     = inTop ? topStartY : bottomStartY;\n        const dxE     = Math.min(p.tx - startX, (startX + squareSize) - p.tx);\n        const dyE     = Math.min(p.ty - sqY,    (sqY + squareSize) - p.ty);\n        p.isKeyEdge   = (dxE < EDGE_MARGIN || dyE < EDGE_MARGIN);\n\n        if (dist > maxRemainingDist) maxRemainingDist = dist;\n        continue;\n      }\n\n      const force = FORCE_MULT * (dist\/25);\n      const step  = Math.min(force, MAX_STEP);\n      p.x += dx \/ dist * step;\n      p.y += dy \/ dist * step;\n\n      if (dist > maxRemainingDist) maxRemainingDist = dist;\n    }\n    return maxRemainingDist;\n  }\n\n  \/\/ === Rumore sui bordi: in gather \u201cblend\u201d, in logoHold pieno ===\n  function applyEdgeNoise(progress, blend){\n    for (let p of particles){\n      if (!p.locked){\n        \/\/ non disturbare chi sta ancora arrivando, per evitare rimbalzi\n        continue;\n      }\n      if (!p.isKeyEdge){\n        \/\/ centro stabile: resta sull\u2019anchor\n        p.x = p.ax; p.y = p.ay;\n        continue;\n      }\n\n      const t  = globalTime * NOISE_SPEED + p.pulseOffset;\n      const nx = (Math.sin(t*3.17) + Math.cos(t*2.23)) * 0.5;\n      const ny = (Math.sin(t*2.71) - Math.cos(t*1.87)) * 0.5;\n\n      const targetX = p.ax + nx * EDGE_INTENSITY * progress * 3;\n      const targetY = p.ay + ny * EDGE_INTENSITY * progress * 3;\n\n      if (blend){\n        const k = 0.5 * progress; \/\/ fusione dolce in gather\n        p.x = p.x * (1 - k) + targetX * k;\n        p.y = p.y * (1 - k) + targetY * k;\n      } else {\n        p.x = targetX; p.y = targetY;\n      }\n    }\n  }\n\n  \/\/ === Fasi ===\n  function updateScatter(){\n    assignTargetsForLogo();\n    phase = \"gather\";\n    frame = 0;\n  }\n\nfunction updateGather(){\n  const maxDist = pullParticlesTowardTargets();\n\n  \/\/ calcola percentuale lockata per capire \u201cquanto manca\u201d\n  let lockedCount = 0;\n  for (let p of particles) if (p.locked) lockedCount++;\n  const lockedRatio = lockedCount \/ particles.length;\n\n  \/\/ attiva bordi vivi gi\u00e0 in gather (nessun frame perfettamente allineato)\n  if (maxDist < NOISE_START_DIST || lockedRatio > 0.2){\n    edgeNoiseProgress = Math.min(edgeNoiseProgress + 0.10, 1);\n    applyEdgeNoise(edgeNoiseProgress, true);\n  }\n\n  \/\/ \u2b05\ufe0f TRIGGER MENU: compari \u201cpoco prima\u201d che i quadrati siano definiti\n  if (!menuShown && (lockedRatio > 0.7 || (maxDist < 8 && edgeNoiseProgress > 0.2))){\n    showMenuHP(); \/\/ aggiunge .show con transizione\n  }\n\n  \/\/ passa a logoHold quando \u00e8 tutto praticamente chiuso\n  if (lockedRatio > 0.985 || maxDist < 2){\n    phase = \"logoHold\";\n  }\n}\n\n\n  function updateLogoHold(){\n    \/\/ continua ad aumentare dolcemente l\u2019ampiezza (se non \u00e8 gi\u00e0 piena)\n    edgeNoiseProgress = Math.min(edgeNoiseProgress + 0.02, 1);\n    const blend = edgeNoiseProgress < 1;\n    applyEdgeNoise(edgeNoiseProgress, blend);\n  }\n\n  \/\/ === Draw ===\n  function drawScene(){\n    globalTime += 1;\n    ctx.clearRect(0,0,w,h);\n    ctx.fillStyle = \"#000\";\n    ctx.fillRect(0,0,w,h);\n\n    for (let p of particles){\n      ctx.fillStyle = getPulsedColor(p);\n      const r = p.size * 0.7;\n      ctx.beginPath();\n      ctx.arc(p.x, p.y, r, 0, Math.PI*2);\n      ctx.fill();\n    }\n  }\n\n  \/\/ === Loop ===\n  function animate(){\n    frame++;\n    if (phase === \"scatter\"){ updateScatter(); }\n    else if (phase === \"gather\"){ updateGather(); }\n    else if (phase === \"logoHold\"){ updateLogoHold(); }\n\n    drawScene();\n    requestAnimationFrame(animate);\n  }\n\n  \/\/ === Start (piccolo delay per blocchi WP) ===\n  setTimeout(() => {\n    resize();\n    initParticlesScatter();\n    drawScene();\n    animate();\n  }, 50);\n});\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-5beeb67 e-con-full e-flex e-con e-parent\" data-id=\"5beeb67\" data-element_type=\"container\" data-settings=\"{&quot;position&quot;:&quot;fixed&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b52a746 elementor-nav-menu__align-center elementor-nav-menu--dropdown-none elementor-widget__width-inherit elementor-widget elementor-widget-nav-menu\" data-id=\"b52a746\" data-element_type=\"widget\" id=\"menuHP\" data-settings=\"{&quot;layout&quot;:&quot;horizontal&quot;,&quot;submenu_icon&quot;:{&quot;value&quot;:&quot;&lt;i class=\\&quot;fas fa-caret-down\\&quot; aria-hidden=\\&quot;true\\&quot;&gt;&lt;\\\/i&gt;&quot;,&quot;library&quot;:&quot;fa-solid&quot;}}\" data-widget_type=\"nav-menu.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<nav aria-label=\"Menu\" class=\"elementor-nav-menu--main elementor-nav-menu__container elementor-nav-menu--layout-horizontal e--pointer-underline e--animation-drop-in\">\n\t\t\t\t<ul id=\"menu-1-b52a746\" class=\"elementor-nav-menu\"><li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8908\"><a href=\"https:\/\/proposte.it\/en\/brand-slam\/\" class=\"elementor-item\">brand slam<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7253\"><a href=\"https:\/\/proposte.it\/en\/chi-siamo-2\/\" class=\"elementor-item\">chi siamo<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8907\"><a href=\"https:\/\/proposte.it\/en\/cosa-facciamo\/\" class=\"elementor-item\">cosa facciamo<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-9912\"><a href=\"https:\/\/proposte.it\/en\/contatti\/\" class=\"elementor-item\">contatti<\/a><\/li>\n<\/ul>\t\t\t<\/nav>\n\t\t\t\t\t\t<nav class=\"elementor-nav-menu--dropdown elementor-nav-menu__container\" aria-hidden=\"true\">\n\t\t\t\t<ul id=\"menu-2-b52a746\" class=\"elementor-nav-menu\"><li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8908\"><a href=\"https:\/\/proposte.it\/en\/brand-slam\/\" class=\"elementor-item\" tabindex=\"-1\">brand slam<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7253\"><a href=\"https:\/\/proposte.it\/en\/chi-siamo-2\/\" class=\"elementor-item\" tabindex=\"-1\">chi siamo<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8907\"><a href=\"https:\/\/proposte.it\/en\/cosa-facciamo\/\" class=\"elementor-item\" tabindex=\"-1\">cosa facciamo<\/a><\/li>\n<li class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-9912\"><a href=\"https:\/\/proposte.it\/en\/contatti\/\" class=\"elementor-item\" tabindex=\"-1\">contatti<\/a><\/li>\n<\/ul>\t\t\t<\/nav>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":7411,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6800","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/pages\/6800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/comments?post=6800"}],"version-history":[{"count":374,"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/pages\/6800\/revisions"}],"predecessor-version":[{"id":9787,"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/pages\/6800\/revisions\/9787"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/media\/7411"}],"wp:attachment":[{"href":"https:\/\/proposte.it\/en\/wp-json\/wp\/v2\/media?parent=6800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}