
如果您使用 Sleepm 睡觉,请告诉我们您的体验。经您同意,我们会将您的评价分享给那些决定 Sleepm 是否适合他们的用户。
您的故事已提交给Sleepm大家庭。一旦我们将其与您的订单匹配成功,它就可能会出现在网站上。
(function(){
var f=document.getElementById('lstForm');if(!f){return;}var t0=Date.now(),rate=0,msg=f.querySelector('.lst-err');
var stars=f.querySelectorAll('.lst-star');[].forEach.call(stars,function(s,ix){s.addEventListener('click',function(){rate=ix+1;[].forEach.call(stars,function(x,j){x.classList.toggle('on',j<rate);x.setAttribute('aria-pressed',j<rate?'true':'false');});});});
function err(m){msg.textContent=m;msg.hidden=false;}
f.addEventListener('submit',function(e){e.preventDefault();msg.hidden=true;var E=f.elements;
if(!E.product.value){return err('Please choose which Sleepm you have.');}
if(!rate){return err('Please tap a star rating.');}
if(E.story.value.trim().length<20){return err('Please write a sentence or two about your experience.');}
if(!E.first.value.trim()||!E.phone.value.trim()){return err('Please add your name and phone number (we only use it to verify your purchase).');}
if(!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(E.email.value.trim())){return err('Please enter a valid email address.');}
var lines=['REVIEW SUBMISSION (verify purchase before publishing)','Product: '+E.product.value,'Rating: '+rate+' of 5','City: '+(E.city.value.trim()||'-'),'Permission to publish first name + city: '+(E.ok.checked?'YES':'NO'),'','Review:',E.story.value.trim()];
var fd=new FormData();fd.append('action','sleepm_contact');fd.append('first',E.first.value.trim());fd.append('last',E.last.value.trim()||'-');fd.append('email',E.email.value.trim());fd.append('phone',E.phone.value.trim());fd.append('heard[]','Review submission');fd.append('message',lines.join('\n'));fd.append('page',location.href);fd.append('website',E.website.value);fd.append('t',String(Date.now()-t0));
if(E.photo.files&&E.photo.files[0]){var x=E.photo.files[0];if(x.size>10*1024*1024){return err('Photos only, up to 10 MB.');}fd.append('photo',x);}
var b=f.querySelector('.lst-go');b.disabled=true;var old=b.textContent;b.textContent='Sending…';
fetch('/wp-admin/admin-ajax.php',{method:'POST',body:fd,credentials:'same-origin'}).then(function(r){return r.json();}).then(function(j){if(j&&j.success){f.hidden=true;document.querySelector('.lst-ok').hidden=false;}else{err((j&&j.data&&j.data.message)||'Something went wrong. Please try again.');b.disabled=false;b.textContent=old;}}).catch(function(){err('Something went wrong. Please try again.');b.disabled=false;b.textContent=old;});
});
})();
每张Sleepm床垫都是通过家人朋友推荐的——他们就在您身边,说着您熟悉的语言,而且他们自己也在使用。我们提供分期付款服务。
(function(){ var cv=document.getElementById('dust'),cx=cv.getContext('2d'),W,H; function size(){W=cv.width=innerWidth;H=cv.height=innerHeight}size();addEventListener('resize',size); var P=[];var GOLD=[255,217,138],PERI=[159,176,255],WHITE=[240,243,255]; function spawn(x,y,opt){opt=opt||{};var c=[GOLD,PERI,WHITE][Math.random()*3|0]; P.push({x:x,y:y,vx:(Math.random()-.5)*(opt.sp||1.2),vy:(Math.random()-.5)*1.2,life:1,decay:.012+Math.random()*.02,s:opt.s||(1+Math.random()*2.2),c:c,tw:Math.random()*6.28});} addEventListener('mousemove',function(e){for(var i=0;i<3;i++)spawn(e.clientX+(Math.random()-.5)*10,e.clientY+(Math.random()-.5)*10,{sp:.9});}); setInterval(function(){spawn(Math.random()*W,Math.random()*H*.6,{sp:.3,s:1});},300); function loop(){cx.clearRect(0,0,W,H);cx.globalCompositeOperation='lighter'; for(var i=P.length-1;i>=0;i--){var p=P[i];p.x+=p.vx;p.y+=p.vy;p.life-=p.decay;p.tw+=.25; if(p.life<=0){P.splice(i,1);continue} var a=p.life*(.55+.45*Math.sin(p.tw)); var g=cx.createRadialGradient(p.x,p.y,0,p.x,p.y,p.s*3.2); g.addColorStop(0,'rgba('+p.c[0]+','+p.c[1]+','+p.c[2]+','+a+')');g.addColorStop(1,'rgba('+p.c[0]+','+p.c[1]+','+p.c[2]+',0)'); cx.fillStyle=g;cx.beginPath();cx.arc(p.x,p.y,p.s*3.2,0,6.28);cx.fill();} requestAnimationFrame(loop);}loop(); var io=new IntersectionObserver(function(es){es.forEach(function(e){if(e.isIntersecting)e.target.classList.add('awake');});},{threshold:.15}); document.querySelectorAll('.awaken').forEach(function(el){io.observe(el)}); })();
(function(){var btn=document.querySelector('.lb-btn');if(btn){btn.addEventListener('click',function(e){e.preventDefault();document.documentElement.classList.toggle('lbopen');});}var menu=document.querySelector('.lb-menu');if(menu){menu.addEventListener('click',function(){document.documentElement.classList.remove('lbopen');});}})();
(function(){var root=document.getElementById('lloydLang');if(!root)return;var btn=root.querySelector('.ll-btn');btn.addEventListener('click',function(e){e.stopPropagation();root.classList.toggle('ll-open');});document.addEventListener('click',function(){root.classList.remove('ll-open');});function sw(code){var done=false;if(window.Weglot){if(Weglot.switchTo){Weglot.switchTo(code);done=true;}}if(!done){var a=document.getElementById('weglot-language-'+code);if(a){a.click();}}}var opts=root.querySelectorAll('.ll-opt');opts.forEach(function(o){o.addEventListener('click',function(e){e.preventDefault();var code=o.getAttribute('data-wg');sw(code);var el=root.querySelector('.ll-cur');if(el){el.textContent=code.toUpperCase();}root.classList.remove('ll-open');});});function setCur(){var cur='';if(window.Weglot){if(Weglot.getCurrentLang){cur=Weglot.getCurrentLang();}}if(cur){var el=root.querySelector('.ll-cur');if(el){el.textContent=(''+cur).toUpperCase();}}}setTimeout(setCur,900);})();