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.

Overview

🟦 Stop war on Ukraine 🟨

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.

A lot of companies did this in their custom way but this library is supereasy option to do for everyone.

πŸŽ—οΈ Add ribbon with Ukraine flag on your website

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save({
        ribbon: 'TOP_LEFT',
        hasShadow: true,
        countries: [],
    });
</script>

image

Or use other method of installation see below.

❎ I want to show banner for Russian users

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save({
        isCancelable: true,
    });
</script>

Or use other method of installation see below.

πŸ›‘ I want to block website for Russian users

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save({
        isCancelable: false,
    });
</script>

image

Or use other method of installation see below.

🩸 I want to show banner for Russian users but not include cruel graphic and blood

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save({
        isBloodIncluded: false,
        isGraphicIncluded: false,
    });
</script>

image

Or use other method of installation see below.

πŸŽ—οΈ πŸŽ—οΈ πŸŽ—οΈ πŸŽ—οΈ I want to have ribbon in multiple corners

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save({
        ribbon: 'TOP_LEFT',
        hasShadow: true,
        countries: [],
    });
    Ukraine.save({
        ribbon: 'TOP_RIGHT',
        hasShadow: false,
        countries: [],
    });
    Ukraine.save({
        ribbon: 'BOTTOM_LEFT',
        hasShadow: true,
        countries: [],
    });
    Ukraine.save({
        ribbon: 'BOTTOM_RIGHT',
        hasShadow: false,
        countries: [],
    });
</script>

Or use other method of installation see below.

πŸ“² How to include on your page?

There are several ways how to add this to your page:

πŸ“” Via HTML script tag

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save();
</script>

Note: Normally you would include async and defer keywords in the script element. But in this situation we do not want to defer this miniscript.

πŸ“— Wordpress

Install Simple Custom CSS and JS WordPress plugin and add the following code as the Custom HTML:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js" integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/" crossorigin="anonymous"></script>
<script>
    Ukraine.save();
</script>

πŸ“˜ Import into the bundle

First, you need to install save-ukraine package from NPM:

npm i save-ukraine

And then use:

import Ukraine from 'save-ukraine';

Ukraine.save();

Note: This library is written in TypeScript so options are fully typed.

βš›οΈ React

First, you need to install save-ukraine package from NPM:

npm i save-ukraine

And then use:

import Ukraine from 'save-ukraine';

ReactDOM.render(
    <>
        <div
            ref={(element) => {
                if (element) {
                    Ukraine.save({ element });
                }
            }}
        />
        {/*...Here will be rest of your app...*/}
    </>,
    document.getElementById('root'),
);

Or you can make full component:

// SaveUkraine.tsx

import * as React from 'react';
import Ukraine, { IUkraineOptions } from 'save-ukraine';

export function SaveUkraine(props: Partial<Omit<IUkraineOptions, 'element'>>) {
    return (
        <div
            ref={(element) => {
                if (element) {
                    Ukraine.save({ element, ...props });
                }
            }}
        />
    );
}

And use it:

import { SaveUkraine } from './SaveUkraine';

ReactDOM.render(
    <>
        <SaveUkraine isCancelable={true} />
        {/*...Here will be rest of your app...*/}
    </>,
    document.getElementById('root'),
);

πŸ›  🧩 Other customization

You can customize what will be shown. Here are all the options. If you have some idea feel free to contribute via pull request.

Ukraine.save({
    text: 'Stop the war with <b>Ukraine</b>',
    countries: [/* Russia and Belarus */ 'ru', 'by'],
    moreInfoUrl: `https://github.com/hejny/Ukraine`,
    ribbon: 'TOP_LEFT',
    isInConsole: true,
    isBloodIncluded: true,
    isGraphicIncluded: true,
    isCancelable: true,
});

πŸ‘¨πŸ½β€πŸ’» Security

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.

βœ‰οΈ Motivation

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.

But unfortunately, the situation has changed.

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.

This can not be tolerated in 21. century in Europe.

We can not just close our eyes and just provide all services and benefits to the Russian economy which can keep killing innocent people.

If you are managing some website, please stop it for Russia until the war will be over and putin overthrown.


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.


I have created a simple way how to do it.

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:

