Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sgurin committed Feb 5, 2020
2 parents e36d03a + 009cd66 commit 69e7ce9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import dotsEffect from './modules/dots';
(($) => {
// When DOM is ready
$(() => {
dotsEffect.init();
dotsEffect();
});
})(jQuery);
40 changes: 17 additions & 23 deletions src/js/modules/dots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@
//
// You can remove or add your own function in this file.

const dotsEffect = (() => {
const createCells = () => {
const width = 10;
const height = 10;
const size = width * height;
let html = '<div class="entry-cells">';
const createCells = () => {
const width = 10;
const height = 10;
const size = width * height;
let html = '<div class="entry-cells">';

for (let i = 0; i < size; i += 1) {
html += `<div class="cell cell-${i}"></div>`;
}
for (let i = 0; i < size; i += 1) {
html += `<div class="cell cell-${i}"></div>`;
}

html += '</div>';
html += '</div>';

return html;
};
return html;
};

const init = () => {
const $cnt = $('.entry-section');
const cells = createCells();
$cnt.html(cells);
};
const init = () => {
const $cnt = $('.entry-section');
const cells = createCells();
$cnt.html(cells);
};

return {
init,
};
})();

export default dotsEffect;
export default init;

0 comments on commit 69e7ce9

Please sign in to comment.