How to use img method in wpt

Best JavaScript code snippet using wpt

imgLiquid.js

Source:imgLiquid.js Github

copy

Full Screen

1/*!2imgLiquid v0.9.944 / 03-05-20133jQuery plugin to resize images to fit in a container.4Copyright (c) 2012 Alejandro Emparan (karacas) @krc_ale5Dual licensed under the MIT and GPL licenses6https://github.com/karacas/imgLiquid7**/8/*9ex:10 $('.imgLiquid').imgLiquid({fill:true});11 // OPTIONS:12 > js:13 fill: true,14 verticalAlign: // 'center' // 'top' // 'bottom' // '50%' // '10%'15 horizontalAlign: // 'center' // 'left' // 'right' // '50%' // '10%'16 > CallBacks:17 onStart: function(){},18 onFinish: function(){},19 onItemStart: function(index, container, img){},20 onItemFinish: function(index, container, img){}21 > hml5 data attr (overwrite all)22 data-imgLiquid-fill='true'23 data-imgLiquid-horizontalAlign='center'24 data-imgLiquid-verticalAlign='center'25*/26//27var imgLiquid = imgLiquid || {VER: '0.9.944'};28imgLiquid.bgs_Available = false;29imgLiquid.bgs_CheckRunned = false;30imgLiquid.injectCss = '.imgLiquid img {visibility:hidden}';31(function ($) {32 // ___________________________________________________________________33 function checkBgsIsavailable() {34 if (imgLiquid.bgs_CheckRunned) return;35 else imgLiquid.bgs_CheckRunned = true;36 var spanBgs = $('<span style="background-size:cover" />');37 $('body').append(spanBgs);38 !function () {39 var bgs_Check = spanBgs[0];40 if (!bgs_Check || !window.getComputedStyle) return;41 var compStyle = window.getComputedStyle(bgs_Check, null);42 if (!compStyle || !compStyle.backgroundSize) return;43 imgLiquid.bgs_Available = (compStyle.backgroundSize === 'cover');44 }();45 spanBgs.remove();46 }47 // ___________________________________________________________________48 $.fn.extend({49 imgLiquid: function (options) {50 this.defaults = {51 fill: true,52 verticalAlign: 'center', // 'top' // 'bottom' // '50%' // '10%'53 horizontalAlign: 'center', // 'left' // 'right' // '50%' // '10%'54 useBackgroundSize: true,55 useDataHtmlAttr: true,56 responsive: true, /* Only for use with BackgroundSize false (or old browsers) */57 delay: 0, /* Only for use with BackgroundSize false (or old browsers) */58 fadeInTime: 0, /* Only for use with BackgroundSize false (or old browsers) */59 removeBoxBackground: true, /* Only for use with BackgroundSize false (or old browsers) */60 hardPixels: true, /* Only for use with BackgroundSize false (or old browsers) */61 responsiveCheckTime: 500, /* Only for use with BackgroundSize false (or old browsers) */ /* time to check div resize */62 timecheckvisibility: 500, /* Only for use with BackgroundSize false (or old browsers) */ /* time to recheck if visible/loaded */63 // CALLBACKS64 onStart: null, // no-params65 onFinish: null, // no-params66 onItemStart: null, // params: (index, container, img )67 onItemFinish: null, // params: (index, container, img )68 onItemError: null // params: (index, container, img )69 };70 checkBgsIsavailable();71 var imgLiquidRoot = this;72 // Extend global settings73 this.options = options;74 this.settings = $.extend({}, this.defaults, this.options);75 // CallBack76 if (this.settings.onStart) this.settings.onStart();77 // ___________________________________________________________________78 return this.each(function ($i) {79 // MAIN >> each for image80 var settings = imgLiquidRoot.settings,81 $imgBoxCont = $(this),82 $img = $('img:first',$imgBoxCont);83 if (!$img.length) {onError(); return;}84 // Extend settings85 if (!$img.data('imgLiquid_settings')) {86 // First time87 settings = $.extend({}, imgLiquidRoot.settings, getSettingsOverwrite());88 } else {89 // Recall90 // Remove Classes91 $imgBoxCont.removeClass('imgLiquid_error').removeClass('imgLiquid_ready');92 settings = $.extend({}, $img.data('imgLiquid_settings'), imgLiquidRoot.options);93 }94 $img.data('imgLiquid_settings', settings);95 // Start CallBack96 if (settings.onItemStart) settings.onItemStart($i, $imgBoxCont, $img); /* << CallBack */97 // Process98 if (imgLiquid.bgs_Available && settings.useBackgroundSize)99 processBgSize();100 else101 processOldMethod();102 // END MAIN <<103 // ___________________________________________________________________104 function processBgSize() {105 // Check change img src106 if ($imgBoxCont.css('background-image').indexOf(encodeURI($img.attr('src'))) === -1) {107 // Change108 $imgBoxCont.css({'background-image': 'url("' + encodeURI($img.attr('src')) + '")'});109 }110 $imgBoxCont.css({111 'background-size': (settings.fill) ? 'cover' : 'contain',112 'background-position': (settings.horizontalAlign + ' ' + settings.verticalAlign).toLowerCase(),113 'background-repeat': 'no-repeat'114 });115 $('a:first', $imgBoxCont).css({116 'display': 'block',117 'width': '100%',118 'height': '100%'119 });120 $('img', $imgBoxCont).css({'display': 'none'});121 if (settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img); /* << CallBack */122 $imgBoxCont.addClass('imgLiquid_bgSize');123 $imgBoxCont.addClass('imgLiquid_ready');124 checkFinish();125 }126 // ___________________________________________________________________127 function processOldMethod() {128 // Check change img src129 if ($img.data('oldSrc') && $img.data('oldSrc') !== $img.attr('src')) {130 /* Clone & Reset img */131 var $imgCopy = $img.clone().removeAttr('style');132 $imgCopy.data('imgLiquid_settings', $img.data('imgLiquid_settings'));133 $img.parent().prepend($imgCopy);134 $img.remove();135 $img = $imgCopy;136 $img[0].width = 0;137 // Bug ie with > if (!$img[0].complete && $img[0].width) onError();138 setTimeout(processOldMethod, 10);139 return;140 }141 // Reproceess?142 if ($img.data('imgLiquid_oldProcessed')) {143 makeOldProcess(); return;144 }145 // Set data146 $img.data('imgLiquid_oldProcessed', false);147 $img.data('oldSrc', $img.attr('src'));148 // Hide others images149 $('img:not(:first)', $imgBoxCont).css('display', 'none');150 // CSSs151 $imgBoxCont.css({'overflow': 'hidden'});152 $img.fadeTo(0, 0).removeAttr('width').removeAttr('height').css({153 'visibility': 'visible',154 'max-width': 'none',155 'max-height': 'none',156 'width': 'auto',157 'height': 'auto',158 'display': 'block'159 });160 // CheckErrors161 $img.on('error', onError);162 $img[0].onerror = onError;163 // loop until load164 function onLoad() {165 if ($img.data('imgLiquid_error') || $img.data('imgLiquid_loaded') || $img.data('imgLiquid_oldProcessed')) return;166 if ($imgBoxCont.is(':visible') && $img[0].complete && $img[0].width > 0 && $img[0].height > 0) {167 $img.data('imgLiquid_loaded', true);168 setTimeout(makeOldProcess, $i * settings.delay);169 } else {170 setTimeout(onLoad, settings.timecheckvisibility);171 }172 }173 onLoad();174 checkResponsive();175 }176 // ___________________________________________________________________177 function checkResponsive() {178 /* Only for oldProcessed method (background-size dont need) */179 if (!settings.responsive && !$img.data('imgLiquid_oldProcessed')) return;180 if (!$img.data('imgLiquid_settings')) return;181 settings = $img.data('imgLiquid_settings');182 $imgBoxCont.actualSize = $imgBoxCont.get(0).offsetWidth + ($imgBoxCont.get(0).offsetHeight / 10000);183 if ($imgBoxCont.sizeOld && $imgBoxCont.actualSize !== $imgBoxCont.sizeOld) makeOldProcess();184 $imgBoxCont.sizeOld = $imgBoxCont.actualSize;185 setTimeout(checkResponsive, settings.responsiveCheckTime);186 }187 // ___________________________________________________________________188 function onError() {189 $img.data('imgLiquid_error', true);190 $imgBoxCont.addClass('imgLiquid_error');191 if (settings.onItemError) settings.onItemError($i, $imgBoxCont, $img); /* << CallBack */192 checkFinish();193 }194 // ___________________________________________________________________195 function getSettingsOverwrite() {196 var SettingsOverwrite = {};197 if (imgLiquidRoot.settings.useDataHtmlAttr) {198 var dif = $imgBoxCont.attr('data-imgLiquid-fill'),199 ha = $imgBoxCont.attr('data-imgLiquid-horizontalAlign'),200 va = $imgBoxCont.attr('data-imgLiquid-verticalAlign');201 if (dif === 'true' || dif === 'false') SettingsOverwrite.fill = Boolean (dif === 'true');202 if (ha !== undefined && (ha === 'left' || ha === 'center' || ha === 'right' || ha.indexOf('%') !== -1)) SettingsOverwrite.horizontalAlign = ha;203 if (va !== undefined && (va === 'top' || va === 'bottom' || va === 'center' || va.indexOf('%') !== -1)) SettingsOverwrite.verticalAlign = va;204 }205 if (imgLiquid.isIE && imgLiquidRoot.settings.ieFadeInDisabled) SettingsOverwrite.fadeInTime = 0; //ie no anims206 return SettingsOverwrite;207 }208 // ___________________________________________________________________209 function makeOldProcess() { /* Only for old browsers, or useBackgroundSize seted false */210 // Calculate size211 var w, h, wn, hn, ha, va, hdif, vdif,212 margT = 0,213 margL = 0,214 $imgCW = $imgBoxCont.width(),215 $imgCH = $imgBoxCont.height();216 // Save original sizes217 if ($img.data('owidth') === undefined) $img.data('owidth', $img[0].width);218 if ($img.data('oheight') === undefined) $img.data('oheight', $img[0].height);219 // Compare ratio220 if (settings.fill === ($imgCW / $imgCH) >= ($img.data('owidth') / $img.data('oheight'))) {221 w = '100%';222 h = 'auto';223 wn = Math.floor($imgCW);224 hn = Math.floor($imgCW * ($img.data('oheight') / $img.data('owidth')));225 } else {226 w = 'auto';227 h = '100%';228 wn = Math.floor($imgCH * ($img.data('owidth') / $img.data('oheight')));229 hn = Math.floor($imgCH);230 }231 // Align X232 ha = settings.horizontalAlign.toLowerCase();233 hdif = $imgCW - wn;234 if (ha === 'left') margL = 0;235 if (ha === 'center') margL = hdif * 0.5;236 if (ha === 'right') margL = hdif;237 if (ha.indexOf('%') !== -1){238 ha = parseInt (ha.replace('%',''), 10);239 if (ha > 0) margL = hdif * ha * 0.01;240 }241 // Align Y242 va = settings.verticalAlign.toLowerCase();243 vdif = $imgCH - hn;244 if (va === 'top') margT = 0;245 if (va === 'center') margT = vdif * 0.5;246 if (va === 'bottom') margT = vdif;247 if (va.indexOf('%') !== -1){248 va = parseInt (va.replace('%',''), 10);249 if (va > 0) margT = vdif * va * 0.01;250 }251 // Add Css252 if (settings.hardPixels) {w = wn; h = hn;}253 $img.css({254 'width': w,255 'height': h,256 'margin-left': Math.floor(margL),257 'margin-top': Math.floor(margT)258 });259 // FadeIn > Only first time260 if (!$img.data('imgLiquid_oldProcessed')) {261 $img.fadeTo(settings.fadeInTime, 1);262 $img.data('imgLiquid_oldProcessed', true);263 if (settings.removeBoxBackground) $imgBoxCont.css('background-image', 'none');264 $imgBoxCont.addClass('imgLiquid_nobgSize');265 $imgBoxCont.addClass('imgLiquid_ready');266 }267 if (settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img); /* << CallBack */268 checkFinish();269 }270 // ___________________________________________________________________271 function checkFinish() { /* Check callBack */272 if ($i === imgLiquidRoot.length - 1) if (imgLiquidRoot.settings.onFinish) imgLiquidRoot.settings.onFinish();273 }274 });275 }276 });277})(jQuery);278// Inject css styles ______________________________________________________279!function () {280 var css = imgLiquid.injectCss,281 head = document.getElementsByTagName('head')[0],282 style = document.createElement('style');283 style.type = 'text/css';284 if (style.styleSheet) {285 style.styleSheet.cssText = css;286 } else {287 style.appendChild(document.createTextNode(css));288 }289 head.appendChild(style);...