πŸ“› Make 3D printed bagge

276990939_10221763639026308_8401530540848276183_nhttps://www.thingiverse.com/thing:5326034

⁉️ FAQ

Few most common things aggregated from your questions:


How do you detect whether the user is or isn't from Russia.

We are capturing navigator.language from the browser. Full implementation is here.


How do you block the page?

I am putting a fixed full-screen div with a big z-index + restricting overflow and pointer-events for the rest of the page.


This restriction can be easily avoided!

Yes and no. For litter more skilled user on the desktop, it can be. For most of the users not. They can also switch their language but my goal is not to be bulletproof 100% blocking. But just to show this important message for Russian citizens.


This will also restrict Russian-speaking people from Ukraine?

Unfortunately, probably yes. Please do not place this for some essential services for Ukrainian people which can help them survive the war, like news, instructions, maps, ... There is no way how to perfectly detect who the user is and there will be always false positives and false negatives.

But if you have some better solution for this issue, please share with me.


It makes no sense to block western information from Russian people!

Definitely! If you are maintaining news and telling truth about the war / putin, please do not block it for the Russian people. This tool should be used as part of economic and social sanctions to Russia but made from the bottom. So, if you have some professional tool, some war/politics unrelated topic, unrelated blog, e-shop, crypto tool... you can use it as your personal economic sanctions.

Not to punish Russian people but to increase the efficiency of economic sanctions and help to get rid of the current Kremlin regime.


Can I change this and that?

Definitely! Please make a pull request.

