lyraxis-notification 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/assets/main.png +0 -0
- package/index.html +1567 -28
- package/package.json +2 -1
- package/script.js +1 -1010
- package/style.css +4 -903
- package/test.html +266 -104
package/test.html
CHANGED
|
@@ -4,174 +4,319 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Lyraxis Test</title>
|
|
7
|
-
<link rel="stylesheet" href="style.css" type="text/css"
|
|
7
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
|
8
8
|
</head>
|
|
9
9
|
|
|
10
|
-
<body
|
|
10
|
+
<body>
|
|
11
11
|
|
|
12
12
|
<div class="buttons">
|
|
13
|
+
|
|
13
14
|
<button onclick="tes()">Log</button>
|
|
14
15
|
<button onclick="tes2()">Info</button>
|
|
15
16
|
<button onclick="tes3()">Confirm</button>
|
|
16
17
|
<button onclick="tes4()">Prompt</button>
|
|
17
18
|
<button onclick="tes5()">Toast</button>
|
|
19
|
+
|
|
18
20
|
<button onclick="tes7()">Dynamic Island</button>
|
|
21
|
+
<button onclick="tes8()">Dynamic Custom</button>
|
|
22
|
+
|
|
23
|
+
<button onclick="tes9()">Bahasa Indonesia</button>
|
|
24
|
+
<button onclick="tes10()">English</button>
|
|
25
|
+
|
|
26
|
+
<button onclick="tes11()">Sound ON</button>
|
|
27
|
+
<button onclick="tes12()">Sound OFF</button>
|
|
28
|
+
|
|
29
|
+
<button onclick="tes13()">Dynamic Semua Status</button>
|
|
30
|
+
<button onclick="tes14()">Dynamic Semua Icon</button>
|
|
31
|
+
|
|
19
32
|
</div>
|
|
20
33
|
|
|
34
|
+
|
|
21
35
|
<script src="./script.js"></script>
|
|
22
36
|
|
|
23
37
|
<script>
|
|
24
|
-
|
|
38
|
+
|
|
25
39
|
lyn.soundNotification("allow");
|
|
26
40
|
|
|
41
|
+
|
|
27
42
|
function tes() {
|
|
28
43
|
lyn.log({
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
Mess: "Berhasil mengirim request, mohon tunggu sebentar."
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
lyn.log({
|
|
48
|
+
Status: "error",
|
|
49
|
+
Mess: "Gagal menghubungkan ke server."
|
|
31
50
|
});
|
|
32
51
|
}
|
|
33
52
|
|
|
53
|
+
|
|
34
54
|
function tes2() {
|
|
35
55
|
lyn.info({
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
Subtitle: "Lyraxis Test",
|
|
57
|
+
Title: "Informasi",
|
|
58
|
+
Mess: "Ini adalah informasi dari lyn.info.\nBaris kedua juga ikut dites."
|
|
38
59
|
});
|
|
39
60
|
}
|
|
40
61
|
|
|
62
|
+
|
|
41
63
|
function tes3() {
|
|
42
64
|
lyn.confirm({
|
|
43
65
|
Mess: "Yakin ingin melanjutkan?",
|
|
44
66
|
Event: function() {
|
|
45
|
-
lyn.
|
|
46
|
-
|
|
67
|
+
lyn.log({
|
|
68
|
+
Status: "success",
|
|
69
|
+
Mess: "Kamu menekan tombol Lanjutkan."
|
|
47
70
|
});
|
|
48
71
|
}
|
|
49
72
|
});
|
|
50
73
|
}
|
|
51
74
|
|
|
75
|
+
|
|
52
76
|
async function tes4() {
|
|
53
77
|
try {
|
|
54
|
-
|
|
78
|
+
|
|
79
|
+
const angka = await lyn.prompt({
|
|
55
80
|
Mess: "Masukkan nomor:",
|
|
56
81
|
Type: "num"
|
|
57
82
|
});
|
|
58
83
|
|
|
59
84
|
lyn.log({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
: "Nilai untuk Pak Prabowo: 11/100."
|
|
85
|
+
Status: "success",
|
|
86
|
+
Mess: "Kamu memasukkan: " + angka
|
|
63
87
|
});
|
|
88
|
+
|
|
64
89
|
} catch (err) {
|
|
90
|
+
|
|
65
91
|
lyn.log({
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+
Status: "error",
|
|
93
|
+
Mess: "User membatalkan prompt."
|
|
68
94
|
});
|
|
95
|
+
|
|
69
96
|
}
|
|
70
97
|
}
|
|
71
|
-
|
|
98
|
+
|
|
99
|
+
|
|
72
100
|
function tes5() {
|
|
101
|
+
|
|
73
102
|
lyn.toast({
|
|
74
|
-
Title: "
|
|
75
|
-
Mess: "Ini toast
|
|
103
|
+
Title: "Informasi",
|
|
104
|
+
Mess: "Ini toast default.",
|
|
76
105
|
Status: "default"
|
|
77
106
|
});
|
|
78
|
-
|
|
107
|
+
|
|
79
108
|
lyn.toast({
|
|
80
|
-
Title: "Berhasil
|
|
81
|
-
Mess: "Data berhasil disimpan
|
|
109
|
+
Title: "Berhasil",
|
|
110
|
+
Mess: "Data berhasil disimpan.",
|
|
82
111
|
Status: "success"
|
|
83
112
|
});
|
|
84
|
-
|
|
113
|
+
|
|
85
114
|
lyn.toast({
|
|
86
|
-
Title: "Gagal
|
|
87
|
-
Mess: "
|
|
88
|
-
Status: "error"
|
|
115
|
+
Title: "Gagal",
|
|
116
|
+
Mess: "Terjadi kesalahan pada server.",
|
|
117
|
+
Status: "error"
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
lyn.toast({
|
|
121
|
+
Title: "Permanen",
|
|
122
|
+
Mess: "Toast ini tidak hilang otomatis.",
|
|
123
|
+
Status: "default",
|
|
89
124
|
Permanent: true
|
|
90
125
|
});
|
|
126
|
+
|
|
91
127
|
}
|
|
92
|
-
|
|
128
|
+
|
|
129
|
+
|
|
93
130
|
function tes7() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
131
|
+
|
|
132
|
+
lyn.dynamicIsland({
|
|
133
|
+
Status: "default",
|
|
134
|
+
Mess: "Pesan informasi biasa",
|
|
135
|
+
Label: "info"
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
lyn.dynamicIsland({
|
|
139
|
+
Status: "success",
|
|
140
|
+
Mess: "File berhasil disimpan",
|
|
141
|
+
Label: "download"
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
lyn.dynamicIsland({
|
|
145
|
+
Status: "warning",
|
|
146
|
+
Mess: "Koneksi agak lambat",
|
|
147
|
+
Label: "warning"
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
lyn.dynamicIsland({
|
|
151
|
+
Status: "failed",
|
|
152
|
+
Mess: "Gagal menghubungkan server",
|
|
153
|
+
Label: "failed"
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
lyn.dynamicIsland({
|
|
157
|
+
Status: "active",
|
|
158
|
+
Mess: "Sedang memutar musik",
|
|
159
|
+
Label: "music"
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
lyn.dynamicIsland({
|
|
163
|
+
Status: "waiting",
|
|
164
|
+
Mess: "Sedang menunggu proses",
|
|
165
|
+
Label: "wait"
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
lyn.dynamicIsland({
|
|
169
|
+
Status: "default",
|
|
170
|
+
Mess: "Ada notifikasi baru",
|
|
171
|
+
Label: "notification"
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
function tes8() {
|
|
178
|
+
|
|
179
|
+
lyn.dynamicIsland({
|
|
180
|
+
Label: "custom",
|
|
181
|
+
Mess: "Ini Dynamic Island custom!",
|
|
182
|
+
CustomIcon: `
|
|
183
|
+
<svg viewBox="0 0 24 24">
|
|
184
|
+
<path d="M12 2 14.5 9.5 22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5L12 2Z"/>
|
|
185
|
+
</svg>
|
|
186
|
+
`,
|
|
187
|
+
CustomColor: "#a855f7",
|
|
188
|
+
CustomAnimation: "lyCustomPulse 1s ease-in-out infinite"
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
function tes9() {
|
|
195
|
+
lyn.setLang("id");
|
|
196
|
+
|
|
197
|
+
lyn.info({
|
|
198
|
+
Mess: "Bahasa sekarang menggunakan Indonesia."
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
function tes10() {
|
|
204
|
+
lyn.setLang("en");
|
|
205
|
+
|
|
206
|
+
lyn.info({
|
|
207
|
+
Mess: "The language is now English."
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
function tes11() {
|
|
213
|
+
|
|
214
|
+
lyn.soundNotification("allow");
|
|
215
|
+
|
|
216
|
+
lyn.toast({
|
|
217
|
+
Title: "Sound ON",
|
|
218
|
+
Mess: "Suara notifikasi diaktifkan.",
|
|
219
|
+
Status: "success"
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
function tes12() {
|
|
226
|
+
|
|
227
|
+
lyn.soundNotification("off");
|
|
228
|
+
|
|
229
|
+
lyn.toast({
|
|
230
|
+
Title: "Sound OFF",
|
|
231
|
+
Mess: "Suara notifikasi dimatikan.",
|
|
232
|
+
Status: "default"
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
function tes13() {
|
|
239
|
+
|
|
240
|
+
const data = [
|
|
241
|
+
|
|
242
|
+
{
|
|
243
|
+
Status: "default",
|
|
244
|
+
Label: "info",
|
|
245
|
+
Mess: "Status default"
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
{
|
|
249
|
+
Status: "active",
|
|
250
|
+
Label: "info",
|
|
251
|
+
Mess: "Status active"
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
{
|
|
255
|
+
Status: "success",
|
|
256
|
+
Label: "success",
|
|
257
|
+
Mess: "Status success"
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
{
|
|
261
|
+
Status: "warning",
|
|
262
|
+
Label: "warning",
|
|
263
|
+
Mess: "Status warning"
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
{
|
|
267
|
+
Status: "failed",
|
|
268
|
+
Label: "failed",
|
|
269
|
+
Mess: "Status failed"
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
{
|
|
273
|
+
Status: "waiting",
|
|
274
|
+
Label: "wait",
|
|
275
|
+
Mess: "Status waiting"
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
];
|
|
279
|
+
|
|
280
|
+
data.forEach(item => {
|
|
281
|
+
lyn.dynamicIsland(item);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
function tes14() {
|
|
288
|
+
|
|
289
|
+
const icons = [
|
|
290
|
+
"home",
|
|
291
|
+
"notification",
|
|
292
|
+
"music",
|
|
293
|
+
"info",
|
|
294
|
+
"download",
|
|
295
|
+
"upload",
|
|
296
|
+
"settings",
|
|
297
|
+
"success",
|
|
298
|
+
"failed",
|
|
299
|
+
"warning",
|
|
300
|
+
"wait"
|
|
301
|
+
];
|
|
302
|
+
|
|
303
|
+
icons.forEach(icon => {
|
|
304
|
+
|
|
305
|
+
lyn.dynamicIsland({
|
|
306
|
+
Status: "default",
|
|
307
|
+
Label: icon,
|
|
308
|
+
Mess: "Icon: " + icon
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
}
|
|
314
|
+
|
|
172
315
|
</script>
|
|
173
316
|
|
|
317
|
+
|
|
174
318
|
<style>
|
|
319
|
+
|
|
175
320
|
* {
|
|
176
321
|
box-sizing: border-box;
|
|
177
322
|
}
|
|
@@ -210,6 +355,23 @@
|
|
|
210
355
|
button:active {
|
|
211
356
|
transform: scale(.97);
|
|
212
357
|
}
|
|
358
|
+
|
|
359
|
+
@keyframes lyCustomPulse {
|
|
360
|
+
|
|
361
|
+
0% {
|
|
362
|
+
transform: scale(1) rotate(0);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
50% {
|
|
366
|
+
transform: scale(1.25) rotate(180deg);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
100% {
|
|
370
|
+
transform: scale(1) rotate(360deg);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
}
|
|
374
|
+
|
|
213
375
|
</style>
|
|
214
376
|
|
|
215
377
|
</body>
|