templates/elements/popout-ad.html.twig line 85

Open in your IDE?
  1. <style>
  2.     .popout-ad {
  3.         max-height: 400px;
  4.         min-height: 200px;
  5.         position: fixed;
  6.         right: -510px;
  7.         display: flex;
  8.         flex-direction: row;
  9.         z-index: 15;
  10.         background: white;
  11.         bottom: 15%;
  12.         padding-right: 20px;
  13.         /*height: 120px;*/
  14.         box-shadow: -4px 9px 20px 0px #00000078;
  15.         transition: 1s ease-in-out;
  16.         cursor: pointer;
  17.         width: 565px;
  18.         max-height: 400px;
  19.         overflow: hidden;
  20.     }
  21.     .popout-ad:hover {
  22.         right: 0;
  23.     }
  24.     #rc-wrapper {
  25.         top: 0;
  26.         bottom: 0;
  27.         left: 0;
  28.         right: 0;
  29.         overflow: auto;
  30.         position: absolute;
  31.         display: flex;
  32.     }
  33.     #rc-center {
  34.         /*width: 300px;
  35.         height: 300px;*/
  36.         /*background-color: yellow;*/
  37.         /*margin: auto;*/
  38.     }
  39.     
  40.     @media (max-width: 767px) {
  41.         .popout-ad {
  42.             display: none;
  43.         }
  44.     }
  45. </style>
  46. {% if popout %}
  47.     <div class="popout-ad" id="poa-container">
  48.         <p class="standard-bg-dark" style="writing-mode:vertical-rl; transform: rotate(180deg); text-align:center; margin:0; padding:15px; color:white">
  49.             {% if popout.getDisplayTitle() %}
  50.                 {{ popout.getDisplayTitle() }}
  51.             {% else %}
  52.                 {% if customer %}
  53.                     {{ customer.getTitle() }}
  54.                 {% endif %}
  55.             {% endif %}
  56.         </p>
  57.         <div class="row" style="width:100%">
  58.             <div class="col-sm-4">
  59.                 <div style="height:100%; display: flex; flex-direction: column; justify-content: center; align-items: center;">
  60.                     {% if popout.getMedia() %}
  61.                         {{ popout.getMediaImageTag("", "width: 100%; margin: 15px 5px; height: fit-content;")|raw }}
  62.                     {% elseif customer and customer.getMedia() %}
  63.                         {% if popout.getExternalUrl() %}
  64.                             <a href="{{popout.getExternalUrl()}}" data-mitem-id="{{popout.getId()}}">
  65.                         {% endif %}
  66.                         {{ customer.getMedia().getImageTag("", "width: 100%; margin: 15px 5px; height: fit-content", popout.getId())|raw }}
  67.                         {% if popout.getExternalUrl() %}
  68.                             </a>
  69.                         {% endif %}
  70.                     {% endif %}
  71.                 </div>
  72.             </div>
  73.             <div class="col-sm-8">
  74.                 <div id="rc-wrapper">
  75.                     <div id="rc-center">
  76.                         {% if popout.getPopOutPoll() and popout.getPopOutPoll().isReallyActive() %}
  77.                             {#<div id="popout-poll" class="home-poll home-poll-rcs" style="margin-bottom:15px;">#}
  78.                             <div id="home-poll" class="home-poll home-poll-rcs" style="margin-bottom:15px;">
  79.                                 {{ "[poll site='RoofCoffeeShop' id='#{popout.getPopOutPoll().getId()}' directory='yes']" | wordpress | raw }}
  80.                             </div>
  81.                             <div id="pollReplacementAd" style="display:none;">
  82.                                 <p>{{popout.getDescription() | wordpress | raw}}</p>
  83.                             </div>
  84.                         {% else %}
  85.                             <p>{{popout.getDescription() | wordpress | raw}}</p>
  86.                             {#{% if customer.getDirectoryContent() %}
  87.                                 <a href="{{customer.getDirectoryContent().getURL()}}">Learn More</a>
  88.                             {% endif %}#}
  89.                         {% endif %}
  90.                     </div>
  91.                 </div>
  92.             </div>
  93.         </div>
  94.     </div>
  95. {% else %}
  96.     
  97. {#
  98.     <div class="popout-ad" id="poa-container">
  99.         <p style="writing-mode:vertical-rl; transform: rotate(180deg); padding-bottom:10px; text-align:center;">RoofersCoffeeShop®</p>
  100.         <div  class="row">
  101.             <div class="col-md-5">
  102.                 <img src="https://www.rooferscoffeeshop.com/assets/img/Roofers-Coffee-Shop-Logo-R.png" alt="" style="margin-top:60px" />
  103.             </div>
  104.             <div class="col-md-7">
  105.                 <div id="part1" style="margin-top:25px;">
  106.                     <p>How likely are you to recommend us to a friend or colleague?</p>
  107.                     <p><input id="pi_input" type="range" class="slider" min="0" max="10" step="1" style="width:100%;"/></p>
  108.                     <div  class="row">
  109.                         <div class="col-md-6" style="font-size:16px;padding-left:40px;">
  110.                             Rating: <output id="value"></output>
  111.                         </div>
  112.                         <div class="col-md-6">
  113.                             <input type="buttom" class="button" value="Submit" id="popSubmit" style="width:100px;">
  114.                         </div>
  115.                     </div>
  116.                 </div>
  117.                 <div id="part2" style="display:none">
  118.                     <div style="margin-top:50px;">
  119.                         <h3>Thank you for your feedback!</h3>
  120.                         <p>Visit the <a href="/our-directory">RCS Directory</a> to see more from our partners!</p>
  121.                     </div>
  122.                 </div>
  123.             </div>
  124.         </div>
  125.     </div>
  126. <style>
  127. .slider {
  128.   -webkit-appearance: none;
  129.   width: 100%;
  130.   height: 10px;
  131.   background: #d3d3d3;
  132.   outline: none;
  133.   opacity: 0.7;
  134.   -webkit-transition: .2s;
  135.   transition: opacity .2s;
  136. }
  137. .slider:hover {
  138.   opacity: 1;
  139. }
  140. .slider::-webkit-slider-thumb {
  141.   -webkit-appearance: none;
  142.   appearance: none;
  143.   width: 20px;
  144.   height: 20px;
  145.   background: #a41822;
  146.   cursor: pointer;
  147. }
  148. </style>
  149.     <script>
  150.         (function ($) {
  151.             $(function () {
  152.                 //Temp default pop-out
  153.                 const value = document.querySelector("#value")
  154.                 const input = document.querySelector("#pi_input")
  155.                 value.textContent = input.value
  156.                 input.addEventListener("input", (event) => {
  157.                 value.textContent = event.target.value
  158.                 })
  159.                 $('#popSubmit').click(function() {
  160.                     $('#part1').hide();
  161.                     $('#part2').show();
  162.                 });
  163.             });
  164.         }(jQuery));
  165.     </script>
  166.     #}
  167. {% endif %}
  168.  <script>
  169.     (function ($) {
  170.         $(function () {
  171.             //Adjust height of pop-out ad
  172.             $('#poa-container').height($('#rc-center').height()) ;
  173.         });
  174.     }(jQuery));
  175. </script>