Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.53 KB | None | 0 0
  1. (function() {
  2. let apiEndpointBase = "https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=";
  3. let timer;
  4.  
  5. let gifs = JSON.parse(`{"amused":[{"src":"https://media.giphy.com/media/12aW6JtfvUdcdO/giphy.gif","votes":597},{"src":"https://media.giphy.com/media/128UMaujdjX7Pi/giphy.gif","votes":211},{"src":"https://media.giphy.com/media/PTrmNrpCfGBUY/giphy.gif","votes":344},{"src":"https://media.giphy.com/media/jGeuf0mcBdh3q/giphy.gif","votes":651},{"src":"https://media.giphy.com/media/RgfGmnVvt8Pfy/giphy.gif","votes":668},{"src":"https://media.giphy.com/media/S2whkd4LyloiI/giphy.gif","votes":657}],"angry":[{"src":"https://media.giphy.com/media/10juQ7fAaQjuHS/giphy.gif","votes":697},{"src":"https://media.giphy.com/media/XIS4ARkxVah4A/giphy.gif","votes":524},{"src":"https://media.giphy.com/media/133DKEhjAa8aUE/giphy.gif","votes":108},{"src":"https://media.giphy.com/media/3o7TKKCpy6Bez3QZZm/giphy.gif","votes":577},{"src":"https://media.giphy.com/media/dYHtDUl1VZ0ly/giphy.gif","votes":485}],"awww":[{"src":"https://media.giphy.com/media/A8o8R8bO6bn0s/giphy.gif","votes":341},{"src":"https://media.giphy.com/media/3oz8xLxN2efDL9TqKY/source.gif","votes":42},{"src":"https://media.giphy.com/media/NvwLXMoF3fUze/giphy.gif","votes":618},{"src":"https://media.giphy.com/media/3oEduPCZI5BIg4MKJy/giphy.gif","votes":299},{"src":"https://media.giphy.com/media/C53U0KQqiJxcs/giphy.gif","votes":605},{"src":"https://media.giphy.com/media/inJilkh3Y2ZLq/giphy.gif","votes":284}],"bored":[{"src":"https://media.giphy.com/media/3oz8xEgf0wV8UGL5y8/source.gif","votes":124},{"src":"https://media.giphy.com/media/NBb0DtalEEyMU/giphy.gif","votes":532},{"src":"https://media.giphy.com/media/p7UAjPDEglWes/giphy.gif","votes":302},{"src":"https://media.giphy.com/media/qc1waqAag4tZC/giphy.gif","votes":439},{"src":"https://media.giphy.com/media/l0Hlvwab19vuth4Sk/giphy.gif","votes":692},{"src":"https://media.giphy.com/media/4PvmF62Tl3KLe/giphy.gif","votes":474},{"src":"https://media.giphy.com/media/FZJVlQh2sLbzi/giphy.gif","votes":276},{"src":"https://media.giphy.com/media/Fy1Q32UY1FtpS/giphy.gif","votes":699}],"confused":[{"src":"https://media.giphy.com/media/CPskAi4C6WLHa/giphy.gif","votes":679},{"src":"https://media.giphy.com/media/LZaNrkOLxI5Yk/giphy.gif","votes":439},{"src":"https://media.giphy.com/media/l4JA1COQqiZB6/giphy.gif","votes":454},{"src":"https://media.giphy.com/media/JXZQIAy37ENJ6/giphy.gif","votes":491},{"src":"https://media.giphy.com/media/xT9KVAKutRHkplVknS/giphy.gif","votes":348},{"src":"https://media.giphy.com/media/CDJo4EgHwbaPS/giphy.gif","votes":469},{"src":"https://media.giphy.com/media/3o8doV1N84HlMbtAsw/giphy.gif","votes":637}],"crying":[{"src":"https://media.giphy.com/media/5WmyaeDDlmb1m/giphy.gif","votes":4},{"src":"https://media.giphy.com/media/xT8qB2lDLK6FE7vKr6/giphy.gif","votes":24},{"src":"https://media.giphy.com/media/3o7TKKKqQ7gSNT1vUI/giphy.gif","votes":8},{"src":"https://media.giphy.com/media/26ufcVAp3AiJJsrIs/giphy.gif","votes":445},{"src":"https://media.giphy.com/media/l2Sq90KFfdu6G2cVO/giphy.gif","votes":493},{"src":"https://media.giphy.com/media/3o6ZtqJrdaf9E09sJO/giphy.gif","votes":662},{"src":"https://media.giphy.com/media/a40Ct1VBvmoWQ/giphy.gif","votes":109},{"src":"https://media.giphy.com/media/26gJz5riNWpdiWPOE/giphy.gif","votes":58}],"dancing":[{"src":"https://media.giphy.com/media/YVoVTVZVhaVQA/giphy.gif","votes":428},{"src":"https://media.giphy.com/media/3o6ZtjK4uoq6p12JRm/giphy.gif","votes":625},{"src":"https://media.giphy.com/media/l0MYxzozahLP6uIkE/giphy.gif","votes":13},{"src":"https://media.giphy.com/media/SGjUlcZYnFs6Q/giphy.gif","votes":326},{"src":"https://media.giphy.com/media/l0HlOWpCtvk3ImJpe/giphy.gif","votes":510},{"src":"https://media.giphy.com/media/l0MYxBOEU1NCXFDFe/giphy.gif","votes":315},{"src":"https://media.giphy.com/media/xTiTnwUvLz08kJ5ZVm/giphy.gif","votes":15}],"disappointed":[{"src":"https://media.giphy.com/media/RtqZpccRVNtpm/giphy.gif","votes":378},{"src":"https://media.giphy.com/media/l2YWuUzmiCgSxDgDS/giphy.gif","votes":401},{"src":"https://media.giphy.com/media/uL0IQ1twFs9Pi/giphy.gif","votes":530},{"src":"https://media.giphy.com/media/3o7Zesyac4CuSN5rsA/giphy.gif","votes":124},{"src":"https://media.giphy.com/media/gh1PcN7Agxlcc/giphy.gif","votes":75},{"src":"https://media.giphy.com/media/vdgq3PzB13XLq/giphy.gif","votes":60},{"src":"https://giphy.com/gifs/hercules-disappointed-let-down-3oAt21Fnr4i54uK8vK/giphy.gif","votes":694},{"src":"https://media.giphy.com/media/2JBmA1Hdu39D2/giphy.gif","votes":452}],"disgusted":[{"src":"https://media.giphy.com/media/3FBwwRCNTSa52/giphy.gif","votes":265},{"src":"https://media.giphy.com/media/zzxbw9ccnXKUw/giphy.gif","votes":279},{"src":"https://media.giphy.com/media/KEshPjvCXyXsI/giphy.gif","votes":529},{"src":"https://media.giphy.com/media/3o6Zt0m6wIdUusxm92/giphy.gif","votes":5},{"src":"https://media.giphy.com/media/3o6ozqRf7D5jfFpOta/giphy.gif","votes":175},{"src":"https://media.giphy.com/media/QSMBLRAHZTLkQ/giphy.gif","votes":414},{"src":"https://media.giphy.com/media/yRHnExgzQ0iCA/giphy.gif","votes":54},{"src":"https://media.giphy.com/media/mpxvACn6oda7e/giphy.gif","votes":295}],"eye roll":[{"src":"https://media.giphy.com/media/CaAiKdJBVDkpG/giphy.gif","votes":590},{"src":"https://media.giphy.com/media/l0K47QoHwYHej94cw/giphy.gif","votes":12},{"src":"https://media.giphy.com/media/l4Ho1ozXBN6i7sTQY/giphy.gif","votes":423},{"src":"https://media.giphy.com/media/xT9KVhW0UPu8WOqRS8/giphy.gif","votes":454},{"src":"https://media.giphy.com/media/LRMRtUr1zeYnu/giphy.gif","votes":100},{"src":"https://media.giphy.com/media/l0NwPZ027mabR6Tg4/giphy.gif","votes":110},{"src":"https://media.giphy.com/media/3oAt2dA6LxMkRrGc0g/giphy.gif","votes":517}],"facepalm":[{"src":"https://media.giphy.com/media/xT0GqtpF1NWd9VbstO/giphy.gif","votes":663},{"src":"https://media.giphy.com/media/3o6Ztb3P192sKg0Tok/giphy.gif","votes":214},{"src":"https://media.giphy.com/media/3QGyuRd6TtaX6/giphy.gif","votes":656},{"src":"https://media.giphy.com/media/lDOGbvdZrOcr6/giphy.gif","votes":168},{"src":"https://media.giphy.com/media/3o7TKVA2GBgSgERhi8/giphy.gif","votes":321},{"src":"https://media.giphy.com/media/l2SpOJK6M1AOCtcl2/giphy.gif","votes":482},{"src":"https://media.giphy.com/media/GfAD7Bl016Gfm/giphy.gif","votes":441},{"src":"https://media.giphy.com/media/uL0IQ1twFs9Pi/giphy.gif","votes":494}],"hearts":[{"src":"https://media.giphy.com/media/l41lQWEdT0Shj2qWc/giphy.gif","votes":659},{"src":"https://media.giphy.com/media/p95cYiKb5FSVO/giphy.gif","votes":207},{"src":"https://media.giphy.com/media/1qeZ0y4gposYU/giphy.gif","votes":350},{"src":"https://media.giphy.com/media/O2GyyZ7CA6iBO/giphy.gif","votes":432},{"src":"https://media.giphy.com/media/3mo3WBFrvVTYk/giphy.gif","votes":228},{"src":"https://media.giphy.com/media/xTcnT2ZYSaCTdkTSmI/giphy.gif","votes":85},{"src":"https://media.giphy.com/media/xT1XGUxKBHHl6X3lxm/giphy.gif","votes":133}],"laughing":[{"src":"https://media.giphy.com/media/eSVZbakW0rgVa/giphy.gif","votes":336},{"src":"https://media.giphy.com/media/l0HlO4vdchLBZNxYc/giphy.gif","votes":303},{"src":"https://media.giphy.com/media/3o72F49qCMPNsjXGUM/giphy.gif","votes":307},{"src":"https://media.giphy.com/media/KiaU2EUyxjQB2/giphy.gif","votes":596},{"src":"https://media.giphy.com/media/xT4uQ8SOplUYBku9BS/giphy.gif","votes":202},{"src":"https://media.giphy.com/media/26BRJQZ3YE2pXxEqc/giphy.gif","votes":83},{"src":"https://media.giphy.com/media/11oRLY4FRk2s36/giphy.gif","votes":523}],"whatever":[{"src":"https://media.giphy.com/media/szoa39gBXpuEg/giphy.gif","votes":34},{"src":"https://media.giphy.com/media/i67uIY4a61ejm/giphy.gif","votes":27},{"src":"https://media.giphy.com/media/lXiRsXOUUUdfHCOOY/giphy.gif","votes":344},{"src":"https://media.giphy.com/media/l0HlxbPap7AC0VjMs/giphy.gif","votes":110},{"src":"https://media.giphy.com/media/mtlwOSac6agE0/giphy.gif","votes":601},{"src":"https://media.giphy.com/media/11lLn6lwsdicLK/giphy.gif","votes":156},{"src":"https://media.giphy.com/media/Ngu7v2fXqO9a/giphy.gif","votes":535},{"src":"https://media.giphy.com/media/UO95NWY0PmoWk/giphy.gif","votes":424}],"slow clap":[{"src":"https://media.giphy.com/media/12P29BwtrvsbbW/giphy.gif","votes":13},{"src":"https://media.giphy.com/media/ENagATV1Gr9eg/giphy.gif","votes":412},{"src":"https://media.giphy.com/media/6dJaim7ELSxmE/giphy.gif","votes":158},{"src":"https://media.giphy.com/media/3o6Ztfp1T1AukDGP4s/giphy.gif","votes":49},{"src":"https://media.giphy.com/media/ormDqLRfiaY1y/giphy.gif","votes":120},{"src":"https://media.giphy.com/media/26ufkNFQ5mFJHeTu0/giphy.gif","votes":642},{"src":"https://media.giphy.com/media/3o7TKrugYn6cXQAMTK/giphy.gif","votes":263}]}`);
  6.  
  7. let allGifs = (function(all) {
  8. let res = [];
  9. for (var key in all) {
  10. var value = all[key];
  11. res.push(...value);
  12. value.sort(function(a, b) {
  13. if (a["votes"] > b["votes"]) {
  14. return -1;
  15. }
  16. if (a["votes"] < b["votes"]) {
  17. return 1;
  18. }
  19. return 0;
  20. });
  21. }
  22.  
  23. return res;
  24. })(gifs);
  25.  
  26. allGifs.sort(function(a, b) {
  27. if (a["votes"] > b["votes"]) {
  28. return -1;
  29. }
  30. if (a["votes"] < b["votes"]) {
  31. return 1;
  32. }
  33. return 0;
  34. });
  35. let populars = allGifs.splice(0, 10);
  36.  
  37. let siblingSelector = "._tN._xHd.qxsd._T1i._U1i.mod";
  38. let siblings = document.querySelectorAll(siblingSelector);
  39. let parentSelector = "._BBh";
  40.  
  41. let container = buildContainer(gifs);
  42. let dialog = buildVoteDialog(gifs);
  43.  
  44. let newPanel = document.querySelector(parentSelector).insertBefore(container, siblings[siblings.length-1]);
  45. // let dialogPanel = document.querySelector(parentSelector).insertBefore(dialog, document.querySelector(siblingSelector));
  46.  
  47. newPanel.querySelector("._bfj._loj.iqeQZqPpX16E-nrHhR706PmE.gif-carousel-sk").innerHTML += populateTemplate(populars);
  48.  
  49. resgisterHandlers(newPanel);
  50.  
  51. function resgisterHandlers(parent) {
  52. let voteButton = parent.querySelector('#dialoge-sk');
  53. voteButton.addEventListener('click', (evnt) => {
  54.  
  55. document.querySelectorAll('body > div').forEach((element) => {
  56. if (!element.classList.contains('immersive-container')) {
  57. element.style.display = 'none';
  58.  
  59. } else {
  60.  
  61. element.querySelector('.g_a.o_c_d').innerHTML = buildVoteDialog(gifs).outerHTML;
  62. element.querySelector('.g_a.o_c_d').style.display = null;
  63. }
  64. });
  65. window.scrollTo(0, 0);
  66. }, false);
  67. }
  68.  
  69. function populateTemplate(giphies) {
  70. let carousel = "";
  71. for (let gif of giphies) {
  72. let itemTemplate = `<kp-carousel-item class="_cfh r-iQC1VMWH7sCs item-sk" style="height:100%;" jsl="$t t-v4eP75d0jhk;$x 0;" data-ved="0ahUKEwip6JD7vYrQAhVEOSYKHYZuDQYQlEsIjgEoADAV">
  73. <g-inner-card class="_KBh g_r g_n" style="position:relative;">
  74. <div class="r-izoLighDF3AA kno-fb-ctx kno-vrt-t" style="padding:0px;" >
  75. <div jsaction="r.pQzZTzKah2w" data-rtid="i6LYfhJRL4jQ" jsl="$t t-wjylZUtpWgQ;$x 0;" class="r-i6LYfhJRL4jQ">
  76. <div class="_eSg" style="background-color:#9D1907;height:160px;">
  77. <img id="uid_15" src="${gif.src}" class="_WCg" style="height:100%;" >
  78. </div>
  79. </div>
  80. </div>
  81. <div style="position:absolute;bottom:8px;left:10px;font-size: 16px;color: white;">${gif.votes} votes</div>
  82. </g-inner-card>
  83.  
  84. </kp-carousel-item>`;
  85. carousel += itemTemplate;
  86. }
  87. return carousel;
  88. }
  89.  
  90. function buildContainer(gifs) {
  91.  
  92. let categoryCarousels = [`<div class="_Fij category-sk selected" data-category-id="populars" style="width: auto;margin-right: 10px;padding: 3px 7px;border-radius: 10px;background-color:#e7e4e4;">all</div>`];
  93.  
  94. for (var key in gifs) {
  95. var value = gifs[key];
  96. let itemTemplate = `<div class="_Fij category-sk" data-category-id="${key}" style="cursor:pointer;width: auto;margin-right: 10px;padding: 3px 7px;border-radius: 10px;">${key}</div>`;
  97. categoryCarousels += itemTemplate;
  98. }
  99.  
  100. let mainContainer = document.createElement("div");
  101. mainContainer.classList.add(...
  102. "_tN _xHd qxsd _Gtj _eXg _aYg _T1i _U1i _Dzh _JAh mod".split(" "));
  103.  
  104. mainContainer.id = "main-sk";
  105. mainContainer.innerHTML = `
  106. <g-tray-header class="_Gij" style="display:flex;justify-content:space-between;align-items:flex-start;">
  107. <div class="_Fij">
  108. <span>
  109. Top voted reactions
  110. </span>
  111. <div class="g_k o_ek g_a o_hu_hy" role="presentation"><span class="g_a" style="color:#8f9193;">Images that show how google users feel</span></div>
  112. </div>
  113. <div id="dialoge-sk" style="display: flex;align-items: center;cursor:pointer;">
  114. <svg xmlns="http://www.w3.org/2000/svg" style="transform: scale(0.76,0.76);" width="24px" height="24px" viewBox="0 0 24 24" fill="#8f9193">
  115. <path d="M0 0h24v24H0z" fill="none"/>
  116. <path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"/>
  117. </svg>
  118. <div class="g_k o_ek g_a o_hu_hy" role="presentation"><span class="g_a" style="font-size:14px;color:#6d6e70;">Vote</span></div>
  119. </div>
  120. </g-tray-header>
  121.  
  122. <div class="_c4 _dzh" data-hveid="140" style="height:160px;">
  123. <div style="height:100%;">
  124. <kp-carousel class="_api r-ix2MjttiMaXE" jsl="$t t-gODZsIdS3ls;$x 0;" style="height:100%;">
  125. <g-scrolling-carousel class="ix2MjttiMaXE-Jw6f3f6IxI0 _yyh r-iqeQZqPpX16E" jsaction="ct_ia:r.hR-I1daEbkc;ct_ic:r.QrM9g6D_Qj8" style="height:100%"data-rtid="iqeQZqPpX16E" jsl="$t t-PCLVNAFUh1w;$x 0;">
  126. <div class="_JTg iqeQZqPpX16E-WI_562leVwQ carousel-scroller-sk" data-hveid="141" data-ved="0ahUKEwip6JD7vYrQAhVEOSYKHYZuDQYQlGsIjQEwFQ" style="overflow-x: auto;height:100%;">
  127. <div class="_bfj _loj iqeQZqPpX16E-nrHhR706PmE gif-carousel-sk" style="height:100%;padding-bottom:0px;">
  128. </div>
  129. <div class="_ESo"></div>
  130. </div>
  131. </g-scrolling-carousel>
  132. </kp-carousel>
  133. </div>
  134. </div>
  135. `;
  136.  
  137. return mainContainer;
  138. }
  139.  
  140. function buildVoteDialog(gifs) {
  141. let categoryCarousels = [];
  142. for (var key in gifs) {
  143. var value = gifs[key];
  144. let itemTemplate = `<div class="_Fij category-sk" data-category-id="${key}" style="cursor:pointer;border: 1px solid rgba(0, 0, 0, 0.156863);margin-bottom:10px;margin-right: 10px;padding: 7px 7px;border-radius: 3px;">${key}</div>`;
  145. categoryCarousels += itemTemplate;
  146. }
  147.  
  148. let dialogContainer = document.createElement("div");
  149. dialogContainer.id = "dialog-sk";
  150. dialogContainer.classList.add(...
  151. "o_pi g_a".split(" "));
  152. dialogContainer.style.backgroundColor = '#fff';
  153. dialogContainer.innerHTML = `<div class="g_a g_pk o_pi_pj" style="direction: ltr;">
  154. <div aria-hidden="false" class="g_a g_pl" style="position: static; display: block; transform: translate3d(0%, 0px, 0px);">
  155. <div class="o_pe o_oo g_a" data-hveid="27" data-ved="0ahUKEwiQlZbr29DQAhXJJcAKHdpIBCcQ33UIGw" style="min-height: 603px; margin-top: 0px;" tabindex="0">
  156. <div class="o_ke g_a" data-hveid="35" data-ved="0ahUKEwizgK3t5NDQAhXhhlQKHa1hBlwQgIUBCCMoAg" style="padding: 10px 24px;">
  157. <div class="g_a o_ke_kf" style="cursor: pointer;">
  158. <div class="g_a o_gh_gi">Vote reactions</div>
  159. <div class="g_a">
  160. <span class="g_a">Melancholia</span> <span class="g_a">(2011)</span>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="o_gj g_a" data-hveid="44" data-ved="0ahUKEwiQlZbr29DQAhXJJcAKHdpIBCcQ93AILCgE" style="margin-top: 0px; padding-bottom:12px;border-top: 1px solid rgba(0, 0, 0, 0.156863); transform-origin: 0px 0px 0px; transform: translate3d(0px, 0px, 0px); opacity: 0.999;">
  165. <div class="g_a" style="padding: 12px 24px;">
  166. Vote for the gifs that best show how you feel about the movie
  167. </div>
  168. <div>
  169. <kp-carousel class="_api r-ix2MjttiMaXE" jsl="$t t-gODZsIdS3ls;$x 0;">
  170. <g-scrolling-carousel class="ix2MjttiMaXE-Jw6f3f6IxI0 _yyh r-iqeQZqPpX16E" jsaction="ct_ia:r.hR-I1daEbkc;ct_ic:r.QrM9g6D_Qj8" data-rtid="iqeQZqPpX16E" jsl="$t t-PCLVNAFUh1w;$x 0;">
  171. <div class="_JTg iqeQZqPpX16E-WI_562leVwQ" data-hveid="141" data-ved="0ahUKEwip6JD7vYrQAhVEOSYKHYZuDQYQlGsIjQEwFQ" style="overflow-x: auto;">
  172. <div class="_bfj _loj iqeQZqPpX16E-nrHhR706PmE categories-sk" style="padding-left:30px;padding-bottom: 10px;font-family: Roboto-Regular,HelveticaNeue,Arial,sans-serif;">
  173. </div>
  174. </div>
  175. </g-scrolling-carousel>
  176. </kp-carousel>
  177. </div>
  178. </div>
  179. <div id="gifs-vote-sk" style="">
  180. </div>
  181. </div>
  182. </div>
  183. </div>`;
  184. dialogContainer.querySelector('.o_gj.g_a .categories-sk').innerHTML += categoryCarousels;
  185. /*categories.addEventListener("click", function(e) {
  186. let target = e.target || e.srcElement;
  187. if (target.classList.contains("category-sk") && !target.classList.contains("selected")) {
  188.  
  189.  
  190. for (let each of target.parentNode.querySelectorAll(".category-sk")) {
  191. each.classList.remove("selected");
  192.  
  193. each.style.backgroundColor = "transparent";
  194. }
  195. target.classList.add("selected");
  196. target.style.backgroundColor = "#e7e4e4";
  197. let newGifs;
  198. if (target.dataset.categoryId == "populars") {
  199. newGifs = populars;
  200. } else {
  201.  
  202. newGifs = gifs[target.dataset.categoryId];
  203. }
  204.  
  205. newPanel.querySelector("._bfj._loj.iqeQZqPpX16E-nrHhR706PmE.gif-carousel-sk").innerHTML = populateTemplate(newGifs);
  206. newPanel.querySelector(".carousel-scroller-sk").scrollLeft = 0;
  207.  
  208. }
  209. });*/
  210. dialogContainer.querySelector('#gifs-vote-sk').innerHTML += populateDialogeGiphies(gifs['angry']);
  211. return dialogContainer;
  212. }
  213.  
  214. function populateDialogeGiphies(giphies) {
  215. let carousel = "";
  216.  
  217. let rows = Math.floor(giphies.length / 2);
  218. let container = document.createElement('div');
  219.  
  220. for (let i = 0; i < rows; ++i) {
  221. if (i % 2 == 0) {
  222. container.innerHTML += `
  223. <div class="row-sk" style="display:flex; height:160px;">
  224. <div style="flex:0 1 55%;padding: 1px 1px;">
  225. <img id="uid_15" src="${giphies[2*i].src}" class="_WCg" style="height:100%;object-fit:cover; width:100%;" >
  226. </div>
  227. <div style="flex:0 1 45%;padding: 1px 1px;">
  228. <img id="uid_15" src="${giphies[2*i+1].src}" class="_WCg" style="height:100%;object-fit:cover; width:100%;" >
  229. </div>
  230. </div>
  231. `;
  232. } else {
  233. container.innerHTML += `
  234. <div class="row-sk" style="display:flex; height:160px;">
  235. <div style="flex:0 1 45%;padding: 1px 1px;">
  236. <img id="uid_15" src="${giphies[2*i].src}" class="_WCg" style="height:100%;object-fit:cover; width:100%;" >
  237. </div>
  238. <div style="flex:0 1 55%;padding: 1px 1px;">
  239. <img id="uid_15" src="${giphies[2*i+1].src}" class="_WCg" style="height:100%;object-fit:cover; width:100%;" >
  240. </div>
  241. </div>
  242. `;
  243. }
  244. }
  245. return container.outerHTML;
  246. }
  247. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement