/* 240x400 (4) */

/* Переменная 'info' необходима для указания юридической информации о компании */

var info = "<strong>[[ORD_LEGAL_NAME]]<br>ИНН: [[ORD_CLIENT_INN]]</strong>";

var trimLength = 32;

var showOldPrice = true;

/* Ниже этой строчки код редактировать не рекомендуется */

var linkFont=document.createElement("LINK");linkFont.rel="stylesheet",linkFont.href="https://fonts.googleapis.com/css2?family=PT+Sans&display=swap",document.getElementById(elementId).appendChild(linkFont);var custom_script=document.createElement("SCRIPT");custom_script.onload=function(){function enlarge(item){var that=$(item);$(that).addClass("item--upper item--fullsize"),$(that).find(".price").addClass("price--visible"),$(that).find(".button").addClass("button--visible")}function squeeze(item){var that=$(item);$(that).find(".button").removeClass("button--visible"),$(that).removeClass("item--fullsize"),$(that).find(".price").removeClass("price--visible"),setTimeout((function(){$(that).removeClass("item--upper")}),500)}$(document).ready((function(){if("ontouchstart"in document.documentElement)$(".item").click((function(){if($(this).hasClass("item--fullsize"))squeeze(this);else enlarge(this)}));else $(".item").on("mouseenter",(function(){var that=$(this),timer=setTimeout((function(){enlarge(that)}),600);$(that).on("mouseleave",(function(){if(clearTimeout(timer),$(that).hasClass("item--fullsize"))squeeze(that)}))}));$(".footer__disclaimer").hover((function(){$(".footer").addClass("footer--shorten"),$(".footer__about").hide()}),(function(){$(".footer").removeClass("footer--shorten"),$(".footer__about").show()}))}))},custom_script.type="text/javascript",custom_script.src="https://cdn.adhigh.net/jquery-3.6.0.min.js",custom_script.defer="defer",document.getElementById(elementId).appendChild(custom_script);var creative=function(){var container=document.createElement("div");return container.innerHTML='<div class="wrapper"><a class="logo" href="[[LANDING_PAGE]]" target="_blank"><img src="https://[[SITE_LOGO]]"></a><div class="content">'+goods(0,4)+'</div><div class="footer"><a class="footer__logo" href="https://getintent.com/" target="_blank"><span>Реклама</span><img class="pic" src="https://cdn.adhigh.net/banners/dynamic-template/logo-getintent.svg"></a><div class="footer__about"><span>Рекламодатель</span></div><div class="footer__disclaimer">'+info+"</div></div></div>",container.firstChild};function numberWithSpaces(x){return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}function priceDiv(price,oldprice){return'<div class="oldprice"><em>SALE</em><span>'+numberWithSpaces(oldprice)+'</span></div><div class="price">'+numberWithSpaces(price)+"</div>"}function goods(i,count){for(var goods="",c=0;c<count;c++){var itemName="no name model g:title";if(products[i+c].hasOwnProperty("name"))if(products[i+c].name)itemName=products[i+c].name;if(products[i+c].hasOwnProperty("model"))if(products[i+c].model)itemName=products[i+c].model;if(products[i+c].hasOwnProperty("g:title"))if(products[i+c]["g:title"])itemName=products[i+c]["g:title"];var shortenName=itemName;if(itemName.length>=trimLength)shortenName=itemName.substring(0,trimLength).trim()+"...";var price="",itemClass="item";if(void 0!==products[i+c].price&&"0"!=products[i+c].price)if(null!=products[i+c].oldprice&&showOldPrice&&products[i+c].oldprice!==products[i+c].price)itemClass="item item--sale",price=priceDiv(products[i+c].price,products[i+c].oldprice);else itemClass="item",price='<div class="price">'+numberWithSpaces(products[i+c].price)+"</div>";goods+='<a class="'+itemClass+'" href="'+products[i+c].url+'" target="_blank"><div class="top"><div class="pic"><img src="'+products[i+c].picture+'"/></div>'+price+'</div><div class="bottom"><span>'+shortenName+'</span><div class="button">Посмотреть</div></div></a>'}return goods}document.getElementById(elementId).appendChild(creative());


/* Переменные для настройки внешнего вида креатива */

:root {
  --itemBackgroundColor: #373737;
  --itemForegroundColor: #ebebeb;
  --itemAccentColor: #56ccf2;
  --salePriceBackgroundColor: #eb5757;

  --itemTextSize: 8px;
  --itemHoverTextSize: 15px;
  --saleTextSize: 9px;

  --buttonTextSize: 15px;
  --salePriceTextSize: 12px;
  --priceTextSize: 12px;
}

