diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..b512c09d47
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
\ No newline at end of file
diff --git a/.prettierrc.yaml b/.prettierrc.yaml
new file mode 100644
index 0000000000..b0dc13f2c4
--- /dev/null
+++ b/.prettierrc.yaml
@@ -0,0 +1,3 @@
+tabWidth: 4
+semi: false
+singleQuote: true
\ No newline at end of file
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000000..a5dc7820be
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,12 @@
+import globals from 'globals'
+import pluginJs from '@eslint/js'
+import config from 'eslint-config-prettier'
+import plugin from 'eslint-plugin-prettier/recommended'
+
+/** @type {import('eslint').Linter.Config[]} */
+export default [
+ { languageOptions: { globals: globals.browser } },
+ pluginJs.configs.recommended,
+ config,
+ plugin,
+]
diff --git a/index.html b/index.html
index c3dd35c1df..8f0ae47f05 100644
--- a/index.html
+++ b/index.html
@@ -1,131 +1,16 @@
-
+
-
- Проект "Комменты"
-
-
-
-
-
-
+
+
+
- // Функция для получения текущей даты и времени
- function getCurrentDateTime() {
- const now = new Date();
- const day = String(now.getDate()).padStart(2, '0');
- const month = String(now.getMonth() + 1).padStart(2, '0');
- const year = String(now.getFullYear()).slice(-2);
- const hours = String(now.getHours()).padStart(2, '0');
- const minutes = String(now.getMinutes()).padStart(2, '0');
- return `${day}.${month}.${year} ${hours}:${minutes}`;
- }
- // Функция для рендера комментариев
- function renderComments() {
- commentsList.innerHTML = ''; // Очищаем список комментариев
-
- comments.forEach((comment) => {
- const commentHtml = `
-
- `;
- commentsList.insertAdjacentHTML('beforeend', commentHtml);
- });
- }
-
- // Обработчик события нажатия на лайк
- commentsList.addEventListener('click', (event) => {
- if (event.target.classList.contains('like-button')) {
- const commentElement = event.target.closest('.comment');
- const commentIndex = Array.from(commentsList.children).indexOf(commentElement);
- const comment = comments[commentIndex];
-
- comment.likes.active = !comment.likes.active;
- comment.likes.count += comment.likes.active ? 1 : -1;
-
- renderComments();
- }
- });
-
- // Обработчик события нажатия на кнопку "Добавить"
- addButton.addEventListener('click', () => {
- const name = nameInput.value.trim();
- const text = commentInput.value.trim();
-
- if (name && text) {
- const newComment = {
- name: name,
- date: getCurrentDateTime(),
- text: text,
- likes: { count: 0, active: false },
- };
-
- comments.push(newComment);
- renderComments();
-
- nameInput.value = '';
- commentInput.value = '';
- }
- });
-
- // Первоначальный рендер комментариев
- renderComments();
-
-