diff --git a/.editorconfig b/.editorconfig index a4d49ba..a76a182 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,6 +20,10 @@ indent_size = 4 indent_style = space indent_size = 2 +[{*.cr,shard.yml}] +indent_style = space +indent_size = 2 + [humans.txt] indent_style = tab indent_size = 2 diff --git a/.prettierignore b/.prettierignore index 2b455a4..0642887 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,4 @@ app/assets/css/bootstrap* app/assets/js/bootstrap* package.json package-lock.json +server/ diff --git a/app/assets/js/app.js b/app/assets/js/app.js index c0c8bac..855731f 100644 --- a/app/assets/js/app.js +++ b/app/assets/js/app.js @@ -1,8 +1,12 @@ import { routes } from './routes.js'; -let DEBUG = false; +let DEBUG = true; window.DEBUG = DEBUG; +let SERVER_URL; +if (DEBUG) SERVER_HOST = 'localhost'; +else SERVER_HOST = 'a2s.su'; + /* main */ window.onload = function () { let app = document.documentElement; @@ -69,3 +73,21 @@ const location_handler = async () => { document.querySelector('#autorun').innerHTML = ''; } }; + +function get_from_api(callback, api_method = '', params = {}) { + respone = ''; + + if (api_method == '') { + console.log('wrong method'); + } else { + fetch(`http://${SERVER_HOST}:3000/api/v1.0/${api_method}`) + .then((response) => { + return response.json(); + }) + .then((data) => { + callback(data); + }) + .catch((err) => console.warn('Something went wrong.', err)); + } +} +window.get_from_api = get_from_api; diff --git a/public/js/rev2.js b/public/js/rev2.js new file mode 100644 index 0000000..5c90553 --- /dev/null +++ b/public/js/rev2.js @@ -0,0 +1,3 @@ +export function update_rev2(data) { + let time_remaining = document.getElementById('rev2_time_remaining') +} diff --git a/public/pages/rer2.html b/public/pages/rer2.html index 10408a1..70db8f8 100644 --- a/public/pages/rer2.html +++ b/public/pages/rer2.html @@ -14,26 +14,31 @@ «Вторжение огромных тварей» - -

- Изображение: - - Resident Evil Revelations 2 — Wallpaper by BrendaBirkin - -

+
+ +

+ Изображение: + + Resident Evil Revelations 2 — Wallpaper by BrendaBirkin + +

+
-
+
Invasion of the Huge Creatures No. 101 - Осталось времени: 656:49 +
@@ -56,31 +61,34 @@ /> -

- Aello - [100 00 000 / 999 999 999] -

-
-
21%
-
-

- Ocypete - [100 00 000 / 999 999 999] -

-
-
91%
+ +
+

+ Aello + [? / ?] +

+
+
21%
+
+

+ Ocypete + [? / ?] +

+
+
91%
+