function init(e,t,n,a,i,o,d){var l,r,s=document.getElementById(e),h=s.getContext("2d"),c=s.width=t,m=s.height=n,w=a,u=i,y=Math.ceil(c/w),g=Math.ceil(m/u-2),f=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},_=function(){for(h.clearRect(0,0,c,m),Number.prototype.between=function(e,t){return this>e&&t>this},l=0;y>l;l++)if(l%2)for(r=0;g>r;r++){if(f(0,90),h.beginPath(),h.moveTo(l*w+w,u*r),h.lineTo(l*w,u*r+u/2),h.lineTo(l*w+w,u*r+u),h.fillStyle="white",h.strokeStyle="white",h.lineWidth=.2,h.closePath(),0!==o)for(var e=0;er;r++){if(f(0,90),h.beginPath(),h.moveTo(l*w,u*r),h.lineTo(l*w+w,u*r+u/2),h.lineTo(l*w,u*r+u),h.fillStyle="white",h.strokeStyle="white",h.lineWidth=.2,h.closePath(),0!==o)for(var e=0;ed;++d)o[d]=i.charCodeAt(d);var r=new Blob([o.buffer],{type:"image/png"}),s=document.createElement("img");s.src=(window.webkitURL||window.URL).createObjectURL(r),n.appendChild(s),e("design_process","animation"),document.getElementById("init_area").style.display="none",jQuery.ajax({url:"wp-content/themes/beehive/script.php",type:"POST",data:{data:a}})}}function remove_clear_mask(){document.getElementById("mask_clear").style.background="none",document.getElementById("mask_clear").style["z-index"]="2"}function moveBee(){!function(e){e("#bee, #bee2").css("transition","none"),setTimeout(function(){var t=2.7,n=10,a=100,i=30,o=50;620>=width&&(t=1.5,n=40,a=85,i=30,o=-10),width>=1440&&1599>=width&&(t=2.8,n=30,a=120,i=0,o=50),width>=1600&&1919>=width&&(t=3.1,n=60,a=90,i=-10,o=70),width>=1920&&(t=3.8,n=40,a=120,i=0,o=50),e("#bee").animate({top:Math.round(data_y[1]*t-n),left:Math.round(data_x[1]*t-a),easing:"easein"},5e3,function(){e("#bee").removeClass("bee"),e("#bee").addClass("bee3"),e("#wings").addClass("wings3")}),e("#bee2").animate({top:Math.round(data_y[data_y.length-1]*t+i),left:Math.round(data_x[data_x.length-1]*t-o),easing:"easein"},5e3,function(){e("#bee2").removeClass("bee2"),e("#bee2").addClass("bee4"),e("#wings2").addClass("wings4")})},14e3)}(jQuery)}paper.install(window),window.onload=function(){function e(e,t){i.add(e,t)}function t(e,t){var n=0,a=0;1919>width?(n=Math.floor(e),a=Math.floor(t)):(n=Math.floor(e)/1.4,a=Math.floor(t)/1.4),data_x.push(n),data_y.push(a)}paper.setup(user_draw);var n=window,a="inner";"innerWidth"in window||(a="client",n=document.documentElement||document.body),width=n[a+"Width"];var i,o=new Tool;o.onMouseDown=function(){i=new Path,i.strokeColor="#949292",i.strokeWidth=3},o.onMouseDrag=function(n){var a=n.middlePoint.x,i=n.middlePoint.y;document.getElementById("apply").style.display="block",document.getElementById("clear").style.display="block",e(a,i),t(a,i)},document.getElementById("clear").addEventListener("click",function(){project.activeLayer.hasChildren()&&(project.activeLayer.removeChildren(),data_x.length=0,data_y.length=0,document.getElementById("mask_clear").style.background="white",document.getElementById("mask_clear").style["z-index"]="5",document.getElementById("apply").style.display="none",document.getElementById("clear").style.display="none")},!1),paper.view.draw(),1440>width?init("draw_hex_bg",441,445,20,23.4,0,1):width>=1440&&1599>=width?(init("draw_hex_bg",482,484,20,23.4,0,1),console.log(width)):width>=1600&&1919>=width?(init("draw_hex_bg",542,535,20,23.4,0,1),console.log(width)):width>=1920&&init("draw_hex_bg",602,607,20,23.4,0,1)},document.getElementById("apply").onclick=function(e){e=e||window.event,saveImage(),1440>width?init("user_draw_hex",360,398,20,23.4,2.7,0):width>=1440&&1599>=width?init("user_draw_hex",482,484,20,23.4,2.8,0):width>=1600&&1919>=width?init("user_draw_hex",542,535,20,23.4,3.1,0):width>=1920&&init("user_draw_hex",602,607,20,23.4,3.8,0),moveBee()},document.getElementById("mask_clear").onmouseover=function(e){e=e||window.event,remove_clear_mask()};var b=document.documentElement;b.className=b.className.replace("no-js","js"),b.setAttribute("data-useragent",navigator.userAgent),b.setAttribute("data-platform",navigator.platform),jQuery(window).resize(function(){document.styleSheets[0].addRule(".draw_hex:before","display:none;")});