splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name(module) {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `vendor-${packageName.replace('@', '')}`;
},
},
app: {
name: 'app',
enforce: true,
maxSize: 249856,
chunks: 'all',
},
},
},
module.exports = {
module: {
rules: [
{
test: /\.sss$/i,
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: {
"postcss-import": {},
"postcss-short": { prefix: "x" },
},
},
},
},
],
},
};
const BI = document.querySelectorAll('.BlockItems');
const b = document.querySelectorAll('.b');
const style1 = "background-color: white;"
const style2 = "animation: op100 ease 2s;"
let counter = 0;
const callback = (item, style) => item.setAttribute("style", style);
function clean() {
BI.forEach(item => callback(item, style2));
b.forEach(item => callback(item, style1));
}
function RS() {
counter >= BI.length - 1 ? 0 : counter += 1;
callback(BI[counter], `${style1}; display: none;`);
b[i].removeAttribute("style");
}
b.forEach((item, index) => {
item.addEventListener("click", () => {
counter = index;
callback(BI[index], style2);
callback(b[index], style1)
})
})
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
async defer>
var onloadCallback = function() {
grecaptcha.render('recaptcha', {
'sitekey' : 'key'
});
};</script>
onComplete: function(){
//настройки формы cf7, если необходимо
var widgetId = grecaptcha.render('conatiner_id');
grecaptcha.reset(widgetId);
},
<div class="captcha_wrapper"></div>
$.fancybox({
$.getScript("https://www.google.com/recaptcha/api.js");
onComplete: function(){
$(".captcha_wrapper").append("<div class='g-recaptcha' id='recaptcha' data-sitekey='your_key'></div>");
var widgetId = grecaptcha.render('recaptcha');
},
onCleanup: function(){
$('#recaptcha').remove();
}
});