Skip to content

Commit

Permalink
UPD:FIX:10.06.2024:19:30 => Миграция до gulp v5.0.0 + обновление неко…
Browse files Browse the repository at this point in the history
…торых зависимостей разработки + обновление скрипта кошки мышки.
  • Loading branch information
Ko2doo committed Jun 10, 2024
1 parent f31f028 commit 51b8150
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 37 deletions.
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@
},
"homepage": "https://github.com/Template-Craft/gulp-nunjucks-starter-kit#readme",
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/eslint-parser": "^7.22.15",
"@babel/preset-env": "^7.22.20",
"@babel/register": "^7.22.15",
"@types/archiver": "^6.0.1",
"@types/gulp": "^4.0.14",
"@types/gulp-clean-css": "^4.3.2",
"@types/gulp-concat": "^0.0.35",
"@types/gulp-plumber": "^0.0.35",
"@types/gulp-postcss": "^8.0.4",
"@types/gulp-rename": "^2.0.3",
"@types/node-notifier": "^8.0.3",
"@types/webpack-stream": "^3.2.13",
"@types/yargs": "^17.0.26",
"archiver": "^6.0.1",
"autoprefixer": "^10.4.16",
"@babel/core": "^7.24.7",
"@babel/eslint-parser": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/register": "^7.24.6",
"@types/archiver": "^6.0.2",
"@types/gulp": "^4.0.17",
"@types/gulp-clean-css": "^4.3.4",
"@types/gulp-concat": "^0.0.37",
"@types/gulp-plumber": "^0.0.37",
"@types/gulp-postcss": "^8.0.6",
"@types/gulp-rename": "^2.0.6",
"@types/node-notifier": "^8.0.5",
"@types/webpack-stream": "^3.2.15",
"@types/yargs": "^17.0.32",
"archiver": "^7.0.1",
"autoprefixer": "^10.4.19",
"babel-loader": "^9.1.3",
"browser-sync": "^2.29.3",
"browser-sync": "^3.0.2",
"chalk": "^5.3.0",
"concat": "^1.0.3",
"cssnano": "^6.0.1",
"cssnano-preset-advanced": "^6.0.1",
"cssnano": "^7.0.2",
"cssnano-preset-advanced": "^7.0.2",
"del": "^7.1.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -98,25 +98,25 @@
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-promise": "^6.1.1",
"gulp": "^4.0.2",
"gulp": "^5.0.0",
"gulp-beautify": "^3.0.0",
"gulp-concat": "^2.6.1",
"gulp-if": "^3.0.0",
"gulp-newer": "^1.4.0",
"gulp-notify": "^4.0.0",
"gulp-nunjucks-render": "^2.2.3",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.1",
"gulp-postcss": "^10.0.0",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.4",
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"node-notifier": "^10.0.1",
"postcss": "^8.4.31",
"postcss": "^8.4.38",
"postcss-sort-media-queries": "^5.2.0",
"prettier": "^3.0.3",
"sass": "^1.68.0",
"webpack": "^5.88.2",
"prettier": "^3.3.1",
"sass": "^1.77.4",
"webpack": "^5.91.0",
"webpack-stream": "^7.0.0",
"yargs": "^17.7.2"
},
Expand Down
31 changes: 23 additions & 8 deletions src/scripts/main/modules/buttons.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
/* eslint-disable camelcase */
/* eslint-disable no-unused-expressions */
'use strict';

export const btnCardAnimals = () => {
let cat_count = 2;
let mouse_count = 4;

const getButton = document.querySelector('.js-btn__card-animals');
const getCardItem = document.querySelector('.js-card-animals');
const getAnimal = document.querySelectorAll('.js-card-animals > ol > li');

const animal = getAnimal;

for (let i = 0; i < animal.length; i++) {
animal[i].setAttribute('data-animal-count', `${i}`);
}

getButton.addEventListener('click', function () {
cat_count++;
mouse_count--;

getButton.addEventListener('click', (event) => {
event.preventDefault;
const styles = ['background: #faebd7; box-shadow: 0 4px 16px -4px rgb(239 146 23); transform: scale(1.2);'];
const cat = animal[0];
cat.innerHTML = `cat : ${cat_count}`;

getCardItem.classList.toggle('is-active');
const mouse = animal[2];
mouse.innerHTML = `mouse : ${mouse_count}`;

if (document.querySelector('.js-card-animals.is-active') !== null) {
getCardItem.setAttribute('style', styles);
if (mouse_count === 0) {
this.setAttribute('disabled', '');
cat.innerHTML = `Cats win!`;
} else {
getCardItem.removeAttribute('style');
this.removeAttribute('disabled', '');
}
});
};
8 changes: 4 additions & 4 deletions src/views/sections/_first_section.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<div class="container">
<div class="row">
<div class="card-animals js-card-animals">
{% set arr = { "кошки": "2", "собака": "1", "мышей": "15" }%}
{% set arr_animals = { "cat": "2", "dog": "1", "mouse": "4" }%}

<ol>
{% for item, about in arr %}
<li>У нас есть: {{ about }} {{ item -}}</li>
{% for animal, count in arr_animals %}
<li>{{- animal }} : {{ count -}}</li>
{% endfor %}
</ol>

<button class="button js-btn__card-animals">кнопка</button>
<button class="button js-btn__card-animals">Click me!</button>
</div>
</div>
</div>
Expand Down

0 comments on commit 51b8150

Please sign in to comment.