Full Screen

Full Screen

js.js

Source:js.js Github

copy

Full Screen

1//scroll spy navbar2$('[data-spy="scroll"]').each(function () {3 var $spy = $(this).scrollspy('refresh')4})5//Portfolio gallery info6var portfolioImg = ["1", 7 "img/portfolio/2.jpg", 8 "img/portfolio/3.jpg", 9 "img/portfolio/4.jpg", 10 "img/portfolio/5.jpg", 11 "img/portfolio/6.jpg",12 "img/master-class.jpg",13 "img/our-team/monitor.jpg"14 ];15var portfolioBunch = ['<div class="item"><img class="img-responsive" src="img/portfolio/1.jpg"></div>',16 '<div class="item"><img src="img/portfolio/bunch/1.jpg"></div>',17 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/2.jpg"></div>',18 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/3.jpg"></div>',19 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/4.jpg"></div>',20 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/5.jpg"></div>',21 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/6.jpg"></div>',22 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/7.jpg"></div>',23 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/8.jpg"></div>',24 '<div class="item"><img class="img-responsive" src="img/portfolio/bunch/9.jpg"></div>'];25var portfolioWedDecore = ['<div class="item"><img src="img/portfolio/2.jpg"></div>',26 '<div class="item"><img src="img/portfolio/weddecore/1.jpg"></div>',27 '<div class="item"><img src="img/portfolio/weddecore/2.jpg"></div>',28 '<div class="item"><img src="img/portfolio/weddecore/3.jpg"></div>',29 '<div class="item"><img src="img/portfolio/weddecore/4.jpg"></div>',30 '<div class="item"><img src="img/portfolio/weddecore/5.jpg"></div>',31 '<div class="item"><img src="img/portfolio/weddecore/6.jpg"></div>',32 '<div class="item"><img src="img/portfolio/weddecore/7.jpg"></div>'];33var portfolioBouqet = ['<div class="item"><img class="img-responsive" src="img/portfolio/3.jpg"></div>',34 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/1.jpg"></div>',35 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/2.jpg"></div>',36 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/3.jpg"></div>',37 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/4.jpg"></div>',38 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/5.jpg"></div>',39 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/6.jpg"></div>',40 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/7.jpg"></div>',41 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/8.jpg"></div>',42 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/9.jpg"></div>',43 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/10.jpg"></div>',44 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/11.jpg"></div>',45 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/12.jpg"></div>',46 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/13.jpg"></div>',47 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/14.jpg"></div>',48 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/15.jpg"></div>',49 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/16.jpg"></div>',50 '<div class="item"><img class="img-responsive" src="img/portfolio/bouqet/17.jpg"></div>'];51var portfolioWedSetting = ['<div class="item"><img src="img/portfolio/4.jpg"></div>',52 '<div class="item"><img src="img/portfolio/registration/1.jpg"></div>',53 '<div class="item"><img src="img/portfolio/registration/2.jpg"></div>',54 '<div class="item"><img src="img/portfolio/registration/3.jpg"></div>',55 '<div class="item"><img src="img/portfolio/registration/4.jpg"></div>',56 '<div class="item"><img src="img/portfolio/registration/5.jpg"></div>',57 '<div class="item"><img src="img/portfolio/registration/6.jpg"></div>',58 '<div class="item"><img src="img/portfolio/registration/7.jpg"></div>',59 '<div class="item"><img src="img/portfolio/registration/8.jpeg"></div>',60 '<div class="item"><img src="img/portfolio/registration/9.jpeg"></div>',61 '<div class="item"><img src="img/portfolio/registration/10.jpg"></div>',62 '<div class="item"><img src="img/portfolio/registration/11.jpg"></div>',63 '<div class="item"><img src="img/portfolio/registration/12.jpg"></div>',64 '<div class="item"><img src="img/portfolio/registration/13.jpg"></div>'];65var portfolioPresent = ['<div class="item"><img src="img/portfolio/5.jpg"></div>',66 '<div class="item"><img src="img/portfolio/nypresents/1.jpg"></div>',67 '<div class="item"><img src="img/portfolio/nypresents/2.jpg"></div>',68 '<div class="item"><img src="img/portfolio/nypresents/3.jpg"></div>',69 '<div class="item"><img src="img/portfolio/nypresents/4.jpg"></div>',70 '<div class="item"><img src="img/portfolio/nypresents/5.jpg"></div>',71 '<div class="item"><img src="img/portfolio/nypresents/6.jpg"></div>',72 '<div class="item"><img src="img/portfolio/nypresents/7.jpg"></div>',73 '<div class="item"><img src="img/portfolio/nypresents/8.jpg"></div>',74 '<div class="item"><img src="img/portfolio/nypresents/9.jpg"></div>',75 '<div class="item"><img src="img/portfolio/nypresents/10.jpg"></div>'];76var portfolioNewYear = ['<div class="item"><img src="img/portfolio/6.jpg"></div>',77 '<div class="item"><img src="img/portfolio/newyear/1.jpg"></div>',78 '<div class="item"><img src="img/portfolio/newyear/2.jpg"></div>',79 '<div class="item"><img src="img/portfolio/newyear/3.jpg"></div>',80 '<div class="item"><img src="img/portfolio/newyear/4.jpg"></div>',81 '<div class="item"><img src="img/portfolio/newyear/5.jpg"></div>',82 '<div class="item"><img src="img/portfolio/newyear/6.jpg"></div>',83 '<div class="item"><img src="img/portfolio/newyear/7.jpg"></div>',84 '<div class="item"><img src="img/portfolio/newyear/8.jpg"></div>',85 '<div class="item"><img src="img/portfolio/newyear/9.jpg"></div>'];86var indicators = ['<li data-target="#carousel-example-generic" data-slide-to="0"></li>',87 '<li data-target="#carousel-example-generic" data-slide-to="1"></li>',88 '<li data-target="#carousel-example-generic" data-slide-to="2"></li>',89 '<li data-target="#carousel-example-generic" data-slide-to="3"></li>',90 '<li data-target="#carousel-example-generic" data-slide-to="4"></li>',91 '<li data-target="#carousel-example-generic" data-slide-to="5"></li>',92 '<li data-target="#carousel-example-generic" data-slide-to="6"></li>',93 '<li data-target="#carousel-example-generic" data-slide-to="7"></li>',94 '<li data-target="#carousel-example-generic" data-slide-to="8"></li>',95 '<li data-target="#carousel-example-generic" data-slide-to="9"></li>',96 '<li data-target="#carousel-example-generic" data-slide-to="10"></li>',97 '<li data-target="#carousel-example-generic" data-slide-to="11"></li>',98 '<li data-target="#carousel-example-generic" data-slide-to="12"></li>',99 '<li data-target="#carousel-example-generic" data-slide-to="13"></li>',100 '<li data-target="#carousel-example-generic" data-slide-to="14"></li>',101 '<li data-target="#carousel-example-generic" data-slide-to="15"></li>',102 '<li data-target="#carousel-example-generic" data-slide-to="16"></li>',103 '<li data-target="#carousel-example-generic" data-slide-to="17"></li>'];104var HTMLcarousel = '<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="0">' +105 '<ol class="carousel-indicators">'+106 '</ol>'+107 '<div class="carousel-inner" role="listbox">'+108 '</div>'+109 '</div>'+110 '<div><a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">'+111 '<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>'+112 '<span class="sr-only">Previous</span>'+113 '</a></div>'+114 '<div><a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">'+115 '<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>'+116 '<span class="sr-only">Next</span>'+117 '</a></div>';118//add gallery119$("div.overlay").click(function(){120 var img = $(this).siblings('img');121 var over = $('<div class="over">').css({122 'height': '100%',123 'width': '100%',124 'background': 'rgba(0,0,0,.82)',125 'display': 'flex',126 'justify-content':'center',127 'align-items': 'center',128 'position': 'fixed',129 'top': 0,130 'left': 0,131 'opacity': 0.0,132 'cursor': 'pointer',133 'z-index': 9999,134 'text-align': 'center',135 'margin': 'auto',136 });137 over.prepend("<div class='col-md-12 close text-right'><img src='img/close.png' class='pull-right'></div>"); 138 over.insertAfter(this).animate({139 'opacity': 1140 }, 300);141 over.children('.close').bind('click', function () {142 over.fadeOut(300, function () {143 over.remove();144 });145 });146 switch (img.attr('id')){147 case "1":148 over.append(HTMLcarousel);149 for (var i = 0 ; i<portfolioBunch.length; i++){150 $('.carousel-inner').append(portfolioBunch[i]);151 $('.item').first().addClass('active');152 $('.carousel-indicators').append(indicators[i]);153 $('li').first().addClass('active');154 console.log('Active' + portfolioBunch[i]);155 }156 break157 case "2":158 over.append(HTMLcarousel);159 for (var i = 0 ; i<portfolioWedDecore.length; i++){160 $('.carousel-inner').append(portfolioWedDecore[i]);161 $('.item').first().addClass('active');162 $('.carousel-indicators').append(indicators[i]);163 $('li').first().addClass('active');164 console.log('Active' + portfolioWedDecore[i]);165 } 166 break167 case "3":168 over.append(HTMLcarousel);169 for (var i = 0 ; i<portfolioBouqet.length; i++){170 $('.carousel-inner').append(portfolioBouqet[i]);171 $('.item').first().addClass('active');172 $('.carousel-indicators').append(indicators[i]);173 $('li').first().addClass('active');174 console.log('Active' + portfolioBouqet[i]);175 }176 break177 case "4":178 over.append(HTMLcarousel);179 for (var i = 0 ; i<portfolioWedSetting.length; i++){180 $('.carousel-inner').append(portfolioWedSetting[i]);181 $('.item').first().addClass('active');182 $('.carousel-indicators').append(indicators[i]);183 $('li').first().addClass('active');184 console.log('Active' + portfolioWedSetting[i]);185 } 186 break187 case "5":188 over.append(HTMLcarousel);189 for (var i = 0 ; i<portfolioPresent.length; i++){190 $('.carousel-inner').append(portfolioPresent[i]);191 $('.item').first().addClass('active');192 $('.carousel-indicators').append(indicators[i]);193 $('li').first().addClass('active');194 console.log('Active' + portfolioPresent[i]);195 }196 break197 case "6":198 over.append(HTMLcarousel);199 for (var i = 0 ; i<portfolioNewYear.length; i++){200 $('.carousel-inner').append(portfolioNewYear[i]);201 $('.item').first().addClass('active');202 $('.carousel-indicators').append(indicators[i]);203 $('li').first().addClass('active');204 console.log('Active' + portfolioNewYear[i]);205 }206 break207 case "7":208 var videoBig = $('<div class="videoYoutube">'+209 '<iframe width="400" height="600" ' +210 'src="https://www.youtube.com/embed/wQertIqpqNg?controls=0"></iframe>'+211 '</div>');212 over.append(videoBig);213 break214 case "8":215 var videoBig = $('<div class="videoYoutube">'+216 '<iframe width="400" height="600" ' +217 'src="https://www.youtube.com/embed/5LOPLYtFWH4?controls=0"></iframe>'+218 '</div>');219 over.append(videoBig);220 console.log("press");221 break222 }223 console.log(img);...

