(function(){ "use strict"; /* Hand-written plan data. grid cells: [crop, squares, color]. */ var PLANS=[ {name:"4×4 Salad Garden",sub:"Square-foot bed · 16 squares",layout:"grid",cols:4, cells:[["Lettuce",4,"#b7dfa8"],["Spinach",4,"#93cc7f"],["Arugula",2,"#c9e7a4"],["Radish",2,"#f0b3c2"],["Carrots",2,"#f6c489"],["Green onions",2,"#a9d69b"]], plants:[["Lettuce","16 heads"],["Spinach","36 plants"],["Arugula","18 plants"],["Radish","32 plants"],["Carrots","32 plants"],["Green onions","32 plants"]], tip:"Sow radishes and arugula every 2–3 weeks — salad greens bolt fast once heat arrives, so succession beats one big planting."}, {name:"4×4 Salsa Garden",sub:"Square-foot bed · 16 squares",layout:"grid",cols:4, cells:[["Tomato",4,"#f0a8a0"],["Bell pepper",2,"#f7c873"],["Jalapeño",2,"#e8875a"],["Onion",2,"#d9c9e8"],["Green onion",2,"#a9d69b"],["Cilantro",4,"#b7dfa8"]], plants:[["Tomatoes","4 plants"],["Bell peppers","2 plants"],["Jalapeños","2 plants"],["Onions","18 plants"],["Green onions","32 plants"],["Cilantro","16 plants"]], tip:"Put tomatoes on the north side so they don't shade the peppers — and give each tomato its own cage or stake from day one."}, {name:"4×8 Family Bed",sub:"Raised bed · 32 squares",layout:"grid",cols:8, cells:[["Tomato",4,"#f0a8a0"],["Pepper",4,"#f7c873"],["Cucumber",2,"#9fd08e"],["Bush beans",8,"#b7dfa8"],["Carrots",4,"#f6c489"],["Lettuce",4,"#c9e7a4"],["Basil",2,"#a9d69b"],["Swiss chard",2,"#93cc7f"],["Marigold",2,"#f9d976"]], plants:[["Tomatoes","4 plants"],["Peppers","4 plants"],["Cucumbers","2 plants (trellis)"],["Bush beans","72 plants"],["Carrots","64 plants"],["Lettuce","16 heads"],["Basil","8 plants"],["Swiss chard","8 plants"],["Marigolds","8 plants"]], tip:"Run the cucumber trellis along the north (back) edge so tall vines never shade the lettuce and carrots."}, {name:"Pizza Garden",sub:"Round bed ~6 ft across · a kid favorite",layout:"pizza", center:["Cherry tomato","1 plant","#f0a8a0"], wedges:[["Bell peppers","2 plants","#f7c873"],["Basil","4 plants","#a9d69b"],["Oregano","2 plants","#93cc7f"],["Parsley","4 plants","#b7dfa8"],["Onions","8 plants","#d9c9e8"],["Marigolds","4 plants","#f9d976"]], plants:[["Cherry tomato","1 plant (center, staked)"],["Bell peppers","2 plants"],["Basil","4 plants"],["Oregano","2 plants"],["Parsley","4 plants"],["Onions","8 plants"],["Marigolds","4 plants"]], tip:"Put the tomato in the middle with a sturdy stake — everything else rings around it where little hands can reach."}, {name:"2×6 Herb Strip",sub:"Narrow bed or border · 12 squares",layout:"grid",cols:6, cells:[["Basil",2,"#a9d69b"],["Parsley",2,"#b7dfa8"],["Cilantro",2,"#93cc7f"],["Chives",1,"#c9e7a4"],["Thyme",1,"#9fd08e"],["Oregano",1,"#b7dfa8"],["Rosemary",1,"#8fb996"],["Mint",1,"#7fb069"],["Dill",1,"#cfe0a0"]], plants:[["Basil","8 plants"],["Parsley","8 plants"],["Cilantro","8 plants"],["Chives","6 plants"],["Thyme","2 plants"],["Oregano","2 plants"],["Rosemary","1 plant"],["Mint","1 plant (contained)"],["Dill","4 plants"]], tip:"Mint gets its own buried pot — without walls it will take over the whole strip by midsummer."}, {name:"Patio Trio",sub:"3 containers · small patio or balcony",layout:"pots", pots:[{label:"5-gallon pot",items:[["Tomato","1 plant"],["Basil","2 plants"]]}, {label:"5-gallon pot",items:[["Peppers","2 plants"],["Parsley","2 plants"]]}, {label:"12-inch bowl",items:[["Lettuce","4 plants"],["Radish","8 plants"],["Green onions","6 plants"]]}], plants:[["Tomato","1 plant"],["Basil","2 plants"],["Peppers","2 plants"],["Parsley","2 plants"],["Lettuce","4 plants"],["Radish","8 plants"],["Green onions","6 plants"]], tip:"One drainage hole per pot is non-negotiable — and in summer heat, containers can need water twice a day."} ]; if(typeof module!=="undefined"){module.exports={PLANS:PLANS};} /* ---- DOM below ---- */ var tabsEl=document.getElementById("ppGlTabs"), planEl=document.getElementById("ppGlPlan"), current=0; function esc(s){return s;} function renderGrid(plan){ var squares=[]; plan.cells.forEach(function(c){ var i;for(i=0;i'; squares.forEach(function(c){ h+='
'+esc(c[0])+'
'; }); return h+""; } function renderPizza(plan){ var stops=plan.wedges.map(function(w,i){return w[2]+" "+(i*60)+"deg "+((i+1)*60)+"deg";}).join(","); var h='
'; plan.wedges.forEach(function(w,i){ var a=(i*60+30)*Math.PI/180, x=130+82*Math.sin(a), y=130-82*Math.cos(a); h+='
'+esc(w[0])+'
'; }); h+='
'+esc(plan.center[0])+'
'; return h+"
"; } function renderPots(plan){ var h='
'; plan.pots.forEach(function(p){ h+='
'+esc(p.label)+'
'; p.items.forEach(function(it){ h+=''+esc(it[0])+" · "+esc(it[1])+'
'; }); h+="
"; }); return h+"
"; } function render(){ var plan=PLANS[current],h=""; h+='

'+esc(plan.name)+'

'+esc(plan.sub)+'

'; if(plan.layout==="grid"){h+=renderGrid(plan);} else{if(plan.layout==="pizza"){h+=renderPizza(plan);}else{h+=renderPots(plan);}} h+='
Tip: '+esc(plan.tip)+'
'; planEl.innerHTML=h; var btns=tabsEl.querySelectorAll(".pp-gl-tab"),i; for(i=0;i