/* Ниже этой строчки код редактировать не рекомендуется */

:root{--itemDarkTextColor:#373737;--itemLightTextColor:#ebebeb;--buttonTextColor:#fff;--salePriceTextColor:#fff;--footerDuration:0.2s}*,:after,:before{box-sizing:border-box}body,html{margin:0;padding:0}.wrapper{text-wrap:balance;aspect-ratio:.6;border:1px solid var(--itemBackgroundColor);font-family:PT Sans,Arial,sans-serif;height:100%;left:50%;max-width:60vh;overflow:hidden;top:50%;transform:translate(-50%,-50%);width:100%;z-index:0}.logo,.wrapper{background-color:#fff;position:absolute}.logo{font-size:0;height:12%;right:4%;top:4%;transition:width .5s ease;z-index:1}.logo,.logo.logo--centered{width:92%}.logo img{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.content{height:72%;left:4%;top:20%;width:92%}.content,.item{position:absolute}.item{display:flex;flex-direction:column;height:calc(50% - 5px);justify-content:space-between;text-decoration:none;transition:all .5s ease;width:calc(50% - 5px)}.item:focus .top:before,.item:hover .top:before{background-image:linear-gradient(to bottom,var(--itemBackgroundColor),var(--itemBackgroundColor))}.item:focus .bottom,.item:hover .bottom{background-color:var(--itemBackgroundColor);color:var(--itemLightTextColor)}.item:focus .bottom>span:before,.item:hover .bottom>span:before{opacity:1;width:calc(100% - 2px)}.item.item--sale:focus .top:before,.item.item--sale:hover .top:before{background-image:linear-gradient(to bottom,var(--itemBackgroundColor),var(--itemBackgroundColor))}.item.item--sale .top:before{background-image:linear-gradient(to bottom,var(--salePriceBackgroundColor),var(--itemForegroundColor) 70%)}.item.item--upper{z-index:3}.item.item--fullsize{height:100%;width:100%}.item.item--fullsize .top:after,.item.item--fullsize .top:before{background-image:linear-gradient(180deg,#fff,#fff)!important}.item.item--fullsize .bottom{background-color:var(--itemBackgroundColor);padding-bottom:calc(var(--buttonTextSize)*2);padding-top:0}.item.item--fullsize .bottom span{color:var(--itemLightTextColor);font-size:var(--itemHoverTextSize);font-weight:400;padding:10px 4px}.item:first-child{left:0;top:0}.item:nth-child(2){right:0;top:0}.item:nth-child(3){bottom:0;left:0}.item:nth-child(4){bottom:0;right:0}.top{background-color:#fff;height:100%;overflow:hidden;padding:1px 1px 0;transition:height .5s ease,border .5s ease}.top,.top>*{position:relative}.top>*{z-index:2}.top .pic{background-color:#fff;border-top-left-radius:5px;border-top-right-radius:5px;height:100%}.top:before{height:100%;left:0;top:0;transition:all .6s ease;width:100%;z-index:0}.top:after,.top:before{background-image:linear-gradient(to bottom,var(--itemForegroundColor),var(--itemForegroundColor));border-radius:5px 5px 0 0;content:" ";position:absolute}.top:after{height:calc(100% - 1px);left:1px;top:1px;width:calc(100% - 2px);z-index:1}.top img{border-radius:4px 4px 0 0;height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.item--fullsize .oldprice{bottom:calc(var(--priceTextSize)*1.5 + .5em);height:calc(var(--salePriceTextSize)*1.5);padding:0 calc(var(--salePriceTextSize)*.2) 0 8px}.item--fullsize .oldprice em{opacity:0;position:absolute}.item--fullsize .oldprice span{opacity:1;position:static}.oldprice{background-color:var(--salePriceBackgroundColor);border-bottom-left-radius:50px;border-top-left-radius:50px;bottom:calc(100% - var(--saleTextSize) - 8px);color:var(--salePriceTextColor);display:flex;height:calc(var(--saleTextSize) + 4px);padding:2px 8px;position:absolute;right:0;text-align:right;transition:all .2s ease}.oldprice em{font-size:var(--saleTextSize);font-style:normal;font-weight:700;line-height:1}.oldprice span{font-size:var(--salePriceTextSize);line-height:1.5;opacity:0;position:absolute}.oldprice span:before{background-color:var(--salePriceTextColor);content:" ";height:calc(var(--salePriceTextSize)/8);left:5px;position:absolute;top:calc(var(--salePriceTextSize)/2 + var(--salePriceTextSize)/8);width:calc(100% - 8px)}.oldprice span:after{content:"₽";height:100%;margin-left:2px;right:4px;top:50%;transform:translateY(-50%);width:6px}.price{background-color:var(--itemBackgroundColor);border-bottom-left-radius:50px;border-top-left-radius:50px;bottom:5px;color:var(--itemLightTextColor);font-size:var(--priceTextSize);line-height:1.5;padding:0 4px 0 16px;position:absolute;right:-250%;text-align:right;transition:right .5s ease}.price:before{background-color:var(--itemAccentColor);border-radius:8px;content:" ";height:8px;left:4px;position:absolute;width:8px;z-index:2}.price:after,.price:before{top:50%;transform:translateY(-50%)}.price:after{content:"₽";height:18px;margin-left:2px;right:4px;width:6px}.price--visible{right:0}.bottom{background-color:var(--itemForegroundColor);color:var(--itemDarkTextColor);flex-grow:1;font-size:var(--itemTextSize);line-height:1.1;min-height:34px;overflow:hidden;padding:4px 0 6px;position:relative;text-align:center;transition:all .5s ease,background-color .5s ease,color .5s ease;width:100%}.bottom span{align-items:center;display:flex;flex-grow:1;height:100%;justify-content:center;padding:5px 2px 6px;transition:all .5s ease}.bottom span:before{border-radius:2px;bottom:1px;content:" ";height:2px;left:1px;opacity:0;transition:all .6s ease;width:2px;z-index:2}.bottom span:before,.button{background-color:var(--itemAccentColor);position:absolute}.button{bottom:-200%;color:var(--buttonTextColor);font-size:var(--buttonTextSize);height:calc(var(--buttonTextSize)*2);left:0;line-height:2;text-align:center;text-transform:uppercase;transition:all .5s ease;width:100%}.button.button--visible,.footer{bottom:0}.footer{align-items:flex-end;color:var(--itemLightTextColor);display:flex;font-size:9px;justify-content:space-between;left:0;line-height:16px;position:absolute;text-align:center;width:100%;z-index:3}.footer.footer--shorten:before{width:calc(100% - 185px)}.footer:before{bottom:0;content:" ";height:10px;left:0;position:absolute;transition:width var(--footerDuration) ease;width:100%;z-index:-1}.footer:before,.footer__logo{background-color:var(--itemBackgroundColor)}.footer__logo{border-top-right-radius:8px;color:inherit;height:16px;line-height:16px;overflow:hidden;padding:0 6px;position:relative;text-decoration:none;transition:all var(--footerDuration) ease;width:50px}.footer__logo:focus,.footer__logo:hover{height:8vh;width:46%}.footer__logo:focus span,.footer__logo:hover span{line-height:8vh;opacity:0}.footer__logo:focus .pic,.footer__logo:hover .pic{opacity:1}.footer__logo span{line-height:16px;transition:all var(--footerDuration) ease}.footer__logo .pic{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:opacity var(--footerDuration) ease;width:66%}.footer__about{background-color:var(--itemBackgroundColor);border-top-left-radius:8px;height:16px;line-height:16px;padding:0 6px;text-align:center;width:80px}.footer__about:focus,.footer__about:hover{opacity:0}.footer__about:focus+.footer__disclaimer,.footer__about:hover+.footer__disclaimer{opacity:1;transform:translate(0,0)}.footer__disclaimer{bottom:0;color:transparent;font-size:7px;line-height:10px;opacity:0;padding:12px 12px 16px;position:absolute;right:0;transform:translate(calc(100% - 80px),calc(100% - 16px));transition:all var(--footerDuration) ease,opacity .1s ease;width:185px;z-index:1}.footer__disclaimer:before{background-color:var(--itemBackgroundColor);border-top-left-radius:8px;content:" ";height:100%;left:0;opacity:.85;position:absolute;top:0;width:100%;z-index:-1}.footer__disclaimer:focus,.footer__disclaimer:hover{color:var(--itemLightTextColor);opacity:1;transform:translate(0,0)}.footer__disclaimer strong{font-size:9px;font-weight:400}.footer__disclaimer a{-webkit-font-smoothing:antialiased;color:#56ccf2}