Comments
  • CVE-2021-44906 (Medium) detected in minimist-1.2.5.tgz - autoclosed

    CVE-2021-44906 (Medium) detected in minimist-1.2.5.tgz - autoclosed

    CVE-2021-44906 - Medium Severity Vulnerability

    Vulnerable Library - minimist-1.2.5.tgz

    parse argument options

    Library home page: https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz

    Path to dependency file: /package.json

    Path to vulnerable library: /node_modules/minimist/package.json

    Dependency Hierarchy:

    • ts-jest-27.0.7.tgz (Root Library)
      • json5-2.2.0.tgz
        • :x: minimist-1.2.5.tgz (Vulnerable Library)

    Found in HEAD commit: 00c2b0044184130f87ecdce1346d0c7f3ac46650

    Found in base branch: main

    Vulnerability Details

    Minimist <=1.2.5 is vulnerable to Prototype Pollution via file index.js, function setKey() (lines 69-95).

    Publish Date: 2022-03-17

    URL: CVE-2021-44906

    CVSS 3 Score Details (5.0)

    Base Score Metrics:

    • Exploitability Metrics:
      • Attack Vector: Network
      • Attack Complexity: High
      • Privileges Required: Low
      • User Interaction: None
      • Scope: Unchanged
    • Impact Metrics:
      • Confidentiality Impact: Low
      • Integrity Impact: Low
      • Availability Impact: Low

    For more information on CVSS3 Scores, click here.

    Suggested Fix

    Type: Upgrade version

    Origin: https://github.com/substack/minimist/issues/164

    Release Date: 2022-03-17

    Fix Resolution: minimist - 1.2.6


    Step up your Open Source Security Game with WhiteSource here

    security vulnerability 
    opened by mend-bolt-for-github[bot] 1
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 29% πŸŽ‰

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /assets/wallpaper.png | 105.22kb | 67.37kb | 35.97% | | /assets/with-drops-of-blood.png | 35.65kb | 32.32kb | 9.34% | | /assets/Flag_of_Ukraine.svg | 0.17kb | 0.17kb | 1.68% | | | | | | | Total : | 141.04kb | 99.86kb | 29.20% |


    πŸ“ docs | :octocat: repo | πŸ™‹πŸΎ issues | πŸͺ marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced πŸŽ‰

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /assets/ai/wallpaper/gallery/82639076-250a-4952-9575-859c1e941781-0_3.png | 162.80kb | 133.81kb | 17.81% | | /assets/ai/wallpaper/gallery/12ca8aac-2c9c-442c-ad2d-9f7dd13f40de-0_3.png | 167.56kb | 143.14kb | 14.57% | | /assets/ai/wallpaper/gallery/10c083cd-819c-4aba-aa5e-d36efb8640e8-0_2.png | 179.41kb | 157.07kb | 12.45% | | /assets/ai/wallpaper/gallery/bbcaf46c-7098-4e90-8795-d88fbb940aae-0_3.png | 167.24kb | 155.20kb | 7.20% | | /assets/ai/wallpaper/gallery/9f8b5fcf-65b3-4f70-a269-4254f2171b34-0_1.png | 196.86kb | 183.31kb | 6.88% | | /assets/ai/wallpaper/gallery/12ca8aac-2c9c-442c-ad2d-9f7dd13f40de-0_1.png | 177.42kb | 165.37kb | 6.79% | | /assets/ai/wallpaper/gallery/10c083cd-819c-4aba-aa5e-d36efb8640e8-0_0.png | 97.72kb | 91.65kb | 6.21% | | /assets/ai/wallpaper/gallery/af4d9cb5-62f3-450a-af62-07192fdd3476-0_0.png | 836.54kb | 788.48kb | 5.74% | | /assets/ai/wallpaper/gallery/af4d9cb5-62f3-450a-af62-07192fdd3476-0_1.png | 855.15kb | 812.47kb | 4.99% | | /assets/ai/wallpaper/gallery/bbcaf46c-7098-4e90-8795-d88fbb940aae-0_2.png | 152.84kb | 145.32kb | 4.92% | | /assets/ai/wallpaper/gallery/4d7522e0-d696-431c-862e-bc57b6c4c49f-0_0.png | 172.36kb | 164.33kb | 4.66% | | /assets/ai/wallpaper/gallery/4d7522e0-d696-431c-862e-bc57b6c4c49f-0_3.png | 170.47kb | 162.53kb | 4.66% | | /assets/ai/wallpaper/gallery/bbcaf46c-7098-4e90-8795-d88fbb940aae-0_0.png | 168.52kb | 160.98kb | 4.47% | | /assets/ai/wallpaper/gallery/4d7522e0-d696-431c-862e-bc57b6c4c49f-0_2.png | 157.74kb | 150.92kb | 4.32% | | /assets/ai/wallpaper/gallery/4d04f973-4bf7-4a8f-8b5a-05d0f9ca3c6e-0_0.png | 3,136.48kb | 3,027.20kb | 3.48% | | /assets/social.png | 117.33kb | 113.29kb | 3.45% | | /assets/ai/wallpaper/gallery/03e0650b-0787-4f75-96d1-3f142ad66208-0_2.png | 201.78kb | 194.86kb | 3.43% | | /assets/ai/wallpaper/gallery/23d54dea-25d3-447d-815e-053a723ed622-0_0.png | 159.04kb | 154.06kb | 3.13% | | /assets/ai/wallpaper/gallery/82639076-250a-4952-9575-859c1e941781-0_1.png | 167.67kb | 162.47kb | 3.11% | | /assets/ai/wallpaper/gallery/12ca8aac-2c9c-442c-ad2d-9f7dd13f40de-0_0.png | 152.49kb | 147.84kb | 3.05% | | /assets/ai/wallpaper/gallery/9f8b5fcf-65b3-4f70-a269-4254f2171b34-0_3.png | 184.93kb | 179.95kb | 2.69% | | /assets/ai/wallpaper/gallery/486c1b96-1485-4d05-808c-050ec6a4c074-0_0.png | 3,225.87kb | 3,143.65kb | 2.55% | | /assets/ai/wallpaper/gallery/af4d9cb5-62f3-450a-af62-07192fdd3476-0_2.png | 710.11kb | 693.62kb | 2.32% | | /assets/ai/wallpaper/gallery/82639076-250a-4952-9575-859c1e941781-0_2.png | 177.37kb | 174.13kb | 1.83% | | /assets/ai/wallpaper/gallery/10c083cd-819c-4aba-aa5e-d36efb8640e8-0_1.png | 153.28kb | 150.62kb | 1.74% | | /assets/ai/wallpaper/gallery/af4d9cb5-62f3-450a-af62-07192fdd3476-0_3.png | 749.95kb | 737.97kb | 1.60% | | /assets/ai/wallpaper/gallery/b8c27135-f50b-46a6-a81f-22139486004d-0_0.png | 2,914.17kb | 2,868.10kb | 1.58% | | /assets/ai/wallpaper/gallery/9f8b5fcf-65b3-4f70-a269-4254f2171b34-0_0.png | 188.80kb | 186.01kb | 1.48% | | /assets/ai/wallpaper/gallery/03e0650b-0787-4f75-96d1-3f142ad66208-0_0.png | 183.86kb | 181.90kb | 1.06% | | /assets/ai/wallpaper/gallery/23d54dea-25d3-447d-815e-053a723ed622-0_3.png | 196.47kb | 194.41kb | 1.05% | | /assets/ai/wallpaper/gallery/bbcaf46c-7098-4e90-8795-d88fbb940aae-0_1.png | 164.77kb | 163.08kb | 1.02% | | /assets/ai/wallpaper/gallery/4d7522e0-d696-431c-862e-bc57b6c4c49f-0_1.png | 165.63kb | 164.07kb | 0.94% | | /assets/ai/wallpaper/gallery/23d54dea-25d3-447d-815e-053a723ed622-0_1.png | 179.61kb | 178.07kb | 0.86% | | /assets/ai/wallpaper/gallery/23d54dea-25d3-447d-815e-053a723ed622-0_2.png | 188.71kb | 187.31kb | 0.74% | | /assets/ai/wallpaper/gallery/10c083cd-819c-4aba-aa5e-d36efb8640e8-0_3.png | 154.63kb | 153.54kb | 0.70% | | /assets/ai/wallpaper/gallery/12ca8aac-2c9c-442c-ad2d-9f7dd13f40de-0_2.png | 173.58kb | 172.51kb | 0.62% | | /assets/ai/wallpaper/gallery/9f8b5fcf-65b3-4f70-a269-4254f2171b34-0_2.png | 189.07kb | 188.52kb | 0.29% | | /assets/ai/wallpaper/gallery/03e0650b-0787-4f75-96d1-3f142ad66208-0_3.png | 188.58kb | 188.44kb | 0.07% | | /assets/ai/wallpaper/gallery/82639076-250a-4952-9575-859c1e941781-0_0.png | 196.29kb | 196.18kb | 0.06% | | | | | | | Total : | 17,883.09kb | 17,316.41kb | 3.17% |


    πŸ“ docs | :octocat: repo | πŸ™‹πŸΎ issues | πŸͺ marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • Avoid making part of the screen non-clickable

    Avoid making part of the screen non-clickable

    Because there is a <div> and only after the <a> with the rotation, it happens that the parent div covers a "transparent" part of the screen.

    For instance, take this code:

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Bug</title>
    </head>
    
    <body>
        <div style="background: black; width: 200px; height: 40px;" onclick="alert('miao')"></div>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/main.js"
            integrity="sha384-Xn1RAG80M8PZlBQh3r8fUvHY7c8RtuplSnqXOkdJyCxqRsToRwJ1m2FP7vyJo7u/"
            crossorigin="anonymous"></script>
        <script>
            Ukraine.save({
                ribbon: 'TOP_LEFT',
                hasShadow: true,
                countries: [],
            });
        </script>
    </body>
    
    </html>
    

    You will see that if you click the black rectangle, it will not display any alert, because the ribbon's parent is obscuring it. In the image below, the covering div is with a purple boder:

    image

    A solution would be just to remove the superfluous div container and moving the first transform directly to the tag

    opened by euberdeveloper 0
  • Do not restrict Russian-speaking people from Ukraine

    Do not restrict Russian-speaking people from Ukraine

    I just do not know how to achieve this?

    • By secondary geolocation or detection of UK in navigator.languages
    • By asking for users' GPS if the language is Russian?
    • Can I somehow be privacy-respecting (not asking external service) + without backend detecting users' IP from the frontend.
    opened by hejny 1
  • Do not broke node environment

    Do not broke node environment

    In node environment this throws error on not finding a window - but for some users it can be confusing

    import Ukraine from 'save-ukraine';
    
    Ukraine.save();
    
    opened by hejny 0
