|
1 | 1 | /** |
2 | 2 | * HackTricks Training Discounts |
3 | | - */ |
| 3 | +
|
4 | 4 |
|
5 | 5 |
|
6 | 6 | (() => { |
|
9 | 9 | const TXT = 'Click here for HT Summer Discounts, Last Days!'; |
10 | 10 | const URL = 'https://training.hacktricks.xyz'; |
11 | 11 |
|
12 | | - /* Stop if user already dismissed */ |
| 12 | + # Stop if user already dismissed |
13 | 13 | if (localStorage.getItem(KEY) === 'true') return; |
14 | 14 |
|
15 | | - /* Quick helper */ |
| 15 | + # Quick helper |
16 | 16 | const $ = (tag, css = '') => Object.assign(document.createElement(tag), { style: css }); |
17 | 17 |
|
18 | | - /* --- Overlay (blur + dim) --- */ |
| 18 | + # --- Overlay (blur + dim) --- |
19 | 19 | const overlay = $('div', ` |
20 | 20 | position: fixed; inset: 0; |
21 | 21 | background: rgba(0,0,0,.4); |
|
24 | 24 | z-index: 10000; |
25 | 25 | `); |
26 | 26 |
|
27 | | - /* --- Modal --- */ |
| 27 | + # --- Modal --- |
28 | 28 | const modal = $('div', ` |
29 | 29 | max-width: 90vw; width: 480px; |
30 | 30 | background: #fff; border-radius: 12px; overflow: hidden; |
|
33 | 33 | display: flex; flex-direction: column; align-items: stretch; |
34 | 34 | `); |
35 | 35 |
|
36 | | - /* --- Title bar (link + close) --- */ |
| 36 | + # --- Title bar (link + close) --- |
37 | 37 | const titleBar = $('div', ` |
38 | 38 | position: relative; |
39 | | - padding: 1rem 2.5rem 1rem 1rem; /* room for the close button */ |
| 39 | + padding: 1rem 2.5rem 1rem 1rem; # room for the close button |
40 | 40 | text-align: center; |
41 | 41 | background: #222; color: #fff; |
42 | 42 | font-size: 1.3rem; font-weight: 700; |
|
53 | 53 | link.textContent = TXT; |
54 | 54 | titleBar.appendChild(link); |
55 | 55 |
|
56 | | - /* Close "X" (no persistence) */ |
| 56 | + # Close "X" (no persistence) |
57 | 57 | const closeBtn = $('button', ` |
58 | 58 | position: absolute; top: .25rem; right: .5rem; |
59 | 59 | background: transparent; border: none; |
|
65 | 65 | closeBtn.onclick = () => overlay.remove(); |
66 | 66 | titleBar.appendChild(closeBtn); |
67 | 67 |
|
68 | | - /* --- Image --- */ |
| 68 | + # --- Image --- |
69 | 69 | const img = $('img'); |
70 | 70 | img.src = IMG; img.alt = TXT; img.style.width = '100%'; |
71 | 71 |
|
72 | | - /* --- Checkbox row --- */ |
| 72 | + # --- Checkbox row --- |
73 | 73 | const label = $('label', ` |
74 | 74 | display: flex; align-items: center; justify-content: center; gap: .6rem; |
75 | 75 | padding: 1rem; font-size: 1rem; color: #222; cursor: pointer; |
|
83 | 83 | }; |
84 | 84 | label.append(cb, document.createTextNode("Don't show again")); |
85 | 85 |
|
86 | | - /* --- Assemble & inject --- */ |
| 86 | + # --- Assemble & inject --- |
87 | 87 | modal.append(titleBar, img, label); |
88 | 88 | overlay.appendChild(modal); |
89 | 89 |
|
|
94 | 94 | } |
95 | 95 | })(); |
96 | 96 |
|
97 | | - |
| 97 | +*/ |
98 | 98 |
|
99 | 99 |
|
100 | 100 |
|
|
0 commit comments