@oxiwan/tizenadn 1.0.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 a(){t=Array.from(document.querySelectorAll(e)).filter(function(e){var t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function o(e){if(document.querySelectorAll(".__adn_focus").forEach(function(e){e.classList.remove("__adn_focus")}),t[e]){n=e;var a=t[e];a.classList.add("__adn_focus"),a.focus({preventScroll:!1}),a.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}function r(e){var a=t[n];if(!a)return n;var o=a.getBoundingClientRect(),r=o.left+o.width/2,i=o.top+o.height/2,s=n,c=1/0;return t.forEach(function(t,a){if(a!==n){var o=t.getBoundingClientRect(),d=o.left+o.width/2,u=o.top+o.height/2,l=d-r,p=u-i,f=!1;if("UP"===e&&(f=p<-10),"DOWN"===e&&(f=p>10),"LEFT"===e&&(f=l<-10),"RIGHT"===e&&(f=l>10),f){var m=("UP"===e||"DOWN"===e?Math.abs(p):Math.abs(l))+2*("UP"===e||"DOWN"===e?Math.abs(l):Math.abs(p));m<c&&(c=m,s=a)}}}),s}document.addEventListener("keydown",function(e){switch(a(),e.keyCode){case 38:e.preventDefault(),o(r("UP"));break;case 40:e.preventDefault(),o(r("DOWN"));break;case 37:e.preventDefault(),o(r("LEFT"));break;case 39:e.preventDefault(),o(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(a,400)}).observe(document.body,{childList:!0,subtree:!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){a(),o(0)}):(a(),o(0));var i=document.createElement("style");i.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 { 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); }",document.head.appendChild(i),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
 
@@ -66,7 +67,155 @@ function nearest(dir) {
66
67
  return best;
67
68
  }
68
69
 
70
+ function killCookiePopup() {
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
+ });
83
+ document.body.style.overflow = '';
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
+ }
193
+ }
194
+
195
+ killCookiePopup();
196
+
197
+ const popupObserver = new MutationObserver(() => {
198
+ if (
199
+ document.querySelector('#__abconsent-cmp') ||
200
+ document.querySelector('.sd-cmp-MtHO2') ||
201
+ document.querySelector('.sd-cmp-hk3jy')
202
+ ) {
203
+ killCookiePopup();
204
+ }
205
+ });
206
+ popupObserver.observe(document.body, { childList: true, subtree: true });
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
+
69
217
  document.addEventListener('keydown', e => {
218
+ if (document.querySelector('#__adn_token_popup')) return;
70
219
  refresh();
71
220
  switch (e.keyCode) {
72
221
  case 38: e.preventDefault(); focusEl(nearest('UP')); break;
@@ -89,7 +238,7 @@ new MutationObserver(() => setTimeout(refresh, 400))
89
238
  .observe(document.body, { childList: true, subtree: true });
90
239
 
91
240
  if (document.readyState === 'loading') {
92
- document.addEventListener('DOMContentLoaded', () => { refresh(); focusEl(0); });
241
+ document.addEventListener('DOMContentLoaded', () => { killCookiePopup(); refresh(); focusEl(0); checkLoginPage(); });
93
242
  } else {
94
243
  refresh(); focusEl(0);
95
244
  }
package/mods/ui.css CHANGED
@@ -19,7 +19,25 @@
19
19
  z-index: -1;
20
20
  }
21
21
 
22
- 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
+ }
23
41
 
24
42
  .adn-toast {
25
43
  position: fixed;
@@ -34,4 +52,19 @@ body { cursor: none !important; }
34
52
  transform: translateY(-10px);
35
53
  transition: all 0.3s ease;
36
54
  }
37
- .adn-toast.show { opacity: 1; transform: translateY(0); }
55
+
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);
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.0.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",