Releases(v0.18.1)
Owner
Pavol HejnΓ½
βœ’οΈ Co-founder of CollBoard.com πŸš€ Startupper in Education πŸ‘¨β€πŸ’» Fullstack developer 🎟️ Co-organizer of tech events
Pavol HejnΓ½
OAC (Odin Anti Cheat) is a anti cheat made for minecraft bedrock.

?? Over 350 Downloads v1.0 + v1.1! ?? OAC Anti-cheat! Dedicated on protecting your minecraft realms and world from hackers. With a dedicated team we h

HateTheGoat 8 Oct 25, 2022
A simple to do list webpage where you can log the daily tasks you have to do, mark them as checked, modify them, reorder them and remove them. Made using HTML, CSS and JavaScript.

To-Do-List This Webpage is for an app called To-Do-List which helps you add, remove or check tasks you have to do. It is a simple web page which conta

Zeeshan Haider 9 Mar 12, 2022
This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit them or delete them.

To Do List This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit

Ali Aqa Atayee 12 Oct 30, 2022
Block Ad-Shield advertisement and anti-adblock

microShield microShield blocks Ad-Shield advertisement and anti-adblock script. Quick Start Just click the following URL to detect this userscript. ht

null 25 Dec 20, 2022
Borscht - A Russian service monitor to track the uptime of domains and services