Full Screen

Full Screen

cards.js

Source:cards.js Github

copy

Full Screen

1import cardObjFactory from "./cardObjFactory";2import bashImg from "./img/Bash.png";3import neutralizeImg from "./img/Neutralize.png";4import zapImg from "./img/Zap.png";5import afterImageImg from "./img/AfterImage.png";6import eruptionImg from "./img/Eruption.png";7import vigilanceImg from "./img/Vigilance.png";8import bludgeonImg from "./img/Bludgeon.png";9import vaultImg from "./img/Vault.png";10import biasedCognitionImg from "./img/BiasedCognition.png";11import twinStrikeImg from "./img/TwinStrike.png";12import cutThroughFateImg from "./img/CutThroughFate.png";13import daggerSprayImg from "./img/DaggerSpray.png";14import clawImg from "./img/Claw.png";15import feelNoPainImg from "./img/FeelNoPain.png";16import noxiousFumesImg from "./img/NoxiousFumes.png";17import tempestImg from "./img/Tempest.png";18import sanctityImg from "./img/Sanctity.png";19import reaperImg from "./img/Reaper.png";20import envenomImg from "./img/Envenom.png";21import seekImg from "./img/Seek.png";22import ragnarokImg from "./img/Ragnarok.png";23import shrugItOffImg from "./img/ShrugItOff.png";24import cloakAndDaggerImg from "./img/CloakAndDagger.png";25import coolheadedImg from "./img/Coolheaded.png";26import consecrateImg from "./img/Consecrate.png";27const cards = (() => {28 const pool = [29 cardObjFactory(0, "Bash", bashImg, 8, 0, 2),30 cardObjFactory(1, "Neutralize", neutralizeImg, 3, 0, 0),31 cardObjFactory(2, "Zap", zapImg, 0, 0, 1),32 cardObjFactory(3, "After Image", afterImageImg, 0, 0, 1),33 cardObjFactory(4, "Eruption", eruptionImg, 9,0,2),34 cardObjFactory(5, "Vigilance", vigilanceImg, 0, 8, 2),35 cardObjFactory(6, "Bludgeon", bludgeonImg, 32, 0, 3),36 cardObjFactory(7, "Vault", vaultImg, 0,0,3),37 cardObjFactory(8, "Biased Cognition", biasedCognitionImg, 0,0,1),38 cardObjFactory(9, "Twin Strike", twinStrikeImg, 10,0,1),39 cardObjFactory(10, "Cut Through Fate", cutThroughFateImg, 7,0,1),40 cardObjFactory(11, "Dagger Spray", daggerSprayImg, 8,0,1),41 cardObjFactory(12, "Claw", clawImg, 3,0,0),42 cardObjFactory(13, "Feel No Pain", feelNoPainImg, 0,0,1),43 cardObjFactory(14, "Noxious Fumes", noxiousFumesImg, 0,0,1),44 cardObjFactory(15, "Tempest", tempestImg, 0,0,0),45 cardObjFactory(16, "Sanctity", sanctityImg, 0,6,1),46 cardObjFactory(17, "Reaper", reaperImg ,4,0,2),47 cardObjFactory(18, "Envenom", envenomImg, 0,0,2),48 cardObjFactory(19, "Seek", seekImg, 0,0,0),49 cardObjFactory(20, "Ragnarok", ragnarokImg , 25,0,3),50 cardObjFactory(21, "Shrug It Off", shrugItOffImg, 0,8,1),51 cardObjFactory(22, "Cloak And Dagger", cloakAndDaggerImg, 0,6,1),52 cardObjFactory(23, "Coolheaded", coolheadedImg, 0,0,1),53 cardObjFactory(24, "Consecrate", consecrateImg, 5,0,0),54 ]55 const untapAllCards = () => {56 pool.forEach((card) => {57 if (card.isTapped) {58 card.toggleTapped();59 }60 })61 }62 return {63 pool,64 get untappedPool() {65 return pool.filter((card) => !card.isTapped)66 },67 untapAllCards,68 }69})();...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log('Test status: ' + data.statusText);5 if (data.statusCode == 200) {6 console.log('Test completed, check results at: ' + data.data.userUrl);7 wpt.getTestResults(data.data.testId, function(err, data) {8 if (err) return console.error(err);9 console.log(data);10 });11 }12});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.page('Barack Obama').then(function(page) {3 page.img(200, 200).then(function(img) {4 console.log(img);5 });6});7var wptools = require('wptools');8wptools.page('Barack Obama').then(function(page) {9 page.img(200, 200, false).then(function(img) {10 console.log(img);11 });12});13var wptools = require('wptools');14wptools.page('Barack Obama').then(function(page) {15 page.img(200, 200, true).then(function(img) {16 console.log(img);17 });18});19var wptools = require('wptools');20wptools.page('Barack Obama').then(function(page) {21 console.log(img);22 });23});24var wptools = require('wptools');25wptools.page('Barack Obama').then(function(page) {26 console.log(img);27 });28});29var wptools = require('wptools');30wptools.page('Barack Obama').then(function(page) {31 console.log(img);32 });33});34var wptools = require('wptools');35wptools.page('Barack Obama').then(function(page) {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var img = wpt.img;3var options = {4};5img(options, function(err, data) {6 if (err) {7 console.log(err);8 } else {9 console.log(data);10 }11});12{ statusCode: 200,13 { statusCode: 200,

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var wiki = wptools.page('Barack Obama');3wiki.img(function(err, res) {4 console.log(res);5});6var wiki = require('wikijs').default;7wiki().page('Barack Obama').then(function(page) {8 return page.img();9}).then(function(data) {10 console.log(data);11});12var wptools = require('wptools');13var wiki = wptools.page('Barack Obama');14wiki.img(function(err, res) {15 console.log(res);16});17var wiki = require('wikijs').default;18wiki().page('Barack Obama').then(function(page) {19 return page.img();20}).then(function(data) {21 console.log(data);22});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful