-
Notifications
You must be signed in to change notification settings - Fork 1
/
brave-full.js
55 lines (34 loc) · 2.03 KB
/
brave-full.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(() => {
const DOMString = `<div class="the-brave-coders__backdrop">
<div class="the-brave-coders__popup">
<a href="https://www.youtube.com/c/TheBraveCoders/" class="the-brave-coders__popup-header" target="_blank">
<i class="ri-youtube-fill the-brave-coders__btn-icon"></i>TheBraveCoders
</a>
<h1 class="the-brave-coders__code-name">
<span class="the-brave-coders__code-name--span">Subscribe Our Youtube Channel</span>😋
</h1>
<a href="https://www.youtube.com/c/TheBraveCoders/" class="the-brave-coders__link"
target="_blank">https://www.youtube.com/c/TheBraveCoders/</a>
<a href="#" class="the-brave-coders__ok-btn">Close</a>
</div>
</div>
<div class="the-brave-coders-learn-it">
<a href="https://www.youtube.com/c/TheBraveCoders/" class="the-brave-coders-learn-it__button" target="_blank">
<i class="ri-youtube-fill the-brave-coders__btn-icon"></i>
Our Youtube Channel
</a>
</div>`
const createLinkElementAndAppendInHead = (path) => {
const element = document.createElement('link');
element.href = `${path}`;
element.rel = 'stylesheet';
document.head.append(element);
}
createLinkElementAndAppendInHead('https://cdn.jsdelivr.net/npm/[email protected]/fonts/remixicon.css');
createLinkElementAndAppendInHead('https://thebravecoders.github.io/youtube-popup/style.css');
document.body.insertAdjacentHTML('afterbegin', DOMString)
const btnOk = document.querySelector('.the-brave-coders__ok-btn');
btnOk.addEventListener('click', (e) => {
e.target.closest('.the-brave-coders__backdrop').remove();
});
})();