borscht ?? Borscht is a simple uptime and status monitor of Russian sites and services You can view the public status page here ?? About ?? This proje

Grant Birkinbine 10 Jul 8, 2022
A totally functional user api. It's a service where you list users, create users, update or even delete them.

USER-API ?? ABOUT A user api system made with TypeScript using express and prisma. It's a service where you list user, create users, update them or ev

Luiz Sanches 4 Oct 27, 2022
e-ONG, an authorial project, whose objective is to help ONGs to find people who need help or would like to help them

This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: npm start Runs the app in the developmen

Lucas Lima 2 Nov 11, 2022
Will rock your s/o/x off β€” This is war you "hackerman" πŸ€“

tiktxk An open source, privacy first Cloudflare Worker for generating TikTok video download links. Replace the o with x and you'll get served the vide

Britmoji Inc. 30 Dec 12, 2022
A curated list of resources to help Ukraine

A curated list of resources to help Ukraine (get this badge here) Edit the list QR codes for quick donation Help the Ukrainian army Come back alive fu

Igor Varyvoda 7 Nov 17, 2022
A block preview that directly displays the block fields, including tabs.

Kirby Block Preview Fields This plugin for Kirby 3 displays the block fields directly in the block preview, including tabs. Inspired by the Kirby Fiel

JUNO 8 May 10, 2023
A web app which help you to save your daily tasks, mark them as completed and edit and delete them. Built with JavaScript

To-Do List A simple to-do list to help you organize your daily tasks. Built With HTML. CSS. JavaScript: ES6, Modules, Classes, Arrow Functions, Events

Williams Colmenares 13 Dec 17, 2022
A web app which help you to save your daily tasks, mark them as completed and edit and delete them. Built with JavaScript

To-Do List A simple to-do list to help you organize your daily tasks. Built With HTML. CSS. JavaScript: ES6, Modules, Classes, Arrow Functions, Events

Williams Colmenares 11 Aug 10, 2022
A web app which help you to save you a list of your favorite books, they will be saved on your local storage to never loose them even if you close the page. Built wiht JavaScript

Awesome Books In this project I build a page to save a list of your favorites books, you can add new books, delete it and they will be saved in the lo

Williams Colmenares 9 Dec 17, 2022
Utility for generating preview images of StarCraft: Brood War and Remastered maps

bwpreview Utility for generating preview images of StarCraft: Brood War and Remastered maps (.scm and .scx files). All of the actual work of parsing m

Michiel Sikma 5 Oct 14, 2022
This is an app that will service the ASD community to help them communicate what they want. The individual can be either verbal or non-verbal.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

MailingDelgadoMedina 3 Jun 28, 2022
SimpleProject is a web app that allows users to create projects and manage them in a Kanban board.

What is SimpleProject SimpleProject is a web app that allows users to create projects and manage them in a kanban board. SimpleProject was built with

Mahmoud Fettal 25 Nov 23, 2022