plasticfuzz

T117_SV_Promotion_Games

May 1st, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="mm-t116-overlay"></div>
  2. <div class="mm-t116-prompt">
  3.     <div class="mm-t116-prompt__cross">
  4.         <div class="icon  icon--natural" data-icon=""></div>
  5.     </div>
  6.     <div class="mm-t116-prompt__header">
  7.         <div class="mm-t116-prompt__icon">
  8.             <i class="icon icon--natural" data-icon=""></i>
  9.         </div>
  10.     </div>
  11.     <div class="mm-t116-prompt__text"></div>
  12.     <div class="mm-t116-prompt__cta">
  13.         <div class="mm-t116-prompt__cta-btn">
  14.             DEPOSIT NOW
  15.         </div>
  16.     </div>
  17.     <div class="mm-t116-prompt__link">
  18.         <a class="mm-t116-prompt__link-inner">Don't show me this again</a>
  19.    </div>
  20. </div>
  21. <script>
  22.    ;
  23.    (function (campaign) {
  24.        campaign.renderVariant = function () {
  25.            this.content = document.createElement('div');
  26.            this.content.classList.add('mm-t116-content');
  27.  
  28.            this.content.innerHTML = mm_inner_HTML;
  29.  
  30.            this.content.querySelector('.mm-t116-prompt__header').innerHTML +=
  31.                this.varText[this.balanceType].header;
  32.  
  33.            this.content.querySelector('.mm-t116-prompt__text').innerHTML =
  34.                this.varText[this.balanceType].main
  35.                    .replace('${userFirstName}', this.userFirstName)
  36.                    .replace('${userBalance}', document.querySelector('[data-track-id="BalanceValue"]').innerHTML);
  37.  
  38.            document.querySelector('.wrap-all').appendChild(this.content);
  39.  
  40.            /**
  41.             * Cross handler
  42.             */
  43.            this.content.querySelector('.mm-t116-prompt__cross').addEventListener('click', function () {
  44.                this.removePrompt();
  45.                mmcore.mediator.trigger('mm-t116-click', {
  46.                    attr: 'close'
  47.                })
  48.            }.bind(this));
  49.  
  50.            /**
  51.             * Cta handler
  52.             */
  53.            this.content.querySelector('.mm-t116-prompt__cta-btn').addEventListener('click', function () {
  54.                this.removePrompt();
  55.  
  56.                try {
  57.                    window.SkyBetAccount.openDeposit();
  58.                } catch (e) {
  59.                }
  60.  
  61.                mmcore.mediator.trigger('mm-t116-click', {
  62.                    attr: 'deposit_cta'
  63.                })
  64.            }.bind(this));
  65.  
  66.  
  67.            /**
  68.             * Never show again handler
  69.             */
  70.            this.content.querySelector('.mm-t116-prompt__link-inner').addEventListener('click', function () {
  71.                this.removePrompt();
  72.                mmcore.SetCookie(this.DONT_SHOW_AGAIN, 1, 365, true);
  73.                mmcore.mediator.trigger('mm-t116-click', {
  74.                    attr: 'dont_show_again'
  75.                })
  76.            }.bind(this));
  77.  
  78.  
  79.            /**
  80.             *
  81.             */
  82.            this.depositMade = mmcore.mediator.on('deposit-w/o-acc-frame', function (data) {
  83.                this.removePrompt();
  84.            }.bind(this));
  85.  
  86.            setTimeout(function () {
  87.                document.documentElement.classList.add('mm-t116-visible');
  88.            }, 200); //Some timeout to let browser add elements to DOM and let transition work correctly
  89.  
  90.            this.content.addEventListener('touchmove', function (evt) {
  91.                evt.preventDefault();
  92.            });
  93.  
  94.            mmcore.SetCookie(this.POPUP_COOKIE_NAME, 1, 0, true);
  95.  
  96.            return (new mmcore.Deferred()).resolve().promise();
  97.        };
  98.  
  99.        campaign.removePrompt = function () {
  100.            document.documentElement.classList.remove('mm-t116-visible');
  101.  
  102.            mmcore.mediator.remove('deposit-w/o-acc-frame', this.depositMade.id);
  103.  
  104.            setTimeout(function () {
  105.                if (!this.content) {
  106.                    return;
  107.                }
  108.  
  109.                if (this.content.remove) {
  110.                    this.content.remove();
  111.                } else if (this.content.removeNode) {
  112.                    this.content.removeNode();
  113.                }
  114.            }.bind(this), 500); //Timeout is the same as animation duration in css transition
  115.        };
  116.  
  117.        campaign.varText = {
  118.            'low': {
  119.                header: 'You\'re running low on funds',
  120.                 main: 'Hey ${userFirstName},<br>it looks like you\'ve only got ${userBalance} to spend.<br>Why not top up now so you can keep playing?'
  121.             },
  122.             'zero': {
  123.                 header: 'Your balance is empty',
  124.                 main: 'Hey ${userFirstName},<br>it looks like you\'ve run out of funds.<br>Why not top up now so you can keep playing?'
  125.             }
  126.         };
  127.  
  128.         window.SkyBetAccount.bind('loggedOut', function() {
  129.             campaign.removePrompt();
  130.         });
  131.  
  132.         window.SkyBetAccount.bind('depositComplete', function(evt) {
  133.             campaign.removePrompt();
  134.         });
  135.  
  136.         })(this);
  137. </script>
  138. <style>
  139.     .mm-t116 .mobile-nav .mm-t116-content {
  140.         display: none;
  141.     }
  142.  
  143.     .mm-t116-content {
  144.         position: fixed;
  145.         width: 440px;
  146.         top: 160px;
  147.         right: 0;
  148.         color: white;
  149.         z-index: 97;
  150.     }
  151.  
  152.     .mm-t116-overlay {
  153.         display: none;
  154.     }
  155.  
  156.     .mm-t116-prompt {
  157.         width: 100%;
  158.         background-color: #0baeb0;
  159.         padding-bottom: 30px;
  160.         border-radius: 4px 0px 0px 4px;
  161.     }
  162.  
  163.     .mm-t116-prompt__cross {
  164.         position: absolute;
  165.         right: 10px;
  166.         top: 10px;
  167.         padding: 5px;
  168.         cursor: pointer;
  169.     }
  170.  
  171.     .mm-t116-prompt__icon {
  172.         display: inline-block;
  173.         margin-right: .5em;
  174.     }
  175.  
  176.     .mm-t116-prompt__header {
  177.         margin: 0 40px;
  178.         text-align: center;
  179.         padding-top: 15px;
  180.         font-size: 1.2em;
  181.     }
  182.  
  183.     .mm-t116-prompt__text {
  184.         margin: 20px;
  185.         text-align: center;
  186.         font-size: .8em;
  187.     }
  188.  
  189.     .mm-t116-prompt__cta {
  190.         text-align: center;
  191.     }
  192.  
  193.     .mm-t116-prompt__cta-btn {
  194.         display: inline-block;
  195.         padding: 10px 20px;
  196.         background-color: white;
  197.         color: red;
  198.         font-weight: bold;
  199.         border-radius: 5px;
  200.         cursor: pointer;
  201.     }
  202.  
  203.     .mm-t116-prompt__link-inner {
  204.         display: inline;
  205.         font-size: .8em;
  206.         text-decoration: underline;
  207.         cursor: pointer;
  208.     }
  209.  
  210.     .mm-t116-prompt__link {
  211.         text-align: center;
  212.         margin-top: 20px;
  213.     }
  214.  
  215.     @media only screen and (min-width: 740px) {
  216.         .mm-t116-prompt {
  217.             position: absolute;
  218.             right: -100%;
  219.  
  220.             -webkit-transition: right 0.5s;
  221.             -moz-transition: right 0.5s;
  222.             -ms-transition: right 0.5s;
  223.             transition: right 0.5s;
  224.         }
  225.  
  226.         .mm-t116.mm-t116-visible .mm-t116-prompt {
  227.             right: 0;
  228.         }
  229.  
  230.         .mm-t116.mm-t116-visible div[data-react-component="react/stickyTab/StickyTabGroup"] .sticky {
  231.             top: 410px;
  232.         }
  233.     }
  234.  
  235.     @media only screen and (max-width: 740px) {
  236.         .mm-t116.mm-t116-visible {
  237.             overflow: hidden;
  238.         }
  239.  
  240.         .mm-t116-content {
  241.             position: fixed;
  242.             top: 0px;
  243.             width: 100%;
  244.             height: 100%;
  245.             z-index: 90;
  246.         }
  247.  
  248.         .mm-t116-overlay {
  249.             display: block;
  250.             position: absolute;
  251.             top: 0px;
  252.             width: 100%;
  253.             height: 100%;
  254.  
  255.             background: rgba(0, 0, 0, 0.7);
  256.             opacity: 0;
  257.  
  258.             -webkit-transition: opacity 0.5s;
  259.             -moz-transition: opacity 0.5s;
  260.             -ms-transition: opacity 0.5s;
  261.             transition: opacity 0.5s;
  262.         }
  263.  
  264.         .mm-t116.mm-t116-visible .mm-t116-overlay {
  265.             opacity: 1;
  266.         }
  267.  
  268.         .mm-t116-prompt {
  269.             position: absolute;
  270.             background-color: #0baeb0;
  271.             padding-bottom: 30px;
  272.             bottom: -100%;
  273.  
  274.             border-radius: 0px;
  275.  
  276.             -webkit-transition: bottom 0.5s;
  277.             -moz-transition: bottom 0.5s;
  278.             -ms-transition: bottom 0.5s;
  279.             transition: bottom 0.5s;
  280.         }
  281.  
  282.         .mm-t116.mm-t116-visible .mm-t116-prompt {
  283.             bottom: 0%;
  284.         }
  285.     }
  286.  
  287.     @media only screen and (max-width: 360px) {
  288.         .mm-t116-prompt__header {
  289.             font-size: 1em;
  290.         }
  291.     }
  292. </style>
Add Comment
Please, Sign In to add comment