From ee9affabaa11df795fbae135a33e3713323adb43 Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 3 Apr 2026 02:46:52 +0200 Subject: [PATCH] refactor: move mnswpr.css import into mnswpr.js --- eslint.config.js | 3 +- index.html | 6 +--- src/main.js | 7 ++--- src/mnswpr.js | 1 + src/modules/index.js | 1 - src/modules/loading/loading.css | 55 --------------------------------- src/modules/loading/loading.js | 8 ----- 7 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 src/modules/loading/loading.css delete mode 100644 src/modules/loading/loading.js diff --git a/eslint.config.js b/eslint.config.js index dbdbb9e..66f0cff 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -21,8 +21,7 @@ export default defineConfig([ 'css/no-empty-blocks': 'error', 'css/no-invalid-at-rules': 'error', 'css/no-invalid-properties': 'error' - }, - ignores: ['./src/modules/loading/loading.css'] + } }, { files: ['**/*.{js,mjs,cjs}'], diff --git a/index.html b/index.html index 3b78495..17f28fd 100644 --- a/index.html +++ b/index.html @@ -19,10 +19,6 @@
- + diff --git a/src/main.js b/src/main.js index d1dc7ac..d14c1c1 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,4 @@ -import './modules/loading/loading.css' -import './mnswpr.css' -import Minesweeper from './mnswpr.js' +import MineSweeper from './mnswpr.js' -export default Minesweeper \ No newline at end of file +const mnswpr = new MineSweeper('app', 'dev') +mnswpr.initialize() \ No newline at end of file diff --git a/src/mnswpr.js b/src/mnswpr.js index dda8be2..da31222 100644 --- a/src/mnswpr.js +++ b/src/mnswpr.js @@ -1,5 +1,6 @@ // @ts-check +import './mnswpr.css' import { LoggerService, StorageService, diff --git a/src/modules/index.js b/src/modules/index.js index 497bd29..8cf731a 100644 --- a/src/modules/index.js +++ b/src/modules/index.js @@ -1,4 +1,3 @@ -export * from './loading/loading.js' export * from './logger/logger.js' export * from './storage/storage.js' export * from './timer/timer.js' diff --git a/src/modules/loading/loading.css b/src/modules/loading/loading.css deleted file mode 100644 index 315e809..0000000 --- a/src/modules/loading/loading.css +++ /dev/null @@ -1,55 +0,0 @@ -.lds-ellipsis { - display: inline-block; - position: relative; - width: 80px; - height: 80px; -} -.lds-ellipsis div { - position: absolute; - top: 33px; - width: 13px; - height: 13px; - border-radius: 50%; - background: #fff; - animation-timing-function: cubic-bezier(0, 1, 1, 0); -} -.lds-ellipsis div:nth-child(1) { - left: 8px; - animation: lds-ellipsis1 0.6s infinite; -} -.lds-ellipsis div:nth-child(2) { - left: 8px; - animation: lds-ellipsis2 0.6s infinite; -} -.lds-ellipsis div:nth-child(3) { - left: 32px; - animation: lds-ellipsis2 0.6s infinite; -} -.lds-ellipsis div:nth-child(4) { - left: 56px; - animation: lds-ellipsis3 0.6s infinite; -} -@keyframes lds-ellipsis1 { - 0% { - transform: scale(0); - } - 100% { - transform: scale(1); - } -} -@keyframes lds-ellipsis3 { - 0% { - transform: scale(1); - } - 100% { - transform: scale(0); - } -} -@keyframes lds-ellipsis2 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(24px, 0); - } -} diff --git a/src/modules/loading/loading.js b/src/modules/loading/loading.js deleted file mode 100644 index ee87f58..0000000 --- a/src/modules/loading/loading.js +++ /dev/null @@ -1,8 +0,0 @@ -export class LoadingService { - addLoading(element) { - element.innerHTML = '
' - } - removeLoading(element) { - element.innerHTML = '' - } -} \ No newline at end of file