save-ukraine 0.18.0 β 0.18.1
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 +129 -101
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,43 +1,105 @@
|
|
1
1
|
# π¦ Stop war on Ukraine π¨
|
2
2
|
|
3
|
-
|
3
|
+
Help Ukraine - add **ribbon with Ukraine flag** into the website you manage, show the **anti-war message to Russian users**, or **block them from your service**.
|
4
4
|
|
5
|
-
|
5
|
+
A lot of companies did this in their custom way but this library is supereasy option to do for everyone.
|
6
6
|
|
7
|
-
|
7
|
+
### ποΈ Add ribbon with Ukraine flag on your website
|
8
8
|
|
9
|
-
**This can not be tolerated in 21. century in Europe.**
|
10
9
|
|
11
|
-
|
10
|
+
```html
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
12
|
+
<script>
|
13
|
+
Ukraine.save({
|
14
|
+
ribbon: 'TOP_LEFT',
|
15
|
+
hasShadow: true,
|
16
|
+
countries: [],
|
17
|
+
});
|
18
|
+
</script>
|
19
|
+
```
|
12
20
|
|
13
|
-
|
21
|
+

|
14
22
|
|
15
|
-
---
|
16
23
|
|
17
|
-
I don't want to punish the Russian people as a whole. As a citizen of Prague, I have few Russian friends and this definitely won't change. I believe most Russians do not support the politics of their state and especially this cruel war. But unfortunately, economic pressure is now one of the less bad solutions. And every ruble paid on taxes for the current Russian government means more money for killing innocent people.
|
18
24
|
|
19
|
-
|
25
|
+
_Or use other method of installation see below._
|
20
26
|
|
21
|
-
|
27
|
+
### β I want to show banner for Russian users
|
22
28
|
|
23
|
-
|
29
|
+
```html
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
31
|
+
<script>
|
32
|
+
Ukraine.save({
|
33
|
+
isCancelable: true,
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
```
|
24
37
|
|
25
|
-
|
38
|
+
_Or use other method of installation see below._
|
26
39
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
### π I want to block website for Russian users
|
41
|
+
|
42
|
+
```html
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
44
|
+
<script>
|
45
|
+
Ukraine.save({
|
46
|
+
isCancelable: false,
|
47
|
+
});
|
48
|
+
</script>
|
49
|
+
```
|
50
|
+
|
51
|
+

|
52
|
+
|
53
|
+
|
54
|
+
_Or use other method of installation see below._
|
55
|
+
|
56
|
+
### π©Έ I want to show banner for Russian users but not include cruel graphic and blood
|
57
|
+
|
58
|
+
```html
|
59
|
+
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
60
|
+
<script>
|
61
|
+
Ukraine.save({
|
62
|
+
isBloodIncluded: false,
|
63
|
+
isGraphicIncluded: false,
|
64
|
+
});
|
65
|
+
</script>
|
66
|
+
```
|
67
|
+
|
68
|
+

|
69
|
+
|
70
|
+
|
71
|
+
_Or use other method of installation see below._
|
72
|
+
|
73
|
+
### ποΈποΈποΈποΈ I want to have ribbon in multiple corners
|
74
|
+
|
75
|
+
```html
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
77
|
+
<script>
|
78
|
+
Ukraine.save({
|
79
|
+
ribbon: 'TOP_LEFT',
|
80
|
+
hasShadow: true,
|
81
|
+
countries: [],
|
82
|
+
});
|
83
|
+
Ukraine.save({
|
84
|
+
ribbon: 'TOP_RIGHT',
|
85
|
+
hasShadow: false,
|
86
|
+
countries: [],
|
87
|
+
});
|
88
|
+
Ukraine.save({
|
89
|
+
ribbon: 'BOTTOM_LEFT',
|
90
|
+
hasShadow: true,
|
91
|
+
countries: [],
|
92
|
+
});
|
93
|
+
Ukraine.save({
|
94
|
+
ribbon: 'BOTTOM_RIGHT',
|
95
|
+
hasShadow: false,
|
96
|
+
countries: [],
|
97
|
+
});
|
98
|
+
</script>
|
99
|
+
```
|
100
|
+
|
101
|
+
_Or use other method of installation see below._
|
39
102
|
|
40
|
-

