$(function(){ const asset_root = window.location.origin+'/assets/images/perennial2023/'; const register_title = 'Win hotel stay at The Capitol Kempinski Hotel Singapore, products from Dyson, Sulwhasoo and more worth up to $11,000'; const prize_url = $('.nav-link[alt="Grand Prize"]').attr('href'); const game_title = 'Complete the Christmas Trail! Collect all 4 stamps and stand to win Grand Prizes worth up to $11,000!' $('.masthead-popup').each((k,v)=>{ $(v).insertAfter($(v).parents('.modal-content').find('.modal-close')) }) $('.nav-gradient').removeClass('nav-gradient'); // dropdown menu reorder const nav_order = [ 'Home', 'Grand Prize', 'Tutorial', 'Participating Outlets', 'Terms and Conditions', 'Frequently Asked Questions', 'Logout', ]; const $navs = $('.nav-item'); let new_nav = []; const $navParent = $('.navbar-nav'); nav_order.forEach((nav,id)=>{ console.log(nav) const $nav = $(`.nav-link[alt="${nav}"]`); if($nav.length){ new_nav.push($nav.parents('.nav-item')) } }); $navParent.html(new_nav); //registration page if(window.location.pathname==='/register' || window.location.pathname==='/login'){ // styling $('.bg-layer-img').attr('style',`background-position:50% 75% !important; background-image:url(${asset_root}bg.png)`); $('.main-section .text-center:first').text(register_title).attr('style','font-size: 1.05rem;color: rgb(34, 34, 34);margin: 1rem 0 2rem;'); $('label:not(.form-check-label)').css('color','#222'); $('body .masthead-main').css('height','400px'); $('#navbar-brand').hide(); } // home page if(['/','/home'].includes(window.location.pathname)){ $('.main-section .text-center:first h5').html(game_title); // styling $('.masthead-main').remove(); $('.user_name').parents('div:first').remove(); $('#popup_completed').find('[load_popup=popup_rewards]').text('Close').removeAttr('load_popup').attr('data-dismiss','modal'); // adjust bottom padding $('.align-items-center.d-flex.flex-center.justify-content-center.my-3').removeClass('my-3'); $('#referred_number').parents('.my-4:first').hide(); } // use voucher page if(window.location.pathname.includes('/use/')){ $('.main-masthead').hide(); $('.main-section').css('paddingTop','0'); $('#voucher_single').find('.default-font-color').removeClass('default-font-color').attr('style','color: #222 !important;'); $('.voucher_single-claimable').parents('.col-12:first').find('span:last').css('color','#222'); } })