How would you love to win R5 000 in bobBucks this Valentine’s Day? Tell us what makes you and your loved one click, and we could help you #loveyourway. var submitted = false; function validateEntryForm() { setTimeout(unshake, 250); var entry_form_first_name = document.forms["entry_love_your_way"]["first_name_love_your_way"].value; var entry_form_email_love_your_way = document.forms["entry_love_your_way"]["email_love_your_way"].value; var entry_form_how_do_you_love_your_way = document.forms["entry_love_your_way"]["how_do_you_love_your_way"].value; if (entry_form_first_name == "" || entry_form_email_love_your_way == "" || entry_form_how_do_you_love_your_way == "") { document.getElementById('submit_love_your_way').classList.add("shake"); return; } else { document.getElementById('submit_love_your_way').classList.add("loading"); document.getElementById('submit_love_your_way').innerHTML = "Submitting #loveyourway..."; } function unshake() { document.getElementById('submit_love_your_way').classList.remove("shake"); } } First name Email How do you #loveyourway? Enter now Connect with us Terms and conditions apply. header { z-index: 999 } canvas { overflow: hidden; z-index: 100; top: 0; right: 0; bottom: 0; left: 0; margin: 0 auto; height: 200%; transform: scale3d(.5, .35, .25); transform-origin: top left; position: absolute !important; width: 200% } #connect_with_us>p { font-size: 1.5rem; margin: 0; } #connect_with_us.success { display: block !important } #connect_with_us>a>i.fab { padding: 1rem; cursor: pointer; font-size: 1.5rem; color: white } #connect_with_us>a>i.fab:hover { background: rgba(0, 0, 0, 0.2) } .valentines { display: block; margin: 2rem auto 0 auto; height: auto; box-sizing: border-box; padding: 4rem 4% 2rem 4%; max-width: 1280px; width: 100%; background: linear-gradient(103deg, #f6bbb9 0%, #f6bbb9 50%, transparent calc(50% + 1px), transparent 100%), url(https://img.bidorbuy.co.za/image/upload/f_auto,q_auto:eco/user_images/site_images/200128131401_bg.jpg) center / cover no-repeat; text-align: center; overflow: hidden; font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif; } .valentines .heart { width: 1rem; height: 1rem; display: block } .valentines h2 { font-size: 2.5rem !important; max-width: 80%; margin: 0 auto; font-weight: 600 } .valentines h3 { font-weight: 500 } .valentines>div { margin: 0 auto; max-width: 64rem; } .love_your_way, .valentines>div>form { box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); max-width: 64rem; margin: 0 auto } .love_your_way { height: auto; width: 100%; background: #f08e8b; position: relative; box-sizing: border-box; text-align: center; z-index: 0; } .win_bobbucks { height: auto; width: 100%; position: relative; box-sizing: border-box; text-align: center; z-index: 0; padding: 4rem 2rem; position: relative; z-index: 998 } .love_your_way>img { margin: -3rem 0 0 1%; width: 99%; } .love_your_way:before { content: ""; width: calc(100% - 4rem - 5px); height: calc(100% - 4rem); display: block; border: 5px solid white; position: absolute; z-index: -1; margin: 2rem; background: #f08e8b; box-sizing: border-box } .love_your_way:after { content: ""; width: calc(100% - 4rem - 5px); height: calc(100% - 4rem); display: block; border: 5px solid white; border-width: 0 5px 5px 0; position: absolute; z-index: 1; margin: 2rem; top: 0; box-sizing: border-box } #entry_love_your_way { background: white; width: 100%; height: auto; padding: 0 0 2rem 0; box-sizing: border-box; margin: 0 0 8rem 0; display: flex; flex-flow: row wrap; justify-content: center; z-index: 998; position: relative; } #entry_love_your_way>div { width: 100%; text-align: left; padding: 0 2rem; display: flex; flex-flow: row nowrap; } #entry_love_your_way>div>label { min-width: 27.5%; line-height: 2.5 } #entry_love_your_way>div { margin: .5rem 0; } #entry_love_your_way>div>input, #entry_love_your_way>div>textarea { border: 2px solid #f08e8b; line-height: 2; display: flex; width: 100%; font-size: 1rem; padding: 0 .75rem; font-weight: 700; color: #f08e8b } #entry_love_your_way>div>input:focus, #entry_love_your_way>div>textarea:focus { outline: none; border: 4px solid black; padding: 0 calc(.75rem - 2px); color: black; } #submit_love_your_way:active { outline: none; background: black; } #entry_love_your_way>div>textarea:focus { padding-top: calc(.6rem - 2px) } #entry_love_your_way>div>textarea { resize: none; height: 4rem; line-height: 1; padding-top: .6rem } #entry_love_your_way>div:first-of-type>input, #entry_love_your_way>div:last-of-type>input { margin: 0 } #submit_love_your_way { border: 4px solid black; line-height: 1; padding: 1rem; background: white; font-size: 1.5rem; font-weight: 700; margin: 4rem 0 -8rem 0; width: 12rem; white-space: nowrap; transition: all .5s ease-out; text-align: center; overflow: hidden; background-position: center left 0; position: relative; z-index: 0; box-sizing: border-box; cursor: pointer } #submit_love_your_way:disabled { cursor: auto } .shake { animation: shake .25s 0s ease-in forwards; } .loading { width: 100% !important; display: block; cursor: progress; } .success { width: 100% !important; background: #248c7c !important; color: white; border-color: #248c7c !important; } .loading:before { content: "Submitting #loveyourway..."; color: white; position: absolute; background: #f08e8b; padding: 1rem; animation: loading 2s 0s cubic-bezier(.1, 1.1, .5, .5) forwards; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; box-sizing: border-box; white-space: nowrap; overflow: hidden; cursor: progress } @keyframes loading { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } } @keyframes shake { 0% { cursor: not-allowed; transform: translate3d(0, 0, 0) } 33% { transform: translate3d(.25rem, 0, 0); border-color: #e72e5d; color: #e72e5d } 66% { transform: translate3d(-.125rem, 0, 0); border-color: #e72e5d; color: #e72e5d } 100% { transform: translate3d(0, 0, 0) } } @media (max-width:62rem) { canvas { transform: scale3d(.5, .35, .25) !important } #connect_with_us>p { font-size: 1rem!important } .valentines { padding: 3rem 4% 3rem 4% !important } .love_your_way:after { width: 100% !important } .love_your_way { background: transparent !important } .love_your_way>img { margin: -1rem -1rem 0 -2rem !important; width: calc(100% + 6px) !important; object-fit: cover; height: 76vw; object-position: left; padding-bottom: 6px } .love_your_way:before { width: 100% !important; height: 100% !important; margin: 0 !important; } .love_your_way:after { display: none !important } #submit_love_your_way { width: 100%; margin: 2.5rem 0 -7rem 0 !important; line-height: 1.75 !important; } #entry_love_your_way>div { flex-flow: row wrap; padding: 0 1rem } .loading { white-space: normal !important; line-height: 1.75 !important; font-size: 1rem !important; } .success { width: 100% !important; background: #248c7c !important; color: white; border-color: #248c7c !important; line-height: 1.75 !important; font-size: 1rem !important; } .valentines h2 { max-width: 100%; } } window.onload = function() { //canvas init var canvas = $('canvas')[0]; var ctx = canvas.getContext("2d"); //canvas dimensions var W = window.innerWidth; var H = window.innerHeight * 2; canvas.width = W; canvas.height = H; //snowflake particles var mp = 8; //max particles var particles = []; for (var i = 0; i < mp; i++) { particles.push({ x: Math.random() * W, //x-coordinate y: Math.random() * H, //y-coordinate r: Math.random() * 4 + 1, //radius d: Math.random() * mp * 2 //density }) } //Lets draw the flakes function draw() { ctx.clearRect(0, 0, W, H); ctx.fillStyle = "rgba(0, 0, 0, 1)"; ctx.beginPath(); for (var i = 0; i < mp; i++) { var p = particles[i]; ctx.moveTo(p.x, p.y); ctx.font = '20px arial'; ctx.fillText("🖤", p.x, p.y); } ctx.fill(); update(); } //Function to move the snowflakes //angle will be an ongoing incremental flag. Sin and Cos functions will be applied to it to create vertical and horizontal movements of the flakes var angle = 0; function update() { angle += 0.01; for (var i = 0; i < mp; i++) { var p = particles[i]; //Updating X and Y coordinates //We will add 1 to the cos function to prevent negative values which will lead flakes to move upwards //Every particle has its own density which can be used to make the downward movement different for each flake //Lets make it more random by adding in the radius p.y += Math.cos(angle + p.d) + 1 + p.r / 2; p.x += Math.sin(angle) * 2; //Sending flakes back from the top when it exits //Lets make it a bit more organic and let flakes enter from the left and right also. if (p.x > W + 5 || p.x < -5 || p.y > H) { if (i % 3 > 0) //66.67% of the flakes { particles[i] = { x: Math.random() * W, y: -10, r: p.r, d: p.d }; } else { //If the flake is exitting from the right if (Math.sin(angle) > 0) { //Enter from the left particles[i] = { x: -5, y: Math.random() * H, r: p.r, d: p.d }; } else { //Enter from the right particles[i] = { x: W + 5, y: Math.random() * H, r: p.r, d: p.d }; } } } } } //animation loop setInterval(draw, 25); }