|
41
103
|
|
42
104
|
## π² How to include on your page?
|
43
105
|
|
@@ -158,83 +220,8 @@ ReactDOM.render(
|
|
158
220
|
Note: Feel free to add more methods of importing
|
159
221
|
-->
|
160
222
|
|
161
|
-
## π§© Scenarios to use
|
162
223
|
|
163
|
-
|
164
|
-
|
165
|
-
```html
|
166
|
-
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
167
|
-
<script>
|
168
|
-
Ukraine.save({
|
169
|
-
countries: [
|
170
|
-
/* Make this list empty */
|
171
|
-
],
|
172
|
-
ribbon: 'TOP_LEFT',
|
173
|
-
hasShadow: true,
|
174
|
-
});
|
175
|
-
</script>
|
176
|
-
```
|
177
|
-
|
178
|
-
_Or use other method of installation see above._
|
179
|
-
|
180
|
-
### β I want that users can cancel the message
|
181
|
-
|
182
|
-
```html
|
183
|
-
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
184
|
-
<script>
|
185
|
-
Ukraine.save({
|
186
|
-
isCancelable: true,
|
187
|
-
});
|
188
|
-
</script>
|
189
|
-
```
|
190
|
-
|
191
|
-
_Or use other method of installation see above._
|
192
|
-
|
193
|
-
### πΌοΈ I do not want to include cruel graphic and blood
|
194
|
-
|
195
|
-
```html
|
196
|
-
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
197
|
-
<script>
|
198
|
-
Ukraine.save({
|
199
|
-
isBloodIncluded: false,
|
200
|
-
isGraphicIncluded: false,
|
201
|
-
});
|
202
|
-
</script>
|
203
|
-
```
|
204
|
-
|
205
|
-
_Or use other method of installation see above._
|
206
|
-
|
207
|
-
### ποΈποΈποΈποΈ I want to have ribbon in multiple corners
|
208
|
-
|
209
|
-
```html
|
210
|
-
<script src="https://cdn.jsdelivr.net/npm/save-ukraine@0.18.0/dist/umd/main.js"></script>
|
211
|
-
<script>
|
212
|
-
Ukraine.save({
|
213
|
-
ribbon: 'TOP_LEFT',
|
214
|
-
hasShadow: true,
|
215
|
-
countries: [],
|
216
|
-
});
|
217
|
-
Ukraine.save({
|
218
|
-
ribbon: 'TOP_RIGHT',
|
219
|
-
hasShadow: false,
|
220
|
-
countries: [],
|
221
|
-
});
|
222
|
-
Ukraine.save({
|
223
|
-
ribbon: 'BOTTOM_LEFT',
|
224
|
-
hasShadow: true,
|
225
|
-
countries: [],
|
226
|
-
});
|
227
|
-
Ukraine.save({
|
228
|
-
ribbon: 'BOTTOM_RIGHT',
|
229
|
-
hasShadow: false,
|
230
|
-
countries: [],
|
231
|
-
});
|
232
|
-
</script>
|
233
|
-
```
|
234
|
-
|
235
|
-
_Or use other method of installation see above._
|
236
|
-
|
237
|
-
### π Other customization
|
224
|
+
## π π§© Other customization
|
238
225
|
|
239
226
|
You can customize what will be shown.
|
240
227
|
Here are all the [options](./src/options.ts). If you have some idea feel free to contribute via pull request.
|
@@ -256,6 +243,47 @@ Ukraine.save({
|
|
256
243
|
|
257
244
|
When you import anything _(not only this script)_ on your page, please do not trust the publisher. Verify the code and **include only the specific version** not the wildcard of every future version.
|
258
245
|
|
246
|
+
|
247
|
+
|
248
|
+
## βοΈ Motivation
|
249
|
+
|
250
|
+
**As a libertarian and programmer,** I would never think that I would someday work on a piece of software that would go against free access to any service from any corner of the world.
|
251
|
+
|
252
|
+
But unfortunately, the situation has changed.
|
253
|
+
|
254
|
+
Ukraine was attacked by Russia and a lot of innocent children, women and men are now dying in Kyiv and other Ukrainian cities at the hands of one cruel dictator.
|
255
|
+
|
256
|
+
**This can not be tolerated in 21. century in Europe.**
|
257
|
+
|
258
|
+
We can not just close our eyes and just provide all services and benefits to the Russian economy which can keep killing innocent people.
|
259
|
+
|
260
|
+
**If you are managing some website, please stop it for Russia** until the war will be over and putin overthrown.
|
261
|
+
|
262
|
+
---
|
263
|
+
|
264
|
+
I don't want to punish the Russian people as a whole. As a citizen of Prague, I have few Russian friends and this definitely won't change. I believe most Russians do not support the politics of their state and especially this cruel war. But unfortunately, economic pressure is now one of the less bad solutions. And every ruble paid on taxes for the current Russian government means more money for killing innocent people.
|
265
|
+
|
266
|
+
---
|
267
|
+
|
268
|
+
I have created a simple way how to do it.
|
269
|
+
|
270
|
+
For the users **from other places, nothing happens or π¦ you can optionally place the ribbon with Ukraine flag π¨**. The script is tiny to load and insignificant. If the visitor is from **Russia or Belarus** _(detected by system language)_ this **message will appear**:
|
271
|
+
|
272
|
+
|
273
|
+
<!--Badges-->
|
274
|
+
<!--β οΈWARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/800-badges/badges.ts so every manual change will be overwritten.-->
|
275
|
+
<!--
|
276
|
+
[](https://github.com/hejny/Ukraine/blob/main/LICENSE)
|
277
|
+
[](https://www.npmjs.com/package/Ukraine)
|
278
|
+
[](https://packagequality.com/#?package=Ukraine)
|
279
|
+
[](https://github.com/hejny/Ukraine/actions/workflows/lint.yml)
|
280
|
+
[](https://github.com/hejny/Ukraine/actions/workflows/test.yml)
|
281
|
+
[](https://snyk.io/test/github/hejny/Ukraine)
|
282
|
+
[](https://github.com/hejny/Ukraine/issues)
|
283
|
+
-->
|
284
|
+
<!--/Badges-->
|
285
|
+
|
286
|
+
|
259
287
|
## βοΈ FAQ
|
260
288
|
|
261
289
|
Few most common things aggregated from your questions:
|