'",777);
setTimeout("if(document.getElementById('chkbei'))if(document.getElementById('mbeilauti'))document.getElementById('mbeilauti').innerHTML='
'",777);
}
}
//setTimeout("if(location.href.indexOf('&id=1332&')>0 && document.getElementById('otherh1'))document.getElementById('otherh1').innerHTML='Abonnement'",1111);
//setTimeout("if(document.form1.bei)if(location.href.indexOf('s_order')<0)document.form1.bei[1].click()",1111);
//setTimeout("if(document.getElementById('dbeilauti'))document.getElementById('dbeilauti').style.display='none'",1);
//setTimeout("if(document.getElementById('mbeilauti'))document.getElementById('mbeilauti').style.display='none'",1);
setTimeout("if(document.getElementById('kosten'))document.getElementById('kosten').style.marginTop='55px'",777);
setTimeout("if(!document.getElementById('beilautimg'))if(document.form1.bei)document.form1.bei[1].click()",777);
/////////////////////////////////////
function setSessionCookie(n,v){document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(v)+"; path=/";}
function getSessionCookie(n){for(let c of document.cookie.split(";")){let[a,b]=c.trim().split("=");if(a===decodeURIComponent(n))return decodeURIComponent(b);}return null;}
document.addEventListener("DOMContentLoaded",function(){
const s=document.getElementById("timwomo");if(!s)return;
s.addEventListener("change",()=>setSessionCookie("timwomo_value",s.value));
const v=getSessionCookie("timwomo_value");
if(v!==null && location.href.indexOf("x=")!==-1)setTimeout(()=>{s.value=v;s.dispatchEvent(new Event("change"));},5555);
});
////////////////////////////////////
(function () {
var isMobilePhp = location.href.indexOf('mobile.php') !== -1;
function styleSelectById(id, fontSize) {
var select = document.getElementById(id);
if (!select) return;
styleSelect(select, fontSize);
}
function styleSelect(select, fontSize) {
select.style.textAlign = 'center';
select.style.textAlignLast = 'center';
select.style.marginTop = '5px';
select.style.marginBottom = '3px';
select.style.fontSize = fontSize;
for (var i = 0; i < select.options.length; i++) {
select.options[i].style.textAlign = 'center';
}
}
function styleTimrepeatEndState(el) {
if (!el) return;
el.style.textAlign = 'center';
el.style.textAlignLast = 'center';
el.style.fontSize = '200%';
el.style.marginTop = '12px';
el.style.marginBottom = '12px';
el.style.borderRadius = '10px';
el.style.padding = '4px 8px';
el.style.backgroundColor = '#fff6cf';
el.style.outline = '1px solid rgba(170,130,45,0.42)';
el.style.outlineOffset = '3px';
el.style.boxShadow = '0 0 10px rgba(180,140,60,0.14)';
for (var i = 0; i < el.options.length; i++) {
el.options[i].style.textAlign = 'center';
}
}
styleSelectById('timwomo', isMobilePhp ? '100%' : '130%');
styleSelectById('timjeden', '130%');
styleSelectById('timclosed', '100%');
var repeats = document.getElementsByName('timrepeat');
for (var i = 0; i < repeats.length; i++) {
styleTimrepeatEndState(repeats[i]);
}
})();(function() {
if (
location.href.indexOf('a=z') <= 0 ||
(/[?&]x=/.test(location.search) && !/[?&]x=0(?:&|$)/.test(location.search))
) return;
function getTarget() {
return document.getElementsByName('timrepeat')[0];
}
function setTargetPosition(el) {
if (!el || !el.options || el.options.length <= 9) return;
el.selectedIndex = 9;
}
function waitUntilTargetIsReady(callback) {
var stableCount = 0;
var maxTries = 50;
var lastTop = null;
var lastHeight = null;
function check() {
var el = getTarget();
setTargetPosition(el);
if (!el || !document.body.contains(el)) {
if (maxTries-- > 0) setTimeout(check, 100);
return;
}
var rect = el.getBoundingClientRect();
var currentTop = Math.round(rect.top);
var currentHeight = Math.round(rect.height);
if (
currentHeight > 0 &&
currentTop === lastTop &&
currentHeight === lastHeight
) {
stableCount++;
} else {
stableCount = 0;
lastTop = currentTop;
lastHeight = currentHeight;
}
if (stableCount >= 2 || maxTries-- <= 0) {
callback(el);
} else {
setTimeout(check, 120);
}
}
check();
}
function ensureHighlightStyle() {
if (document.getElementById('timrepeat-highlight-style')) return;
var style = document.createElement('style');
style.id = 'timrepeat-highlight-style';
style.innerHTML =
'@keyframes timrepeatElegantBloom {' +
' 0% { transform: scale(1); box-shadow: 0 0 0 rgba(190,145,30,0); }' +
' 24% { transform: scale(1.030); box-shadow: 0 0 28px rgba(190,145,30,0.42); }' +
' 52% { transform: scale(1.012); box-shadow: 0 0 38px rgba(190,145,30,0.50); }' +
' 76% { transform: scale(1.020); box-shadow: 0 0 24px rgba(190,145,30,0.34); }' +
' 100% { transform: scale(1); box-shadow: 0 0 16px rgba(190,145,30,0.24); }' +
'}' +
'@keyframes timrepeatElegantGlowOnce {' +
' 0% { background-color: #fff2ad; }' +
' 45% { background-color: #ffe680; }' +
' 100% { background-color: #fff6cf; }' +
'}';
document.head.appendChild(style);
}
function easeInOutCubic(t) {
return t < 0.5
? 4 * t * t * t
: 1 - Math.pow(-2 * t + 2, 3) / 2;
}
function slowScrollToElement(el, duration) {
var rect = el.getBoundingClientRect();
var startY = window.pageYOffset || document.documentElement.scrollTop || 0;
var targetY = startY + rect.top - ((window.innerHeight - rect.height) / 2);
var diff = targetY - startY;
var startTime = null;
function step(timestamp) {
if (!startTime) startTime = timestamp;
var elapsed = timestamp - startTime;
var progress = Math.min(elapsed / duration, 1);
var eased = easeInOutCubic(progress);
window.scrollTo(0, startY + diff * eased);
if (progress < 1) {
window.requestAnimationFrame(step);
}
}
window.requestAnimationFrame(step);
}
function prepareTarget(el) {
el.style.fontSize = '12px';
el.style.borderRadius = '8px';
el.style.padding = '3px 7px';
el.style.marginTop = '12px';
el.style.marginBottom = '12px';
el.style.backgroundColor = '#fff9d8';
el.style.outline = '1px solid rgba(185,140,35,0.30)';
el.style.outlineOffset = '3px';
el.style.boxShadow = '0 0 0 rgba(190,145,30,0)';
el.style.transition =
'font-size 850ms ease, ' +
'background-color 950ms ease, ' +
'box-shadow 950ms ease, ' +
'transform 950ms ease, ' +
'outline-color 950ms ease, ' +
'outline-offset 950ms ease';
}
function highlightTarget(el) {
ensureHighlightStyle();
var originalTransition = el.style.transition;
var originalTransform = el.style.transform;
prepareTarget(el);
setTargetPosition(el);
requestAnimationFrame(function() {
setTargetPosition(el);
el.style.fontSize = '400%';
el.style.borderRadius = '14px';
el.style.padding = '6px 12px';
el.style.backgroundColor = '#ffe680';
el.style.outline = '1px solid rgba(185,140,35,0.78)';
el.style.outlineOffset = '5px';
el.style.boxShadow = '0 0 32px rgba(190,145,30,0.42)';
el.style.animation = 'timrepeatElegantBloom 1500ms ease-in-out 0s 1';
});
setTimeout(function() {
setTargetPosition(el);
el.style.fontSize = '200%';
el.style.borderRadius = '10px';
el.style.padding = '4px 8px';
el.style.backgroundColor = '#fff2ad';
el.style.outline = '1px solid rgba(185,140,35,0.58)';
el.style.outlineOffset = '4px';
el.style.boxShadow = '0 0 18px rgba(190,145,30,0.26)';
}, 880);
setTimeout(function() {
el.style.animation = 'timrepeatElegantGlowOnce 1500ms ease-in-out 0s 1';
}, 1800);
setTimeout(function() {
el.style.animation = '';
el.style.transition =
'font-size 900ms ease, ' +
'background-color 1300ms ease, ' +
'box-shadow 1300ms ease, ' +
'transform 900ms ease, ' +
'outline-color 1300ms ease, ' +
'outline-offset 1300ms ease';
el.style.fontSize = '200%';
el.style.backgroundColor = '#fff6cf';
el.style.outline = '1px solid rgba(170,130,45,0.42)';
el.style.outlineOffset = '3px';
el.style.boxShadow = '0 0 10px rgba(180,140,60,0.14)';
el.style.transform = originalTransform;
}, 3400);
setTimeout(function() {
el.style.transition = originalTransition;
}, 4900);
}
function run(el) {
setTargetPosition(el);
prepareTarget(el);
setTimeout(function() {
setTargetPosition(el);
slowScrollToElement(el, 1500);
}, 120);
setTimeout(function() {
setTargetPosition(el);
try {
el.focus({ preventScroll: true });
} catch (e) {
el.focus();
}
highlightTarget(el);
}, 1050);
}
function start() {
waitUntilTargetIsReady(run);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
}
window.addEventListener('load', function() {
if (!getTarget()) start();
});
})();
if(location.href.indexOf('a=o')>0 && (location.href.indexOf('x=')<0 || location.href.indexOf('x=0')>0) && document.getElementsByName('timrepeat')[0]) document.getElementsByName('timrepeat')[0].selectedIndex = 9;
setTimeout("if(location.href.indexOf('m=y')<0 && location.href.indexOf('a=o')>0 && (location.href.indexOf('x=')<0 || location.href.indexOf('x=0')>0) && document.getElementsByName('timrepeat')[0] && document.getElementById('f_trigger_b')){document.getElementById('f_trigger_b').focus();document.getElementById('f_trigger_b').dispatchEvent(new MouseEvent('mousedown',{bubbles:true,cancelable:true,view:window}));document.getElementById('f_trigger_b').click();}",1111);(function () {
function ready(fn) {
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', fn);
} else {
fn();
}
}
ready(function () {
window.setTimeout(function () {
buildAboParamFrozenSvg();
}, 111);
});
function buildAboParamFrozenSvg() {
var box = document.getElementById('aboparam') ||
document.querySelector('[name="aboparam"]') ||
document.querySelector('.aboparam');
if (!box) return;
if (box._aboStaticFrozenSvgDone) return;
box._aboStaticFrozenSvgDone = true;
var CFG = {
fps: 18,
opacity: 0.70,
dprMax: 1.5,
visual: {
backgroundAlpha: 0.008,
stemColor: [44, 118, 48],
stemHighlightColor: [126, 168, 76],
leafColorA: [54, 138, 58],
leafColorB: [69, 152, 64],
leafColorC: [92, 152, 60],
leafVeinColor: [32, 90, 36],
budColor: [176, 202, 48],
budLightColor: [255, 238, 80],
flowerPaleColor: [255, 255, 178],
flowerWarmColor: [255, 224, 0],
flowerGreenColor: [246, 238, 86],
flowerCenterColor: [210, 148, 0],
softBackgroundColor: [118, 156, 76]
}
};
var STATIC_AGE_MS = 240000;
var DRAW_SPEED = 1;
var RENDER_OPACITY = CFG.opacity;
var W = 1400;
var H = 720;
var canvasBleed = Math.max(56, Math.round(W * 0.085));
var VW = W + canvasBleed * 2;
var w = VW;
var h = H;
var boxW = W;
var boxH = H;
var leftEdge = canvasBleed;
var rightEdge = canvasBleed + W;
var stems = [];
var leaves = [];
var flowers = [];
var buds = [];
var finalAt = 0;
function cfg(path, fallback) {
try {
var parts = path.split('.');
var v = CFG;
for (var i = 0; i < parts.length; i++) {
if (v == null || typeof v[parts[i]] === 'undefined') return fallback;
v = v[parts[i]];
}
return v;
} catch (e) {
return fallback;
}
}
function visual(name, fallback) {
return cfg('visual.' + name, fallback);
}
function rnd(min, max) {
return min + Math.random() * (max - min);
}
function rndInt(min, max) {
return Math.floor(rnd(min, max + 0.999));
}
function choose(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}
function clamp(v, min, max) {
return Math.max(min, Math.min(max, v));
}
function fast(ms) {
return ms / DRAW_SPEED;
}
function signFor(side) {
return side === 'left' ? 1 : -1;
}
function outwardFor(side) {
return side === 'left' ? -1 : 1;
}
function xInside(side, rel) {
if (side === 'left') return leftEdge + boxW * rel;
return rightEdge - boxW * rel;
}
function xOutside(side, amount) {
if (side === 'left') return leftEdge - amount;
return rightEdge + amount;
}
function keepSideX(x, side, deep) {
var outer = canvasBleed * 0.75;
if (side === 'left') {
return clamp(x, leftEdge - outer, leftEdge + boxW * (deep ? 0.44 : 0.32));
}
return clamp(x, rightEdge - boxW * (deep ? 0.44 : 0.32), rightEdge + outer);
}
function f(n) {
return n.toFixed(1);
}
function rgba(rgb, alpha) {
alpha = alpha * RENDER_OPACITY;
return 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + clamp(alpha, 0, 1).toFixed(3) + ')';
}
function progress(item, now) {
return clamp((now - item.born) / item.duration, 0, 1);
}
function easeOutCubic(t) {
t = clamp(t, 0, 1);
return 1 - Math.pow(1 - t, 3);
}
function easeOutQuart(t) {
t = clamp(t, 0, 1);
return 1 - Math.pow(1 - t, 4);
}
function easeInOutCubic(t) {
t = clamp(t, 0, 1);
return t < 0.5
? 4 * t * t * t
: 1 - Math.pow(-2 * t + 2, 3) / 2;
}
function pointOnCubic(c, t) {
var mt = 1 - t;
return {
x: mt * mt * mt * c.x1 + 3 * mt * mt * t * c.c1x + 3 * mt * t * t * c.c2x + t * t * t * c.x2,
y: mt * mt * mt * c.y1 + 3 * mt * mt * t * c.c1y + 3 * mt * t * t * c.c2y + t * t * t * c.y2
};
}
function tangentOnCubic(c, t) {
var mt = 1 - t;
var dx =
3 * mt * mt * (c.c1x - c.x1) +
6 * mt * t * (c.c2x - c.c1x) +
3 * t * t * (c.x2 - c.c2x);
var dy =
3 * mt * mt * (c.c1y - c.y1) +
6 * mt * t * (c.c2y - c.c1y) +
3 * t * t * (c.y2 - c.c2y);
return Math.atan2(dy, dx);
}
function splitCubic(c, t) {
t = clamp(t, 0, 1);
var x01 = c.x1 + (c.c1x - c.x1) * t;
var y01 = c.y1 + (c.c1y - c.y1) * t;
var x12 = c.c1x + (c.c2x - c.c1x) * t;
var y12 = c.c1y + (c.c2y - c.c1y) * t;
var x23 = c.c2x + (c.x2 - c.c2x) * t;
var y23 = c.c2y + (c.y2 - c.c2y) * t;
var x012 = x01 + (x12 - x01) * t;
var y012 = y01 + (y12 - y01) * t;
var x123 = x12 + (x23 - x12) * t;
var y123 = y12 + (y23 - y12) * t;
return {
x1: c.x1,
y1: c.y1,
c1x: x01,
c1y: y01,
c2x: x012,
c2y: y012,
x2: x012 + (x123 - x012) * t,
y2: y012 + (y123 - y012) * t
};
}
function svgX(x) {
return x - canvasBleed;
}
function pathForCubic(c, p) {
var cc = splitCubic(c, p);
return 'M ' + f(svgX(cc.x1)) + ' ' + f(cc.y1)
+ ' C ' + f(svgX(cc.c1x)) + ' ' + f(cc.c1y)
+ ', ' + f(svgX(cc.c2x)) + ' ' + f(cc.c2y)
+ ', ' + f(svgX(cc.x2)) + ' ' + f(cc.y2);
}
function addStem(data) {
stems.push(data);
var end = data.born + data.duration;
if (end > finalAt) finalAt = end;
return data;
}
function addLeaf(data) {
leaves.push(data);
var end = data.born + data.duration;
if (end > finalAt) finalAt = end;
return data;
}
function addFlower(data) {
flowers.push(data);
var end = data.born + data.duration;
if (end > finalAt) finalAt = end;
return data;
}
function addBud(data) {
buds.push(data);
var end = data.born + data.duration;
if (end > finalAt) finalAt = end;
return data;
}
function attachLeafPair(stem, u, sideTurn, size, extraDelay, shape) {
var p = pointOnCubic(stem, u);
var a = tangentOnCubic(stem, u);
var baseDelay = stem.born + stem.duration * u * rnd(0.58, 0.82) + extraDelay;
var dist = rnd(4.0, 8.5) * size;
addLeaf({
x: p.x + Math.cos(a + Math.PI / 2 * sideTurn) * dist,
y: p.y + Math.sin(a + Math.PI / 2 * sideTurn) * dist,
angle: a - sideTurn * rnd(0.58, 1.02),
rx: rnd(5.8, 12.5) * size,
ry: rnd(3.0, 7.3) * size,
shape: shape || choose(['oval', 'oval', 'heart', 'ivy', 'slender']),
hue: rnd(0, 1),
alpha: rnd(0.23, 0.44),
born: baseDelay,
duration: rnd(fast(3200), fast(8200))
});
addLeaf({
x: p.x - Math.cos(a + Math.PI / 2 * sideTurn) * dist * rnd(0.72, 0.96),
y: p.y - Math.sin(a + Math.PI / 2 * sideTurn) * dist * rnd(0.72, 0.96),
angle: a + sideTurn * rnd(0.58, 1.04),
rx: rnd(4.8, 10.8) * size,
ry: rnd(2.8, 6.6) * size,
shape: shape || choose(['oval', 'heart', 'ivy', 'slender']),
hue: rnd(0, 1),
alpha: rnd(0.19, 0.38),
born: baseDelay + rnd(fast(250), fast(1300)),
duration: rnd(fast(3000), fast(7800))
});
}
function attachBud(stem, u, size, extraDelay) {
var p = pointOnCubic(stem, u);
var a = tangentOnCubic(stem, u);
var side = Math.random() < 0.5 ? -1 : 1;
var d = rnd(2, 7) * size;
addBud({
x: p.x + Math.cos(a + Math.PI / 2 * side) * d,
y: p.y + Math.sin(a + Math.PI / 2 * side) * d,
angle: a + side * rnd(0.24, 0.64),
r: rnd(2.0, 4.0) * size,
alpha: rnd(0.24, 0.42),
born: stem.born + stem.duration * u * rnd(0.60, 0.86) + extraDelay,
duration: rnd(fast(2600), fast(6800))
});
}
function attachFlower(stem, u, size, extraDelay, type, soft) {
var p = pointOnCubic(stem, u);
var a = tangentOnCubic(stem, u);
var side = Math.random() < 0.5 ? -1 : 1;
var d = rnd(2, 8) * size;
addFlower({
x: p.x + Math.cos(a + Math.PI / 2 * side) * d,
y: p.y + Math.sin(a + Math.PI / 2 * side) * d,
angle: a + side * rnd(0.16, 0.70),
r: rnd(6.0, 12.5) * size,
type: type || choose(['five', 'five', 'daisy', 'ranunculus']),
petals: rndInt(6, 11),
color: choose(['warm', 'pale', 'sun', 'green']),
alpha: soft ? rnd(0.25, 0.44) : rnd(0.40, 0.70),
born: stem.born + stem.duration * u * rnd(0.62, 0.88) + extraDelay,
duration: rnd(fast(3800), fast(9200))
});
}
function decorateStem(stem, density, flowerPower, leafShape) {
var leafCount = Math.max(1, Math.round(density));
for (var i = 0; i < leafCount; i++) {
var u = (i + rnd(0.55, 0.90)) / (leafCount + 1.0);
var side = i % 2 === 0 ? -1 : 1;
attachLeafPair(
stem,
clamp(u, 0.15, 0.92),
side,
rnd(0.66, 1.10) * (stem.mass || 1),
rnd(fast(600), fast(3600)),
leafShape
);
}
var budCount = rndInt(1, Math.max(2, Math.round(density * 0.7)));
for (var b = 0; b < budCount; b++) {
attachBud(stem, rnd(0.32, 0.96), rnd(0.72, 1.10) * (stem.mass || 1), rnd(fast(1200), fast(5200)));
}
var flowerCount = Math.max(0, Math.round(flowerPower));
for (var f0 = 0; f0 < flowerCount; f0++) {
attachFlower(
stem,
f0 === 0 ? rnd(0.74, 0.98) : rnd(0.38, 0.92),
rnd(0.78, 1.18) * (stem.mass || 1),
rnd(fast(1600), fast(6800)),
null,
flowerPower < 1.4
);
}
}
function makeCubicStem(side, kind, born, x1, y1, x2, y2, bow, lift, width, alpha, duration, mass) {
var outward = outwardFor(side);
return addStem({
side: side,
kind: kind,
x1: x1,
y1: y1,
c1x: x1 + outward * bow * rnd(0.20, 0.74),
c1y: y1 - lift * rnd(0.12, 0.38),
c2x: x2 - outward * bow * rnd(0.18, 0.72),
c2y: y2 + lift * rnd(0.14, 0.42),
x2: x2,
y2: y2,
width: width,
alpha: alpha,
born: born,
duration: duration,
mass: mass || 1
});
}
function buildBouquet(side, born) {
var sign = signFor(side);
var baseX = xInside(side, rnd(0.020, 0.090));
var baseY = h * rnd(0.955, 0.995);
var stemCount = rndInt(7, 10);
for (var i = 0; i < stemCount; i++) {
var fan = stemCount <= 1 ? 0 : (i / (stemCount - 1) - 0.5);
var x2 = keepSideX(baseX + sign * rnd(boxW * 0.060, boxW * 0.270) + sign * fan * boxW * rnd(0.020, 0.080), side, true);
var y2 = clamp(baseY - rnd(h * 0.135, h * 0.455) + fan * h * rnd(0.015, 0.060), h * 0.080, h * 0.970);
var s = makeCubicStem(
side,
'bouquet',
born + i * rnd(fast(320), fast(1100)),
baseX + sign * rnd(-6, 9),
baseY + rnd(-3, 4),
x2,
y2,
boxW * rnd(0.025, 0.115),
h * rnd(0.060, 0.170),
i < 3 ? rnd(1.10, 1.82) : rnd(0.56, 1.10),
i < 3 ? rnd(0.43, 0.64) : rnd(0.24, 0.40),
rnd(fast(24000), fast(62000)),
i < 3 ? rnd(0.95, 1.22) : rnd(0.68, 0.96)
);
decorateStem(s, i < 3 ? rnd(3.2, 5.2) : rnd(2.0, 3.6), i < 3 ? rnd(1.4, 3.2) : rnd(0.4, 1.6));
}
for (var f0 = 0; f0 < rndInt(4, 7); f0++) {
addFlower({
x: baseX + sign * rnd(8, 52),
y: baseY - rnd(12, 56),
angle: rnd(-0.80, 0.80),
r: rnd(6.2, 12.5),
type: choose(['five', 'ranunculus', 'ranunculus']),
petals: rndInt(7, 12),
color: choose(['warm', 'sun', 'pale']),
alpha: rnd(0.40, 0.68),
born: born + rnd(fast(2800), fast(14500)) + f0 * rnd(fast(280), fast(900)),
duration: rnd(fast(3600), fast(8600))
});
}
for (var l = 0; l < rndInt(5, 8); l++) {
addLeaf({
x: baseX + sign * rnd(0, 52),
y: baseY - rnd(0, 42),
angle: -Math.PI / 2 + sign * rnd(0.35, 1.35),
rx: rnd(6.2, 13.0),
ry: rnd(3.2, 7.2),
shape: choose(['oval', 'ivy', 'slender']),
hue: rnd(0, 1),
alpha: rnd(0.22, 0.42),
born: born + rnd(fast(1200), fast(9000)) + l * rnd(fast(140), fast(620)),
duration: rnd(fast(3200), fast(8000))
});
}
}
function buildHero(side, born, yStartRel, heightRel, alpha) {
var sign = signFor(side);
var baseX = xInside(side, rnd(0.055, 0.150));
var baseY = h * yStartRel;
var count = rndInt(3, 5);
for (var i = 0; i < count; i++) {
var offset = count <= 1 ? 0 : (i / (count - 1) - 0.5);
var x1 = baseX + sign * offset * boxW * rnd(0.006, 0.028);
var y1 = baseY + offset * h * rnd(0.012, 0.044);
var x2 = keepSideX(x1 + sign * rnd(boxW * 0.040, boxW * 0.190) + sign * offset * boxW * rnd(0.020, 0.080), side, true);
var y2 = clamp(y1 - h * heightRel + offset * h * rnd(0.010, 0.055), h * 0.050, h * 0.960);
var s = makeCubicStem(
side,
'hero',
born + i * rnd(fast(500), fast(1800)),
x1,
y1,
x2,
y2,
boxW * rnd(0.035, 0.150),
h * heightRel,
i === 0 ? rnd(1.24, 1.94) : rnd(0.62, 1.20),
(i === 0 ? rnd(0.46, 0.66) : rnd(0.24, 0.42)) * alpha,
rnd(fast(30000), fast(72000)),
i === 0 ? rnd(1.00, 1.24) : rnd(0.72, 1.02)
);
decorateStem(s, i === 0 ? rnd(4.0, 6.2) : rnd(2.2, 4.2), i === 0 ? rnd(2.0, 3.8) : rnd(0.8, 2.0));
}
}
function buildOverhang(side, born, yRel, alpha) {
var outward = outwardFor(side);
var inward = signFor(side);
var baseY = h * yRel;
var baseX = xInside(side, rnd(0.010, 0.085));
var count = rndInt(2, 4);
for (var i = 0; i < count; i++) {
var y1 = clamp(baseY + (i - (count - 1) / 2) * rnd(h * 0.015, h * 0.052) + rnd(-9, 9), h * 0.050, h * 0.960);
var x1 = baseX + inward * rnd(0, 18);
var x2 = xOutside(side, rnd(12, canvasBleed * 0.70));
var y2 = clamp(y1 + rnd(-h * 0.082, h * 0.082), h * 0.045, h * 0.965);
var s = addStem({
side: side,
kind: 'overhang',
x1: x1,
y1: y1,
c1x: x1 + outward * rnd(14, canvasBleed * 0.82),
c1y: y1 + rnd(-h * 0.040, h * 0.040),
c2x: x2 - outward * rnd(4, canvasBleed * 0.45),
c2y: y2 + rnd(-h * 0.050, h * 0.050),
x2: x2,
y2: y2,
width: i === 0 ? rnd(0.82, 1.32) : rnd(0.42, 0.82),
alpha: (i === 0 ? rnd(0.34, 0.52) : rnd(0.18, 0.32)) * alpha,
born: born + i * rnd(fast(380), fast(1350)),
duration: rnd(fast(18000), fast(42000)),
mass: rnd(0.72, 1.05)
});
decorateStem(s, rnd(2.0, 3.8), rnd(0.4, 1.3), choose(['ivy', 'heart', 'oval']));
if (Math.random() < 0.72) {
attachFlower(s, rnd(0.66, 0.98), rnd(0.58, 0.92), rnd(fast(2200), fast(7000)), choose(['five', 'daisy']), true);
}
}
}
function buildHanging(side, born, alpha) {
var sign = signFor(side);
var x1 = xInside(side, rnd(0.035, 0.165));
var y1 = h * rnd(0.018, 0.080);
var count = rndInt(2, 4);
for (var i = 0; i < count; i++) {
var x2 = keepSideX(x1 + sign * rnd(boxW * 0.025, boxW * 0.160), side, false);
var y2 = h * rnd(0.180, 0.430);
var s = addStem({
side: side,
kind: 'hanging',
x1: x1 + sign * rnd(-boxW * 0.012, boxW * 0.030),
y1: y1 + rnd(-4, 8),
c1x: x1 + sign * rnd(boxW * 0.015, boxW * 0.075),
c1y: y1 + h * rnd(0.040, 0.130),
c2x: x2 - sign * rnd(boxW * 0.010, boxW * 0.060),
c2y: y2 - h * rnd(0.025, 0.090),
x2: x2,
y2: y2,
width: i === 0 ? rnd(0.74, 1.22) : rnd(0.38, 0.78),
alpha: (i === 0 ? rnd(0.28, 0.46) : rnd(0.14, 0.27)) * alpha,
born: born + i * rnd(fast(360), fast(1300)),
duration: rnd(fast(20000), fast(46000)),
mass: rnd(0.65, 0.95)
});
decorateStem(s, rnd(2.0, 4.0), rnd(0.4, 1.4), choose(['ivy', 'heart', 'oval']));
}
}
function buildFlowerNode(side, born, yRel, alpha) {
var sign = signFor(side);
var cx = xInside(side, rnd(0.055, 0.200));
var cy = h * yRel + rnd(-h * 0.030, h * 0.030);
var count = rndInt(2, 4);
for (var i = 0; i < count; i++) {
var x2 = keepSideX(cx + sign * rnd(boxW * 0.030, boxW * 0.135), side, false);
var y2 = clamp(cy + rnd(-h * 0.085, h * 0.085), h * 0.055, h * 0.950);
var s = addStem({
side: side,
kind: 'node',
x1: cx + sign * rnd(-8, 8),
y1: cy + rnd(-8, 8),
c1x: cx + sign * rnd(boxW * 0.010, boxW * 0.055),
c1y: cy + rnd(-h * 0.040, h * 0.040),
c2x: x2 - sign * rnd(boxW * 0.008, boxW * 0.050),
c2y: y2 + rnd(-h * 0.040, h * 0.040),
x2: x2,
y2: y2,
width: rnd(0.52, 0.94),
alpha: rnd(0.18, 0.32) * alpha,
born: born + i * rnd(fast(260), fast(980)),
duration: rnd(fast(13000), fast(30000)),
mass: rnd(0.70, 1.05)
});
decorateStem(s, rnd(1.6, 3.1), rnd(0.8, 1.8));
}
for (var f0 = 0; f0 < rndInt(2, 4); f0++) {
addFlower({
x: cx + sign * rnd(4, 40),
y: cy + rnd(-24, 24),
angle: rnd(-0.60, 0.60),
r: rnd(6.0, 11.6),
type: choose(['five', 'five', 'ranunculus']),
petals: rndInt(6, 11),
color: choose(['warm', 'sun', 'pale']),
alpha: rnd(0.34, 0.58) * alpha,
born: born + rnd(fast(2600), fast(11800)) + f0 * rnd(fast(260), fast(900)),
duration: rnd(fast(3400), fast(8200))
});
}
}
function planComposition(now) {
stems = [];
leaves = [];
flowers = [];
buds = [];
finalAt = now;
buildBouquet('left', now);
buildBouquet('right', now + fast(1100));
buildOverhang('left', now + fast(1200), 0.28, 1.0);
buildOverhang('right', now + fast(2100), 0.31, 1.0);
buildHero('left', now + fast(4500), 0.965, 0.72, 1.0);
buildHero('right', now + fast(6200), 0.965, 0.72, 1.0);
buildHero('left', now + fast(24000), 0.80, 0.46, 0.72);
buildHero('right', now + fast(27000), 0.80, 0.46, 0.72);
buildFlowerNode('left', now + fast(47000), 0.42, 0.92);
buildFlowerNode('right', now + fast(52000), 0.46, 0.92);
buildOverhang('left', now + fast(62000), 0.66, 0.78);
buildOverhang('right', now + fast(65000), 0.69, 0.78);
buildHanging('left', now + fast(76000), 0.82);
buildHanging('right', now + fast(81000), 0.82);
buildFlowerNode('left', now + fast(98000), 0.25, 0.66);
buildFlowerNode('right', now + fast(104000), 0.28, 0.66);
buildOverhang('left', now + fast(118000), 0.47, 0.66);
buildOverhang('right', now + fast(123000), 0.52, 0.66);
buildHero('left', now + fast(134000), 0.66, 0.34, 0.48);
buildHero('right', now + fast(140000), 0.66, 0.34, 0.48);
}
function leafFill(l, alpha) {
var c;
if (l.hue < 0.34) {
c = visual('leafColorA', [54, 138, 58]);
} else if (l.hue < 0.74) {
c = visual('leafColorB', [69, 152, 64]);
} else {
c = visual('leafColorC', [92, 152, 60]);
}
return rgba(c, alpha);
}
function flowerFill(flower, alpha) {
if (flower.color === 'warm') return rgba(visual('flowerWarmColor', [255, 224, 0]), alpha);
if (flower.color === 'sun') return rgba([255, 224, 0], alpha);
if (flower.color === 'green') return rgba(visual('flowerGreenColor', [246, 238, 86]), alpha);
return rgba(visual('flowerPaleColor', [255, 255, 178]), alpha);
}
function svgStem(s, now) {
var p = easeInOutCubic(progress(s, now));
if (p <= 0) return '';
var d = pathForCubic(s, p);
var out = '';
out += '