DmitrMakeev commited on
Commit
cb571ee
·
verified ·
1 Parent(s): 2b55c9a

Update nutri_call.html

Browse files
Files changed (1) hide show
  1. nutri_call.html +21 -42
nutri_call.html CHANGED
@@ -5,54 +5,33 @@
5
 
6
 
7
  <!-- Основные стили -->
8
- <script src="
9
- https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.min.js
10
- "></script>
11
- <link href="
12
- https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/BrightTheme.min.css
13
- " rel="stylesheet">
14
-
15
-
16
- <!-- Скрипты -->
 
17
  <script type="module">
18
- import { alert, defaultModules } from 'https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.js';
19
- import * as PNotifyMobile from 'https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.js';
 
 
 
20
 
21
- // Инициализация мобильного модуля
22
  defaultModules.set(PNotifyMobile, {});
23
 
24
- // Теперь функция showCalculationStatus будет доступна глобально
25
- window.showCalculationStatus = function(response) {
26
- if (Object.keys(response.deficits || {}).length === 0) {
27
- alert({
28
- title: 'Успешный расчёт',
29
- text: 'Все элементы сбалансированы!',
30
- type: 'success',
31
- delay: 3000,
32
- modules: {
33
- Mobile: {
34
- swipeDismiss: true
35
- }
36
- }
37
- });
38
- } else {
39
- alert({
40
- title: 'Обнаружены отклонения',
41
- text: 'Дефициты: ' + Object.entries(response.deficits)
42
- .map(([el, val]) => `${el}: ${val.toFixed(2)}ppm`)
43
- .join(', '),
44
- type: 'error',
45
- delay: 5000,
46
- modules: {
47
- Mobile: {
48
- swipeDismiss: true
49
- }
50
- }
51
- });
52
- }
53
- };
54
  </script>
55
 
 
 
 
56
 
57
  <meta charset="UTF-8">
58
  <title>Калькулятор удобрений</title>
 
5
 
6
 
7
  <!-- Основные стили -->
8
+ <link
9
+ href="node_modules/@pnotify/core/dist/PNotify.css"
10
+ rel="stylesheet"
11
+ type="text/css"
12
+ />
13
+ <link
14
+ href="node_modules/@pnotify/mobile/dist/PNotifyMobile.css"
15
+ rel="stylesheet"
16
+ type="text/css"
17
+ />
18
  <script type="module">
19
+ import {
20
+ alert,
21
+ defaultModules,
22
+ } from 'node_modules/@pnotify/core/dist/PNotify.js';
23
+ import * as PNotifyMobile from 'node_modules/@pnotify/mobile/dist/PNotifyMobile.js';
24
 
 
25
  defaultModules.set(PNotifyMobile, {});
26
 
27
+ alert({
28
+ text: 'Notice me, senpai!',
29
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  </script>
31
 
32
+
33
+
34
+
35
 
36
  <meta charset="UTF-8">
37
  <title>Калькулятор удобрений</title>