@oxiwan/tizenadn 1.1.0 → 1.2.0

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.
@@ -1 +1 @@
1
- !function(){"use strict";var e=["a[href]","button:not([disabled])",'[role="button"]',".slider-item",".media-card",".catalog-item",".episode-list-item",".btn",'[tabindex]:not([tabindex="-1"])'].join(", "),t=[],n=0;function o(){t=Array.from(document.querySelectorAll(e)).filter(function(e){var t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function a(e){if(document.querySelectorAll(".__adn_focus").forEach(function(e){e.classList.remove("__adn_focus")}),t[e]){n=e;var o=t[e];o.classList.add("__adn_focus"),o.focus({preventScroll:!1}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}function r(e){var o=t[n];if(!o)return n;var a=o.getBoundingClientRect(),r=a.left+a.width/2,i=a.top+a.height/2,s=n,c=1/0;return t.forEach(function(t,o){if(o!==n){var a=t.getBoundingClientRect(),d=a.left+a.width/2,u=a.top+a.height/2,p=d-r,l=u-i,m=!1;if("UP"===e&&(m=l<-10),"DOWN"===e&&(m=l>10),"LEFT"===e&&(m=p<-10),"RIGHT"===e&&(m=p>10),m){var f=("UP"===e||"DOWN"===e?Math.abs(l):Math.abs(p))+2*("UP"===e||"DOWN"===e?Math.abs(p):Math.abs(l));f<c&&(c=f,s=o)}}}),s}function i(){var e=document.querySelector("#__abconsent-cmp, #sd-cmp");e&&e.remove();var t=document.querySelector(".sd-cmp-MtHO2");t&&t.remove(),document.body.style.overflow="",document.documentElement.style.overflow=""}i(),new MutationObserver(function(){document.querySelector("#__abconsent-cmp")&&i()}).observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",function(e){switch(o(),e.keyCode){case 38:e.preventDefault(),a(r("UP"));break;case 40:e.preventDefault(),a(r("DOWN"));break;case 37:e.preventDefault(),a(r("LEFT"));break;case 39:e.preventDefault(),a(r("RIGHT"));break;case 13:t[n]&&(e.preventDefault(),t[n].click());break;case 10009:case 10182:e.preventDefault();var i=document.querySelector("video");i&&!i.paused?i.pause():history.back()}},!0),new MutationObserver(function(){return setTimeout(o,400)}).observe(document.body,{childList:!0,subtree:!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){o(),a(0)}):(o(),a(0));var s=document.createElement("style");s.textContent='body, html {\n overflow: auto !important;\n}\n\n.__adn_focus {\n outline: 3px solid #bafeffb1 !important;\n outline-offset: 2px !important;\n transform: scale(1.05) !important;\n box-shadow: 0 0 15px rgba(119, 188, 189, 0.6) !important;\n transition: transform 0.15s ease !important;\n z-index: 9999 !important;\n position: relative !important;\n}\n\n.__adn_focus::before {\n content: \'\';\n position: absolute;\n top: -3px; left: -3px; right: -3px; bottom: -3px;\n border: 2px solid #bafeffb1;\n border-radius: 3px;\n box-shadow: 0 0 15px 3px rgba(119, 188, 189, 0.6);\n pointer-events: none;\n z-index: -1;\n}\n\nbody { cursor: none !important; }\n\n.adn-toast {\n position: fixed;\n top: 20px; right: 20px;\n background: rgba(0,0,0,0.75);\n color: #fff;\n padding: 10px 20px;\n border-radius: 6px;\n font-size: 18px;\n z-index: 99999;\n opacity: 0;\n transform: translateY(-10px);\n transition: all 0.3s ease;\n}\n.adn-toast.show { opacity: 1; transform: translateY(0); }\n\n#__abconsent-cmp,\n#sd-cmp,\n.sd-cmp-MtHO2,\n[id*="consent"],\n[class*="cmp-"] {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n pointer-events: none !important;\n}',document.head.appendChild(s),document.addEventListener("keydown",function(e){var t=document.querySelector("video");if(t)switch(e.keyCode){case 415:case 19:case 10252:e.preventDefault(),t.paused?t.play():t.pause();break;case 413:e.preventDefault(),t.pause(),t.currentTime=0;break;case 417:e.preventDefault(),t.currentTime=Math.min(t.duration,t.currentTime+30);break;case 412:e.preventDefault(),t.currentTime=Math.max(0,t.currentTime-10)}},!0)}();
1
+ !function(){"use strict";var n=["a[href]","button:not([disabled])",'[role="button"]',".slider-item",".media-card",".catalog-item",".episode-list-item",".btn","input",'[tabindex]:not([tabindex="-1"])'].join(", "),e=[],t=0;function o(){e=Array.from(document.querySelectorAll(n)).filter(function(n){var e=n.getBoundingClientRect();return e.width>0&&e.height>0})}function r(n){if(document.querySelectorAll(".__adn_focus").forEach(function(n){n.classList.remove("__adn_focus")}),e[n]){t=n;var o=e[n];o.classList.add("__adn_focus"),o.focus({preventScroll:!1}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}function a(n){var o=e[t];if(!o)return t;var r=o.getBoundingClientRect(),a=r.left+r.width/2,i=r.top+r.height/2,d=t,c=1/0;return e.forEach(function(e,o){if(o!==t){var r=e.getBoundingClientRect(),s=r.left+r.width/2,p=r.top+r.height/2,u=s-a,l=p-i,m=!1;if("UP"===n&&(m=l<-10),"DOWN"===n&&(m=l>10),"LEFT"===n&&(m=u<-10),"RIGHT"===n&&(m=u>10),m){var f=("UP"===n||"DOWN"===n?Math.abs(l):Math.abs(u))+2*("UP"===n||"DOWN"===n?Math.abs(u):Math.abs(l));f<c&&(c=f,d=o)}}}),d}function i(){[".sd-cmp-gpI1s",".sd-cmp-cWOb7",".sd-cmp-FzC1t",".sd-cmp-hk3jy",".sd-cmp-MtHO2","#__abconsent-cmp","#sd-cmp"].forEach(function(n){document.querySelectorAll(n).forEach(function(n){return n.remove()})}),document.body.style.overflow="",document.documentElement.style.overflow="",document.body.style.position="",document.documentElement.style.position=""}function d(){("/login"===window.location.pathname||window.location.pathname.startsWith("/login"))&&function(){if(!document.querySelector("#__adn_token_popup")){var n=document.createElement("div");n.id="__adn_token_popup",n.style.cssText="\n position: fixed;\n top: 0; left: 0; right: 0; bottom: 0;\n background: rgba(0,0,0,0.85);\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 20px;\n font-family: Helvetica, sans-serif;\n ";var e=document.createElement("div");e.style.cssText="\n background: #04121a;\n border: 2px solid #0095ff;\n border-radius: 16px;\n padding: 40px;\n width: 600px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n align-items: center;\n ";var t=document.createElement("div");t.textContent="Connexion ADN",t.style.cssText="color: #fff; font-size: 28px; font-weight: bold;";var o=document.createElement("div");o.textContent="Entrez votre token d'authentification",o.style.cssText="color: #999; font-size: 16px;";var r=document.createElement("input");r.type="text",r.placeholder="Token...",r.id="__adn_token_input",r.style.cssText="\n width: 100%;\n padding: 14px 18px;\n font-size: 18px;\n border-radius: 10px;\n border: 2px solid #0095ff;\n background: #0a1f2e;\n color: #fff;\n outline: none;\n box-sizing: border-box;\n ";var a=document.createElement("button");a.textContent="Valider",a.style.cssText="\n padding: 14px 40px;\n font-size: 20px;\n background: #0095ff;\n color: #fff;\n border: none;\n border-radius: 10px;\n cursor: pointer;\n font-weight: bold;\n ";var i=document.createElement("div");i.textContent="Appuyez sur OK pour valider",i.style.cssText="color: #555; font-size: 14px;",a.addEventListener("click",d),r.addEventListener("keydown",function(n){13===n.keyCode&&(n.stopPropagation(),d())}),e.appendChild(t),e.appendChild(o),e.appendChild(r),e.appendChild(a),e.appendChild(i),n.appendChild(e),document.body.appendChild(n),setTimeout(function(){return r.focus()},100)}function d(){var e=r.value.trim();e&&(localStorage.setItem("token",e),n.remove(),window.location.href="/")}}()}i(),new MutationObserver(function(){(document.querySelector("#__abconsent-cmp")||document.querySelector(".sd-cmp-MtHO2")||document.querySelector(".sd-cmp-hk3jy"))&&i()}).observe(document.body,{childList:!0,subtree:!0}),d();var c=history.pushState.bind(history);history.pushState=function(){c.apply(void 0,arguments),d()},window.addEventListener("popstate",d),document.addEventListener("keydown",function(n){if(!document.querySelector("#__adn_token_popup"))switch(o(),n.keyCode){case 38:n.preventDefault(),r(a("UP"));break;case 40:n.preventDefault(),r(a("DOWN"));break;case 37:n.preventDefault(),r(a("LEFT"));break;case 39:n.preventDefault(),r(a("RIGHT"));break;case 13:e[t]&&(n.preventDefault(),e[t].click());break;case 10009:case 10182:n.preventDefault();var i=document.querySelector("video");i&&!i.paused?i.pause():history.back()}},!0),new MutationObserver(function(){return setTimeout(o,400)}).observe(document.body,{childList:!0,subtree:!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){i(),o(),r(0),d()}):(o(),r(0));var s=document.createElement("style");s.textContent=".__adn_focus {\n outline: 3px solid #e94560 !important;\n outline-offset: 2px !important;\n transform: scale(1.05) !important;\n box-shadow: 0 0 15px rgba(233, 69, 96, 0.6) !important;\n transition: transform 0.15s ease !important;\n z-index: 9999 !important;\n position: relative !important;\n}\n\n.__adn_focus::before {\n content: '';\n position: absolute;\n top: -3px; left: -3px; right: -3px; bottom: -3px;\n border: 2px solid #e94560;\n border-radius: 3px;\n box-shadow: 0 0 15px 3px rgba(233, 69, 96, 0.5);\n pointer-events: none;\n z-index: -1;\n}\n\nbody, html {\n cursor: none !important;\n overflow: auto !important;\n position: static !important;\n}\n\n.sd-cmp-gpI1s,\n.sd-cmp-cWOb7,\n.sd-cmp-FzC1t,\n.sd-cmp-hk3jy,\n.sd-cmp-MtHO2,\n#__abconsent-cmp,\n#sd-cmp,\n[class*=\"sd-cmp-\"] {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n pointer-events: none !important;\n}\n\n.adn-toast {\n position: fixed;\n top: 20px; right: 20px;\n background: rgba(0,0,0,0.75);\n color: #fff;\n padding: 10px 20px;\n border-radius: 6px;\n font-size: 18px;\n z-index: 99999;\n opacity: 0;\n transform: translateY(-10px);\n transition: all 0.3s ease;\n}\n\n.adn-toast.show {\n opacity: 1;\n transform: translateY(0);\n}\n\n#__adn_token_popup input:focus {\n border-color: #e94560 !important;\n box-shadow: 0 0 10px rgba(233, 69, 96, 0.5) !important;\n}\n\n#__adn_token_popup button:hover,\n#__adn_token_popup button:focus {\n background: #007acc !important;\n transform: scale(1.05);\n}",document.head.appendChild(s),document.addEventListener("keydown",function(n){var e=document.querySelector("video");if(e)switch(n.keyCode){case 415:case 19:case 10252:n.preventDefault(),e.paused?e.play():e.pause();break;case 413:n.preventDefault(),e.pause(),e.currentTime=0;break;case 417:n.preventDefault(),e.currentTime=Math.min(e.duration,e.currentTime+30);break;case 412:n.preventDefault(),e.currentTime=Math.max(0,e.currentTime-10)}},!0)}();
package/mods/nav.js CHANGED
@@ -7,6 +7,7 @@ const FOCUSABLE = [
7
7
  '.catalog-item',
8
8
  '.episode-list-item',
9
9
  '.btn',
10
+ 'input',
10
11
  '[tabindex]:not([tabindex="-1"])'
11
12
  ].join(', ');
12
13
 
@@ -67,25 +68,154 @@ function nearest(dir) {
67
68
  }
68
69
 
69
70
  function killCookiePopup() {
70
- const popup = document.querySelector('#__abconsent-cmp, #sd-cmp');
71
- if (popup) popup.remove();
72
-
73
- const overlay = document.querySelector('.sd-cmp-MtHO2');
74
- if (overlay) overlay.remove();
75
-
71
+ const selectors = [
72
+ '.sd-cmp-gpI1s',
73
+ '.sd-cmp-cWOb7',
74
+ '.sd-cmp-FzC1t',
75
+ '.sd-cmp-hk3jy',
76
+ '.sd-cmp-MtHO2',
77
+ '#__abconsent-cmp',
78
+ '#sd-cmp'
79
+ ];
80
+ selectors.forEach(sel => {
81
+ document.querySelectorAll(sel).forEach(el => el.remove());
82
+ });
76
83
  document.body.style.overflow = '';
77
84
  document.documentElement.style.overflow = '';
85
+ document.body.style.position = '';
86
+ document.documentElement.style.position = '';
87
+ }
88
+
89
+ function showTokenPopup() {
90
+ if (document.querySelector('#__adn_token_popup')) return;
91
+
92
+ const overlay = document.createElement('div');
93
+ overlay.id = '__adn_token_popup';
94
+ overlay.style.cssText = `
95
+ position: fixed;
96
+ top: 0; left: 0; right: 0; bottom: 0;
97
+ background: rgba(0,0,0,0.85);
98
+ z-index: 999999;
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ flex-direction: column;
103
+ gap: 20px;
104
+ font-family: Helvetica, sans-serif;
105
+ `;
106
+
107
+ const box = document.createElement('div');
108
+ box.style.cssText = `
109
+ background: #04121a;
110
+ border: 2px solid #0095ff;
111
+ border-radius: 16px;
112
+ padding: 40px;
113
+ width: 600px;
114
+ display: flex;
115
+ flex-direction: column;
116
+ gap: 20px;
117
+ align-items: center;
118
+ `;
119
+
120
+ const title = document.createElement('div');
121
+ title.textContent = 'Connexion ADN';
122
+ title.style.cssText = `color: #fff; font-size: 28px; font-weight: bold;`;
123
+
124
+ const subtitle = document.createElement('div');
125
+ subtitle.textContent = 'Entrez votre token d\'authentification';
126
+ subtitle.style.cssText = `color: #999; font-size: 16px;`;
127
+
128
+ const input = document.createElement('input');
129
+ input.type = 'text';
130
+ input.placeholder = 'Token...';
131
+ input.id = '__adn_token_input';
132
+ input.style.cssText = `
133
+ width: 100%;
134
+ padding: 14px 18px;
135
+ font-size: 18px;
136
+ border-radius: 10px;
137
+ border: 2px solid #0095ff;
138
+ background: #0a1f2e;
139
+ color: #fff;
140
+ outline: none;
141
+ box-sizing: border-box;
142
+ `;
143
+
144
+ const btn = document.createElement('button');
145
+ btn.textContent = 'Valider';
146
+ btn.style.cssText = `
147
+ padding: 14px 40px;
148
+ font-size: 20px;
149
+ background: #0095ff;
150
+ color: #fff;
151
+ border: none;
152
+ border-radius: 10px;
153
+ cursor: pointer;
154
+ font-weight: bold;
155
+ `;
156
+
157
+ const hint = document.createElement('div');
158
+ hint.textContent = 'Appuyez sur OK pour valider';
159
+ hint.style.cssText = `color: #555; font-size: 14px;`;
160
+
161
+ function validate() {
162
+ const token = input.value.trim();
163
+ if (!token) return;
164
+ localStorage.setItem('token', token);
165
+ overlay.remove();
166
+ window.location.href = '/';
167
+ }
168
+
169
+ btn.addEventListener('click', validate);
170
+
171
+ input.addEventListener('keydown', e => {
172
+ if (e.keyCode === 13) {
173
+ e.stopPropagation();
174
+ validate();
175
+ }
176
+ });
177
+
178
+ box.appendChild(title);
179
+ box.appendChild(subtitle);
180
+ box.appendChild(input);
181
+ box.appendChild(btn);
182
+ box.appendChild(hint);
183
+ overlay.appendChild(box);
184
+ document.body.appendChild(overlay);
185
+
186
+ setTimeout(() => input.focus(), 100);
187
+ }
188
+
189
+ function checkLoginPage() {
190
+ if (window.location.pathname === '/login' || window.location.pathname.startsWith('/login')) {
191
+ showTokenPopup();
192
+ }
78
193
  }
79
194
 
80
195
  killCookiePopup();
196
+
81
197
  const popupObserver = new MutationObserver(() => {
82
- if (document.querySelector('#__abconsent-cmp')) {
198
+ if (
199
+ document.querySelector('#__abconsent-cmp') ||
200
+ document.querySelector('.sd-cmp-MtHO2') ||
201
+ document.querySelector('.sd-cmp-hk3jy')
202
+ ) {
83
203
  killCookiePopup();
84
204
  }
85
205
  });
86
206
  popupObserver.observe(document.body, { childList: true, subtree: true });
87
207
 
208
+ checkLoginPage();
209
+
210
+ const _pushState = history.pushState.bind(history);
211
+ history.pushState = function(...args) {
212
+ _pushState(...args);
213
+ checkLoginPage();
214
+ };
215
+ window.addEventListener('popstate', checkLoginPage);
216
+
88
217
  document.addEventListener('keydown', e => {
218
+ if (document.querySelector('#__adn_token_popup')) return;
89
219
  refresh();
90
220
  switch (e.keyCode) {
91
221
  case 38: e.preventDefault(); focusEl(nearest('UP')); break;
@@ -108,7 +238,7 @@ new MutationObserver(() => setTimeout(refresh, 400))
108
238
  .observe(document.body, { childList: true, subtree: true });
109
239
 
110
240
  if (document.readyState === 'loading') {
111
- document.addEventListener('DOMContentLoaded', () => { refresh(); focusEl(0); });
241
+ document.addEventListener('DOMContentLoaded', () => { killCookiePopup(); refresh(); focusEl(0); checkLoginPage(); });
112
242
  } else {
113
243
  refresh(); focusEl(0);
114
244
  }
package/mods/ui.css CHANGED
@@ -1,12 +1,8 @@
1
- body, html {
2
- overflow: auto !important;
3
- }
4
-
5
1
  .__adn_focus {
6
- outline: 3px solid #bafeffb1 !important;
2
+ outline: 3px solid #e94560 !important;
7
3
  outline-offset: 2px !important;
8
4
  transform: scale(1.05) !important;
9
- box-shadow: 0 0 15px rgba(119, 188, 189, 0.6) !important;
5
+ box-shadow: 0 0 15px rgba(233, 69, 96, 0.6) !important;
10
6
  transition: transform 0.15s ease !important;
11
7
  z-index: 9999 !important;
12
8
  position: relative !important;
@@ -16,14 +12,32 @@ body, html {
16
12
  content: '';
17
13
  position: absolute;
18
14
  top: -3px; left: -3px; right: -3px; bottom: -3px;
19
- border: 2px solid #bafeffb1;
15
+ border: 2px solid #e94560;
20
16
  border-radius: 3px;
21
- box-shadow: 0 0 15px 3px rgba(119, 188, 189, 0.6);
17
+ box-shadow: 0 0 15px 3px rgba(233, 69, 96, 0.5);
22
18
  pointer-events: none;
23
19
  z-index: -1;
24
20
  }
25
21
 
26
- body { cursor: none !important; }
22
+ body, html {
23
+ cursor: none !important;
24
+ overflow: auto !important;
25
+ position: static !important;
26
+ }
27
+
28
+ .sd-cmp-gpI1s,
29
+ .sd-cmp-cWOb7,
30
+ .sd-cmp-FzC1t,
31
+ .sd-cmp-hk3jy,
32
+ .sd-cmp-MtHO2,
33
+ #__abconsent-cmp,
34
+ #sd-cmp,
35
+ [class*="sd-cmp-"] {
36
+ display: none !important;
37
+ visibility: hidden !important;
38
+ opacity: 0 !important;
39
+ pointer-events: none !important;
40
+ }
27
41
 
28
42
  .adn-toast {
29
43
  position: fixed;
@@ -38,15 +52,19 @@ body { cursor: none !important; }
38
52
  transform: translateY(-10px);
39
53
  transition: all 0.3s ease;
40
54
  }
41
- .adn-toast.show { opacity: 1; transform: translateY(0); }
42
55
 
43
- #__abconsent-cmp,
44
- #sd-cmp,
45
- .sd-cmp-MtHO2,
46
- [id*="consent"],
47
- [class*="cmp-"] {
48
- display: none !important;
49
- visibility: hidden !important;
50
- opacity: 0 !important;
51
- pointer-events: none !important;
56
+ .adn-toast.show {
57
+ opacity: 1;
58
+ transform: translateY(0);
59
+ }
60
+
61
+ #__adn_token_popup input:focus {
62
+ border-color: #e94560 !important;
63
+ box-shadow: 0 0 10px rgba(233, 69, 96, 0.5) !important;
64
+ }
65
+
66
+ #__adn_token_popup button:hover,
67
+ #__adn_token_popup button:focus {
68
+ background: #007acc !important;
69
+ transform: scale(1.05);
52
70
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oxiwan/tizenadn",
3
3
  "appName": "ADN - Anime Digital Network",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "description": "TizenBrew module pour Anime Digital Network sur TV Samsung",
6
6
  "packageType": "mods",
7
7
  "websiteURL": "https://animationdigitalnetwork.fr",