Tema online


SUBMITTED BY: anbach

DATE: Nov. 20, 2023, 2:32 a.m.

UPDATED: March 7, 2024, 1:59 a.m.

FORMAT: Text only

SIZE: 53.6 kB

HITS: 7111

  1. <!DOCTYPE html>
  2. <html lang="pt-BR">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>PicaPau</title>
  8. <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
  9. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
  10. integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
  11. <script type="text/javascript"
  12. src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
  13. integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
  14. crossorigin="anonymous"></script>
  15. <link rel='stylesheet'
  16. href='https://cdn-uicons.flaticon.com/2.0.0/uicons-regular-rounded/css/uicons-regular-rounded.css'>
  17. <style>
  18. @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
  19. :root {
  20. /*------------------------------------------------------------------------EDITE SOMENTE AQUI INICIAL-----------------------------------------------------------------------------*/
  21. /* -------------- LOGO -----------------------------------*/
  22. --logo-img-url: url( );
  23. --logotamanho: 30%;
  24. /* Cria uma sombra na LOGO */
  25. /*
  26. --shadow1-offset-x: -5px;
  27. --shadow1-offset-y: 8px;
  28. --shadow1-blur: 3px;
  29. --shadow1-color: black;
  30. */
  31. /*------------------------------------------------------------------------*/
  32. --background-img: url(https://i.imgur.com/GBgCHyH.jpg);
  33. /* Defina o texto desejado */
  34. --textonovo: ismael Net ;
  35. --tamanhotexto: 80px;
  36. --cortexto: #ffffff;
  37. /* Valor padrão para o desfoque do vidro */
  38. --blur-amount2: 5px;
  39. --vidro-color: rgba(0, 0, 0, 0.158);
  40. /* Cria uma sombra no Vidro */
  41. /*
  42. --shadow-offset-x: -5px;
  43. --shadow-offset-y: 8px;
  44. --shadow-blur: 3px;
  45. --shadow-color: black;
  46. */
  47. /*------------------------------------------------------------------------*/
  48. /*Cores Dos Botao de iniciar*/
  49. --cor-gradiente-nav-inicial: #f1292912;
  50. --cor-gradiente-nav-final: #ff7f0017;
  51. --cor-icon-config: #ffffff;
  52. /*------------------------------------------------------------------------*/
  53. /*Cores Dos Botao de conectar*/
  54. --cor-gradiente-btstart-incial: #f1292912;
  55. --cor-gradiente-btstart-final: #ff7f0017;
  56. /*------------------------------------------------------------------------*/
  57. /*Cores Dos icones e TexTo*/
  58. --text-color: #ffffff;
  59. --icon-color: #FFFFFF;
  60. /*------------------------------------------------------------------------*/
  61. /*Cores Dos config*/
  62. --cor-text-config: #e70000;
  63. --cor-gradiente-config-incial: #f1292912;
  64. --cor-gradiente-config-final: #ff7f0017;
  65. /*------------------------------------------------------------------------EDITE SOMENTE AQUI FINALLLL-----------------------------------------------------------------------------*/
  66. --input-border-radius: 5px;
  67. --input-background-color: #0a091a55;
  68. --card-border-radius: 5px;
  69. --card-background-color: #0b092868;
  70. --btn-background-color: #0a091a55;
  71. --btn-border-radius: 15px;
  72. --modal-background-color: #0b092868;
  73. }
  74. * {
  75. margin: 0;
  76. padding: 0;
  77. box-sizing: border-box;
  78. font-family: 'Roboto', sans-serif;
  79. }
  80. body {
  81. height: 100vh;
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. justify-content: center;
  86. background-repeat: no-repeat;
  87. background-size: cover;
  88. background-color: var(--cor-background);
  89. color: #fff;
  90. font-family: 'Lato', sans-serif;
  91. }
  92. * {
  93. box-sizing: border-box;
  94. }
  95. h1 {
  96. font-size: 60px;
  97. margin: -80px 0 40px;
  98. }
  99. .year {
  100. font-size: 100px;
  101. z-index: 0;
  102. opacity: 0.2;
  103. position: absolute;
  104. bottom: 28px;
  105. left: 50%;
  106. transform: translateX(-50%);
  107. }
  108. .countdown {
  109. display: -webkit-inline-box;
  110. position: absolute;
  111. top: 135px;
  112. margin-top: -23px;
  113. transform: scale(2);
  114. }
  115. .time {
  116. display: flex;
  117. flex-direction: column;
  118. align-items: center;
  119. justify-content: center;
  120. margin: 15px;
  121. }
  122. .time h2 {
  123. margin: 0 0 5px;
  124. }
  125. @media (max-width: 500px) {
  126. h1 {
  127. font-size: 45px;
  128. }
  129. .time {
  130. margin: 5px;
  131. }
  132. .time h2 {
  133. font-size: 12px;
  134. margin: 0;
  135. }
  136. .time small {
  137. font-size: 10px;
  138. }
  139. }
  140. /*Feliz Natal*/
  141. a {
  142. text-decoration: none;
  143. }
  144. .message {
  145. font-family: 'Mountains of Christmas', cursive;
  146. font-size: var(--tamanhotexto);
  147. text-align: center;
  148. position: absolute;
  149. color: var(--cortexto);
  150. margin: 0px;
  151. top: 50px;
  152. height: 60px;
  153. }
  154. /*LOADING SPACE*/
  155. .contain {
  156. animation-delay: 4s;
  157. z-index: 1000;
  158. position: fixed;
  159. top: 0;
  160. left: 0;
  161. bottom: 0;
  162. right: 0;
  163. display: -webkit-box;
  164. display: -ms-flexbox;
  165. display: flex;
  166. -ms-flex-flow: row nowrap;
  167. flex-flow: row nowrap;
  168. -webkit-box-pack: center;
  169. -ms-flex-pack: center;
  170. justify-content: center;
  171. -webkit-box-align: center;
  172. -ms-flex-align: center;
  173. align-items: center;
  174. background: #25a7d7;
  175. background: -webkit-linear-gradient(#25a7d7, #2962FF);
  176. background: linear-gradient(#25a7d7, #25a7d7);
  177. }
  178. .icon {
  179. width: 100px;
  180. height: 100px;
  181. margin: 0 5px;
  182. }
  183. /*Animation*/
  184. .icon:nth-child(2) img {
  185. -webkit-animation-delay: 0.2s;
  186. animation-delay: 0.2s
  187. }
  188. .icon:nth-child(3) img {
  189. -webkit-animation-delay: 0.3s;
  190. animation-delay: 0.3s
  191. }
  192. .icon:nth-child(4) img {
  193. -webkit-animation-delay: 0.4s;
  194. animation-delay: 0.4s
  195. }
  196. .icon img {
  197. -webkit-animation: anim 2s ease infinite;
  198. animation: anim 2s ease infinite;
  199. -webkit-transform: scale(0, 0) rotateZ(180deg);
  200. transform: scale(0, 0) rotateZ(180deg);
  201. }
  202. @-webkit-keyframes anim {
  203. 0% {
  204. -webkit-transform: scale(0, 0) rotateZ(-90deg);
  205. transform: scale(0, 0) rotateZ(-90deg);
  206. opacity: 0
  207. }
  208. 30% {
  209. -webkit-transform: scale(1, 1) rotateZ(0deg);
  210. transform: scale(1, 1) rotateZ(0deg);
  211. opacity: 1
  212. }
  213. 50% {
  214. -webkit-transform: scale(1, 1) rotateZ(0deg);
  215. transform: scale(1, 1) rotateZ(0deg);
  216. opacity: 1
  217. }
  218. 80% {
  219. -webkit-transform: scale(0, 0) rotateZ(90deg);
  220. transform: scale(0, 0) rotateZ(90deg);
  221. opacity: 0
  222. }
  223. }
  224. @keyframes anim {
  225. 0% {
  226. -webkit-transform: scale(0, 0) rotateZ(-90deg);
  227. transform: scale(0, 0) rotateZ(-90deg);
  228. opacity: 0
  229. }
  230. 30% {
  231. -webkit-transform: scale(1, 1) rotateZ(0deg);
  232. transform: scale(1, 1) rotateZ(0deg);
  233. opacity: 1
  234. }
  235. 50% {
  236. -webkit-transform: scale(1, 1) rotateZ(0deg);
  237. transform: scale(1, 1) rotateZ(0deg);
  238. opacity: 1
  239. }
  240. 80% {
  241. -webkit-transform: scale(0, 0) rotateZ(90deg);
  242. transform: scale(0, 0) rotateZ(90deg);
  243. opacity: 0
  244. }
  245. }
  246. .container {
  247. height: 100%;
  248. display: flex;
  249. flex-direction: column;
  250. justify-content: center;
  251. align-items: center;
  252. max-width: 465px;
  253. background: var(--background-img);
  254. background-position: center;
  255. background-repeat: no-repeat;
  256. background-size: cover;
  257. }
  258. .text_config {
  259. color: var(--cor-text-config) !important;
  260. }
  261. .logo {
  262. width: var(--logotamanho);
  263. display: block;
  264. margin-top: 0px;
  265. margin-bottom: 15px;
  266. margin-left: auto;
  267. margin-right: auto;
  268. content: var(--logo-img-url);
  269. filter: drop-shadow(var(--shadow1-offset-x) var(--shadow1-offset-y) var(--shadow1-blur) var(--shadow1-color));
  270. }
  271. .card {
  272. backdrop-filter: blur(var(--blur-amount2));
  273. background: var(--vidro-color);
  274. border-radius: 20px;
  275. border: 1px solid #1e1e1e !important;
  276. box-shadow: -8px 12px 20px 0 rgb(13 15 18 / 63%) !important;
  277. padding: 15px !important;
  278. max-width: 450px;
  279. height: auto;
  280. position: relative;
  281. filter: drop-shadow(var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) var(--shadow-color));
  282. }
  283. .btn-dark {
  284. border: none;
  285. background: linear-gradient(var(--cor-gradiente-btstart-incial), var(--cor-gradiente-btstart-final));
  286. border-radius: 15px;
  287. --bs-btn-hover-bg: #4b8d4b18 !important;
  288. --bs-btn-hover-border-color: #47593f2f !important;
  289. }
  290. .modal-content {
  291. background-color: transparent;
  292. backdrop-filter: blur(25px);
  293. }
  294. .tool {
  295. align-items: center;
  296. justify-content: center;
  297. text-align: center;
  298. }
  299. .tool-bt {
  300. background: linear-gradient(var(--cor-gradiente-config-incial), var(--cor-gradiente-config-final));
  301. border-radius: 20px;
  302. color: var(--cor-text-config) !important;
  303. height: 35px;
  304. width: 100%;
  305. border: var(--btn-border);
  306. }
  307. .input-group,
  308. .form-control,
  309. .input-group-text {
  310. background: #0808083f;
  311. color: var(--icon-color);
  312. border: none;
  313. border-radius: 15px;
  314. outline: none;
  315. }
  316. .form-control::placeholder {
  317. color: var(--text-color);
  318. }
  319. .form-control:focus {
  320. color: var(--text-color);
  321. outline: none;
  322. box-shadow: none;
  323. }
  324. .input-group-text {
  325. padding-right: 0;
  326. }
  327. .fs-5 {
  328. font-size: 1rem !important;
  329. }
  330. nav {
  331. background: linear-gradient(var(--cor-gradiente-nav-inicial), var(--cor-gradiente-nav-final));
  332. border-radius: 20px;
  333. font-size: 0;
  334. width: 100%;
  335. max-width: 450px;
  336. height: auto;
  337. position: sticky;
  338. margin-top: 20px;
  339. margin-bottom: 10px;
  340. display: flex;
  341. justify-content: space-around;
  342. align-items: center;
  343. }
  344. nav span {
  345. line-height: 45px;
  346. height: 100%;
  347. position: relative;
  348. z-index: 1;
  349. text-decoration: none;
  350. text-align: center;
  351. color: white !important;
  352. cursor: alias;
  353. }
  354. nav span svg {
  355. fill: var(--cor-icon-config);
  356. }
  357. nav .animation {
  358. position: absolute;
  359. height: 100%;
  360. top: 0;
  361. z-index: 0;
  362. transition: all .5s ease 0s;
  363. border-radius: 8px;
  364. }
  365. a:nth-child(1) {
  366. width: 30%;
  367. }
  368. a:nth-child(2) {
  369. width: 30%;
  370. }
  371. a:nth-child(3) {
  372. width: 40%;
  373. }
  374. nav .start-home,
  375. a:nth-child(1):hover~.animation {
  376. width: 30%;
  377. left: 0;
  378. background-color: #1212123f;
  379. border-radius: 20px;
  380. }
  381. nav .start-about,
  382. a:nth-child(2):hover~.animation {
  383. width: 30%;
  384. ;
  385. left: 30%;
  386. background-color: #1212123f;
  387. border-radius: 20px;
  388. }
  389. nav .start-blog,
  390. a:nth-child(3):hover~.animation {
  391. width: 40%;
  392. left: 60%;
  393. background-color: #1212123f;
  394. border-radius: 20px;
  395. }
  396. body {
  397. font-size: 12px;
  398. font-family: sans-serif;
  399. background: color #1212123f;
  400. }
  401. @media (min-width: 768px) {
  402. .container,
  403. .container-md,
  404. .container-sm {
  405. max-width: 100%;
  406. }
  407. }
  408. .rede {
  409. color: #ff0000;
  410. }
  411. .iplocal {
  412. color: #ffffff;
  413. }
  414. .containerlocal {
  415. background: #0808083f;
  416. border-radius: 20px;
  417. border: 1px solid #1e1e1e !important;
  418. padding: 15px !important;
  419. width: 95%;
  420. max-width: 450px;
  421. height: initial;
  422. position: absolute;
  423. margin-top: 700px;
  424. margin-bottom: -66px;
  425. }
  426. .hidden {
  427. display: none;
  428. }
  429. </style>
  430. </head>
  431. <body>
  432. <div class="containerlocal">
  433. <span class="font-semibold text-xs mr-2"
  434. style="color: #28FF55;"">📢 IP Local da sua operadora:</span><span class=" rede font-semibold text-xs mr-2"
  435. id="name">REDE</span> <span class="iplocal font-semibold text-xs" id="ip">127.0.0.1</span>
  436. </div>
  437. <div class="container">
  438. <div id="year" class="year"></div>
  439. <div id="countdown" class="countdown">
  440. <div class="time">
  441. <h2 id=" "></h2>
  442. <small></small>
  443. </div>
  444. <div class="time">
  445. <h2 id=" "></h2>
  446. <small></small>
  447. </div>
  448. <div class="time">
  449. <h2 id=" "></h2>
  450. <small></small>
  451. </div>
  452. <div class="time">
  453. <h2 id=" "></h2>
  454. <small></small>
  455. </div>
  456. </div>
  457. <script>
  458. const nextYearContainer = document.getElementById('year');
  459. const daysContainer = document.getElementById('days');
  460. const housContainer = document.getElementById('hours');
  461. const minutesContainer = document.getElementById('minutes');
  462. const secondsContainer = document.getElementById('seconds');
  463. const loading = document.getElementById('loading');
  464. const countdown = document.getElementById('countdown');
  465. const nextYear = new Date().getFullYear() + 1;
  466. const newYearTime = new Date(`January 01 ${nextYear} 00:00:00`);
  467. nextYearContainer.textContent = nextYear;
  468. const getTimeUnit = unit => unit < 10 ? '0' + unit : unit;
  469. <div class="time">
  470. <h2 id=" ">00</h2>
  471. <small>segundos</small>
  472. </div>
  473. </div>
  474. <img src="./img/spinner.gif" alt="Carregando..." id="loading" class="loading" />
  475. <script>
  476. const nextYearContainer = document.getElementById('year');
  477. const daysContainer = document.getElementById('days');
  478. const housContainer = document.getElementById('hours');
  479. const minutesContainer = document.getElementById('minutes');
  480. const secondsContainer = document.getElementById('seconds');
  481. const loading = document.getElementById('loading');
  482. const countdown = document.getElementById('countdown');
  483. const nextYear = new Date().getFullYear() + 1;
  484. const newYearTime = new Date(`January 01 ${nextYear} 00:00:00`);
  485. nextYearContainer.textContent = nextYear;
  486. const getTimeUnit = unit => unit < 10 ? '0' + unit : unit;
  487. const insertCountdownValues = ({ days, hours, minutes, seconds }) => {
  488. daysContainer.textContent = getTimeUnit(days);
  489. housContainer.textContent = getTimeUnit(hours)
  490. minutesContainer.textContent = getTimeUnit(minutes)
  491. secondsContainer.textContent = getTimeUnit(seconds)
  492. }
  493. const updateCountdown = () => {
  494. const currentTime = new Date();
  495. const difference = newYearTime - currentTime;
  496. const days = Math.floor(difference / 1000 / 60 / 60 / 24);
  497. const hours = Math.floor(difference / 1000 / 60 / 60) % 24;
  498. const minutes = Math.floor(difference / 1000 / 60) % 60;
  499. const seconds = Math.floor(difference / 1000) % 60;
  500. insertCountdownValues({ days, hours, minutes, seconds });
  501. }
  502. const handleCountdownDisplay = () => {
  503. loading.remove();
  504. countdown.style.display = 'flex';
  505. }
  506. setTimeout(handleCountdownDisplay, 1000)
  507. setInterval(updateCountdown, 1000);
  508. const insertCountdownValues = ({ days, hours, minutes, seconds }) => {
  509. daysContainer.textContent = getTimeUnit(days);
  510. housContainer.textContent = getTimeUnit(hours)
  511. minutesContainer.textContent = getTimeUnit(minutes)
  512. secondsContainer.textContent = getTimeUnit(seconds)
  513. }
  514. const updateCountdown = () => {
  515. const currentTime = new Date();
  516. const difference = newYearTime - currentTime;
  517. const days = Math.floor(difference / 1000 / 60 / 60 / 24);
  518. const hours = Math.floor(difference / 1000 / 60 / 60) % 24;
  519. const minutes = Math.floor(difference / 1000 / 60) % 60;
  520. const seconds = Math.floor(difference / 1000) % 60;
  521. insertCountdownValues({ days, hours, minutes, seconds });
  522. }
  523. const handleCountdownDisplay = () => {
  524. loading.remove();
  525. countdown.style.display = 'flex';
  526. }
  527. setTimeout(handleCountdownDisplay, 1000)
  528. setInterval(updateCountdown, 1000);
  529. </script>
  530. <div class="message" id="mensagem">Texto original aqui.</div>
  531. <script>
  532. document.getElementById('mensagem').textContent = getComputedStyle(document.documentElement).getPropertyValue('--textonovo');
  533. </script>
  534. <div class="card border-0 p-2 shadow mb-3 w-100">
  535. <img class="logo">
  536. <script>
  537. document.documentElement.style.setProperty('--logo-img-url',);
  538. </script>
  539. <div class="input-group mb-2 shadow" id="config-area">
  540. <input class="form-control" type="text" placeholder="CONFIGURAÇÃO" readonly title="configurações"
  541. id="config" style="background-color: #0808083f;" />
  542. <span class="input-group-text me-2">
  543. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
  544. class="bi bi:bar-chart" viewBox="0 0 16 16">
  545. <path
  546. d="M4 11H2v3h2v-3zm5-4H7v7h2V7zm5-5v12h-2V2h2zm-2-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1h-2zM6 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm-5 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-3z" />
  547. </svg>
  548. </span>
  549. </div>
  550. <div class="input-group input mb-2 shadow">
  551. <span class="input-group-text">
  552. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
  553. class="bi bi:file-person" viewBox="0 0 16 16">
  554. <path
  555. d="M12 1a1 1 0 0 1 1 1v10.755S12 11 8 11s-5 1.755-5 1.755V2a1 1 0 0 1 1-1h8zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4z" />
  556. <path d="M8 10a3 3 0 1 0 0-6a3 3 0 0 0 0 6z" />
  557. </g>
  558. </svg>
  559. </span>
  560. <input class="form-control" type="text" placeholder="usuario" id="username"
  561. style="background-color: #0808083f;" />
  562. </div>
  563. <div class="input-group input mb-2 shadow">
  564. <span class="input-group-text">
  565. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
  566. class="bi bi:file-earmark-lock" viewBox="0 0 16 16">
  567. <path
  568. d="M10 7v1.076c.54.166 1 .597 1 1.224v2.4c0 .816-.781 1.3-1.5 1.3h-3c-.719 0-1.5-.484-1.5-1.3V9.3c0-.627.46-1.058 1-1.224V7a2 2 0 1 1 4 0zM7 7v1h2V7a1 1 0 0 0-2 0zM6 9.3v2.4c0 .042.02.107.105.175A.637.637 0 0 0 6.5 12h3a.64.64 0 0 0 .395-.125c.085-.068.105-.133.105-.175V9.3c0-.042-.02-.107-.105-.175A.637.637 0 0 0 9.5 9h-3a.637.637 0 0 0-.395.125C6.02 9.193 6 9.258 6 9.3z" />
  569. <path
  570. d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z" />
  571. </g>
  572. </svg>
  573. </span>
  574. <input class="form-control" type="password" placeholder="senha" id="password"
  575. style="background-color: #0808083f;" />
  576. <span class="input-group-text me-2"
  577. onclick="password.type==`text`?password.type = `password`:password.type = `text`">
  578. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye"
  579. viewBox="0 0 16 16">
  580. <path
  581. d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" />
  582. <path
  583. d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z" />
  584. </svg>
  585. </span>
  586. </div>
  587. <div class="input-group input mb-2 shadow">
  588. <span class="input-group-text">
  589. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-key"
  590. viewBox="0 0 16 16">
  591. <path
  592. d="M0 8a4 4 0 0 1 7.465-2H14a.5.5 0 0 1 .354.146l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0L13 9.207l-.646.647a.5.5 0 0 1-.708 0L11 9.207l-.646.647a.5.5 0 0 1-.708 0L9 9.207l-.646.647A.5.5 0 0 1 8 10h-.535A4 4 0 0 1 0 8zm4-3a3 3 0 1 0 2.712 4.285A.5.5 0 0 1 7.163 9h.63l.853-.854a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.793-.793-1-1h-6.63a.5.5 0 0 1-.451-.285A3 3 0 0 0 4 5z" />
  593. <path d="M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
  594. </svg>
  595. </span>
  596. <input class="form-control" type="text" placeholder="V2ray UUID" id="uuid"
  597. style="background: #0808083f;" />
  598. <span class="input-group-text me-2"
  599. onclick="uuid.type==`text`?uuid.type = `password`:uuid.type = `text`">
  600. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye"
  601. viewBox="0 0 16 16">
  602. <path
  603. d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" />
  604. <path
  605. d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z" />
  606. </svg>
  607. </span>
  608. </div>
  609. <button class="btn btn-dark w-100 shadow" id="start-stop">INICIAR</button>
  610. <nav>
  611. <span id="sync" onclick="DtStartAppUpdate.execute()" class="fi fi-rr-refresh">
  612. <?xml version="1.0" encoding="UTF-8"?>
  613. <svg xmlns="http://www.w3.org/2000/svg" id="Outline" viewBox="0 0 24 24" width="24" height="24">
  614. <path
  615. d="M12,2a10.032,10.032,0,0,1,7.122,3H16a1,1,0,0,0-1,1h0a1,1,0,0,0,1,1h4.143A1.858,1.858,0,0,0,22,5.143V1a1,1,0,0,0-1-1h0a1,1,0,0,0-1,1V3.078A11.981,11.981,0,0,0,.05,10.9a1.007,1.007,0,0,0,1,1.1h0a.982.982,0,0,0,.989-.878A10.014,10.014,0,0,1,12,2Z" />
  616. <path
  617. d="M22.951,12a.982.982,0,0,0-.989.878A9.986,9.986,0,0,1,4.878,19H8a1,1,0,0,0,1-1H9a1,1,0,0,0-1-1H3.857A1.856,1.856,0,0,0,2,18.857V23a1,1,0,0,0,1,1H3a1,1,0,0,0,1-1V20.922A11.981,11.981,0,0,0,23.95,13.1a1.007,1.007,0,0,0-1-1.1Z" />
  618. </svg>
  619. </span>
  620. <span id="logger" class="fi fi-rs-clipboard-list">
  621. <?xml version="1.0" encoding="UTF-8"?>
  622. <svg xmlns="http://www.w3.org/2000/svg" id="Outline" viewBox="0 0 24 24" width="24" height="24">
  623. <path
  624. d="M11,12h6v2h-6v-2ZM21,2V21c0,1.654-1.346,3-3,3H6c-1.654,0-3-1.346-3-3V2h5.171c.413-1.164,1.525-2,2.829-2h2c1.304,0,2.416,.836,2.829,2h5.171Zm-2,2h-5v-1c0-.552-.449-1-1-1h-2c-.551,0-1,.448-1,1v1H5V21c0,.552,.449,1,1,1h12c.551,0,1-.448,1-1V4Zm-8,6h6v-2h-6v2Zm0,8h6v-2h-6v2ZM7,10h2v-2h-2v2Zm0,4h2v-2h-2v2Zm0,4h2v-2h-2v2Z" />
  625. </svg>
  626. </span>
  627. <span aria-hidden="true" onclick="ToolsModal.show()" class="fi fi-rr-settings">
  628. <?xml version="1.0" encoding="UTF-8"?>
  629. <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" id="Outline" viewBox="0 0 24 24"
  630. width="24" height="24">
  631. <path d="M12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z" />
  632. <path
  633. d="M21.294,13.9l-.444-.256a9.1,9.1,0,0,0,0-3.29l.444-.256a3,3,0,1,0-3-5.2l-.445.257A8.977,8.977,0,0,0,15,3.513V3A3,3,0,0,0,9,3v.513A8.977,8.977,0,0,0,6.152,5.159L5.705,4.9a3,3,0,0,0-3,5.2l.444.256a9.1,9.1,0,0,0,0,3.29l-.444.256a3,3,0,1,0,3,5.2l.445-.257A8.977,8.977,0,0,0,9,20.487V21a3,3,0,0,0,6,0v-.513a8.977,8.977,0,0,0,2.848-1.646l.447.258a3,3,0,0,0,3-5.2Zm-2.548-3.776a7.048,7.048,0,0,1,0,3.75,1,1,0,0,0,.464,1.133l1.084.626a1,1,0,0,1-1,1.733l-1.086-.628a1,1,0,0,0-1.215.165,6.984,6.984,0,0,1-3.243,1.875,1,1,0,0,0-.751.969V21a1,1,0,0,1-2,0V19.748a1,1,0,0,0-.751-.969A6.984,6.984,0,0,1,7.006,16.9a1,1,0,0,0-1.215-.165l-1.084.627a1,1,0,1,1-1-1.732l1.084-.626a1,1,0,0,0,.464-1.133,7.048,7.048,0,0,1,0-3.75A1,1,0,0,0,4.79,8.992L3.706,8.366a1,1,0,0,1,1-1.733l1.086.628A1,1,0,0,0,7.006,7.1a6.984,6.984,0,0,1,3.243-1.875A1,1,0,0,0,11,4.252V3a1,1,0,0,1,2,0V4.252a1,1,0,0,0,.751.969A6.984,6.984,0,0,1,16.994,7.1a1,1,0,0,0,1.215.165l1.084-.627a1,1,0,1,1,1,1.732l-1.084.626A1,1,0,0,0,18.746,10.125Z" />
  634. </svg>
  635. </span>
  636. </nav>
  637. </div>
  638. <div class="card my-3 w-100 text-center border-0 p-2 shadow text-light fs-5 text-uppercase fw-bold" id="state"
  639. style="padding: 5px !important; font-size: 15px !important;">
  640. </div>
  641. <div class="modal fade" id="checkUserModal">
  642. <div class="modal-dialog modal-dialog-centered" role="document">
  643. <div class="modal-content rounded-3 shadow">
  644. <div class="modal-header border-bottom-0 pb-0">
  645. <h1 class="modal-title fs-5 chk-title text-light"></h1>
  646. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  647. aria-label="Close"></button>
  648. </div>
  649. <div class="modal-body text-center">
  650. <p class="fs-5 mb-0 chk-message text-light"></p>
  651. </div>
  652. </div>
  653. </div>
  654. </div>
  655. <div class="modal fade" id="errorModal">
  656. <div class="modal-dialog modal-dialog-centered" role="document">
  657. <div class="modal-content rounded-3 shadow">
  658. <div class="modal-header border-bottom-0 pb-0">
  659. <h1 class="modal-title fs-5 err-title text-light"></h1>
  660. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  661. aria-label="Close"></button>
  662. </div>
  663. <div class="modal-body text-center">
  664. <p class="fs-5 mb-0 err-message text-light"></p>
  665. </div>
  666. </div>
  667. </div>
  668. </div>
  669. <div class="modal fade" id="loggerModal">
  670. <div class="modal-dialog modal-dialog-centered" role="document">
  671. <div class="modal-content rounded-3 shadow">
  672. <div class="modal-body p-1 text-center">
  673. <ul class="list-group bg-transparent overflow-y-auto logger-content" style="max-height: 600px;">
  674. </ul>
  675. </div>
  676. <div class="modal-footer flex-nowrap p-0">
  677. <button type="button" class="btn btn-lg btn-dark text-light w-100 clear-logger">LIMPAR</button>
  678. <button type="button" class="btn btn-lg btn-dark text-light w-100"
  679. data-bs-dismiss="modal">FECHAR</button>
  680. </div>
  681. </div>
  682. </div>
  683. </div>
  684. <div class="tool webm modal fade" index="-1" id="ToolsModal">
  685. <div class="modal-dialog modal-dialog-centered" role="document">
  686. <div class="modal-content">
  687. <div class="tool modal-header">
  688. <h5 class="modal-title text_config">Configurações do aplicativo</h5>
  689. </div>
  690. <div class="modal-body">
  691. <button class="tool-bt rounded-2xl text-white" onclick="DtStartApnActivity.execute()"><i
  692. class="info2 bi bi-wifi mr-2"></i>Alterar protocolo de APN</button>
  693. </div>
  694. <div class="modal-body">
  695. <button class="tool-bt rounded-2xl text-white"
  696. onclick="DtIgnoreBatteryOptimizations.execute()"><i
  697. class="info2 bi bi-battery-full mr-2"></i>Otimizar Bateria</button>
  698. </div>
  699. <div class="modal-body">
  700. <button class="tool-bt rounded-2xl text-white" id="btnHotSpot"><i
  701. class="info2 bi bi-trash3 mr-2"></i>Compartilhar Internet</button>
  702. </div>
  703. <div class="modal-body">
  704. <button class="tool-bt rounded-2xl text-white" onclick="DtCleanApp.execute()"><i
  705. class="info2 bi bi-trash3 mr-2"></i>Limpar cachê e dados</button>
  706. </div>
  707. <div class="tool modal-footer">
  708. <button type="button" class="btn btn-primary" data-bs-dismiss="modal"
  709. style="background-color: var(--btn-modal);">FECHAR</button>
  710. </div>
  711. </div>
  712. </div>
  713. </div>
  714. <div class="modal fade" id="configModal">
  715. <div class="modal-dialog modal-dialog-centered" role="document">
  716. <div class="modal-content rounded-3 shadow">
  717. <div class="modal-header border-bottom-0 pb-0">
  718. <h1 class="modal-title fs-5 text-white">CONFIGURAÇÕES</h1>
  719. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  720. aria-label="Close"></button>
  721. </div>
  722. <div class="modal-body p-1 text-center">
  723. <ul class="list-group bg-transparent overflow-y-auto config-body" style="max-height: 600px;">
  724. <li class="list-group-item bg-transparent text-white border-0">
  725. <p>CATEGORIA</p>
  726. <ul class="list-group bg-transparent overflow-y-auto text-start">
  727. <li
  728. class="list-group-item d-flex bg-transparent text-white border-0 border-bottom rounded-0">
  729. <img src="https://cdn-icons-png.flaticon.com/512/3686/3686811.png" width="40"
  730. height="40">
  731. <div class="d-flex flex-column ms-2 w-100">
  732. <span>CONFIG 01</span>
  733. <span>DESC 01</span>
  734. </div>
  735. <div class="d-flex flex-column ms-2 w-100">
  736. <span class="text-end">CONFIG_MODE</span>
  737. </div>
  738. </li>
  739. </ul>
  740. </li>
  741. </ul>
  742. </div>
  743. </div>
  744. </div>
  745. </div>
  746. <div class="modal fade" id="RenovarModal">
  747. <div class="modal-dialog modal-dialog-centered" role="document">
  748. <div class="modal-content rounded-3 shadow">
  749. <div class="modal-header border-bottom-0 py-3">
  750. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
  751. aria-label="Close"></button>
  752. </div>
  753. <div class="modal-body ratio rounded-bottom-3" style="height: 600px;">
  754. <div class="spinner d-flex w-100 h-100 align-items-center justify-content-center">
  755. <div class="spinner-border text-light p-5" role="status">
  756. <span class="visually-hidden">Loading...</span>
  757. </div>
  758. </div>
  759. <iframe class="rounded-bottom-3" id="RenovarFrame"></iframe>
  760. </div>
  761. </div>
  762. </div>
  763. </div>
  764. <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
  765. <script>
  766. const startHotSpot = () => {
  767. DtStartHotSpotService.execute();
  768. txtbtn.textContent = 'HOTSPOT';
  769. }
  770. const stopHotSpot = () => {
  771. DtStopHotSpotService.execute();
  772. txtbtn.textContent = 'HOTSPOT';
  773. }
  774. const toggleHotSpot = () => {
  775. const hotSpotStatus = window?.DtGetStatusHotSpotService?.execute() ?? 'STOPPED';
  776. hotSpotStatus == 'RUNNING' ? stopHotSpot() : startHotSpot();
  777. }
  778. const btnHotSpot = document.querySelector("#btnHotSpot");
  779. btnHotSpot.addEventListener('click', toggleHotSpot);
  780. const hotSpotStatus = window?.DtGetStatusHotSpotService?.execute() ?? 'STOPPED';
  781. if (hotSpotStatus == 'RUNNING') {
  782. txtbtn.textContent = 'HOTSPOT';
  783. }
  784. </script>
  785. <script>
  786. class AndroidMock {
  787. static getLocalIP() {
  788. return '192.168.0.1';
  789. }
  790. static getConfig() {
  791. return JSON.stringify({
  792. urlCheckUser: 'URLAQUI'
  793. });
  794. }
  795. static getNetworkName() {
  796. return 'REDE';
  797. }
  798. static openRadioInfo() {
  799. console.log('openRadioInfo');
  800. }
  801. }
  802. </script>
  803. <script>
  804. function showLocalIP(android) {
  805. console.log(android.getNetworkName());
  806. document.getElementById('name').innerHTML = ' ' + android.getNetworkName() + ':';
  807. document.getElementById('ip').innerHTML = android.getLocalIP();
  808. setInterval(() => {
  809. document.getElementById('name').innerHTML =
  810. ' ' + android.getNetworkName() + ':';
  811. document.getElementById('ip').innerHTML = android.getLocalIP();
  812. }, 2000)
  813. }
  814. window.onload = function () {
  815. const android = window.Android || AndroidMock;
  816. showLocalIP(android);
  817. }
  818. function mostrar(id) {
  819. if (document.getElementById(id).style.display !== "none") {
  820. document.getElementById(id).style.display = "none";
  821. return;
  822. }
  823. Array.from(document.getElementsByClassName("hidden")).forEach(
  824. div => (div.style.display = "none")
  825. );
  826. document.getElementById(id).style.display = "block";
  827. }
  828. </script>
  829. <script>
  830. const configArea = document.querySelector('#config-area')
  831. const config = document.querySelector('#config')
  832. const username = document.querySelector('#username')
  833. const password = document.querySelector('#password')
  834. const uuid = document.querySelector('#uuid')
  835. const logger = document.querySelector('#logger')
  836. const networkStatus = document.querySelector('#section.local-ip')
  837. const startStopVpn = document.querySelector('#start-stop')
  838. const stateStatus = document.querySelector('#state')
  839. const loggerModal = new bootstrap.Modal(document.querySelector('#loggerModal'))
  840. const checkUserModal = new bootstrap.Modal(document.querySelector('#checkUserModal'))
  841. const errorModal = new bootstrap.Modal(document.querySelector('#errorModal'))
  842. const configModal = new bootstrap.Modal(document.querySelector('#configModal'))
  843. const ToolsModal = new bootstrap.Modal(document.querySelector('#ToolsModal'))
  844. const clearLogger = document.querySelector('.clear-logger')
  845. const RenovarModal = new bootstrap.Modal(document.querySelector('#RenovarModal'))
  846. configArea.addEventListener('click', e => showConfigsModal())
  847. username.addEventListener('input', e => DtUsername.set(e.target.value))
  848. password.addEventListener('input', e => DtPassword.set(e.target.value))
  849. uuid.addEventListener('input', e => DtUuid.set(e.target.value))
  850. logger.addEventListener('click', e => loggerModal.show())
  851. startStopVpn.addEventListener('click', (e) => {
  852. if (DtGetVpnState.execute() != 'DISCONNECTED') {
  853. DtExecuteVpnStop.execute()
  854. } else {
  855. DtExecuteVpnStart.execute()
  856. }
  857. })
  858. clearLogger.addEventListener('click', () => DtClearLogs.execute())
  859. RenovarModal._element.addEventListener('shown.bs.modal', () => {
  860. const iframe = document.querySelector('#RenovarFrame');
  861. if (!iframe.src) {
  862. iframe.src = 'https://painel.plenonet.com.br/renovar.php'
  863. iframe.addEventListener('load', () => {
  864. mp3Modal._element.querySelector('.spinner').classList.add('d-none')
  865. })
  866. }
  867. })
  868. RenovarModal._element.addEventListener('hide.bs.modal', () => {
  869. const iframe = document.querySelector('#RenovarFrame');
  870. iframe.src = '';
  871. })
  872. Object.defineProperty(String.prototype, 't', {
  873. value: function t() {
  874. return window?.DtTranslateText?.execute('' + this) ?? '' + this
  875. },
  876. writable: true,
  877. configurable: true,
  878. })
  879. const dtConfigClickListener = () => {
  880. const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{ "auth": {}, "mode": "v2ray" }`)
  881. const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');
  882. config.placeholder = data.name ?? 'LBL_CHOOSE_CONFIG'.t()
  883. username.parentElement.style.display = !data?.auth?.username && !isV2ray ? 'flex' : 'none';
  884. password.parentElement.style.display = !data?.auth?.password && !isV2ray ? 'flex' : 'none';
  885. uuid.parentElement.style.display = !data?.auth?.v2ray_uuid && isV2ray ? 'flex' : 'none';
  886. }
  887. const dtVpnStateListener = state => {
  888. const isRunning = state != 'DISCONNECTED';
  889. stateStatus.innerHTML = ('LBL_STATE_' + state).t()
  890. startStopVpn.innerHTML = isRunning ? 'LBL_BTN_STOP'.t() : 'LBL_BTN_START'.t()
  891. if (isRunning) {
  892. username.setAttribute('readonly', 'true')
  893. password.setAttribute('readonly', 'true')
  894. } else {
  895. username.removeAttribute('readonly')
  896. password.removeAttribute('readonly')
  897. }
  898. if (state == 'CONNECTING') dtShowSuccessToastListener('Conectando...')
  899. }
  900. const dtCheckUserStartedListener = () => {
  901. const data = JSON.parse(window?.DtGetDefaultConfig?.execute() || `{}`)
  902. const isV2ray = data?.mode?.toLowerCase()?.startsWith('v2ray');
  903. if (isV2ray) return;
  904. const html = `
  905. <div class="d-flex justify-content-center">
  906. <div class="spinner-border p-5" role="status">
  907. <span class="visually-hidden">Loading...</span>
  908. </div>
  909. </div>
  910. `
  911. checkUserModal._element.querySelector('.chk-title').textContent = 'CHECK USER'
  912. checkUserModal._element.querySelector('.chk-message').innerHTML = html;
  913. checkUserModal.show()
  914. }
  915. function isBeforeExpiration(expirationDays, daysBefore) {
  916. return expirationDays <= daysBefore;
  917. }
  918. const dtCheckUserModelListener = model => {
  919. const data = JSON.parse(model ?? `{"username": "test"}`);
  920. const html = `
  921. <div class="d-flex flex-column text-white">
  922. <span>👤Nome de usuario: ${data.username}</span>
  923. <span>📆Expira em: ${data.expiration_date}</span>
  924. <span>📆Dias restantes: ${data.expiration_days}</span>
  925. <span>🚫Conexoes: ${data.count_connections}|${data.limit_connections}</span>
  926. ${isBeforeExpiration(data.expiration_days, 3) ? '<span><center>🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨</center><span><span><center>⚠️Faltando 3 dias para o expirar o usuário⚠️</center></span>🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨</span></span>' : ''}
  927. ${isBeforeExpiration(data.expiration_days, 2) ? '<span><span><span><center>⚠️Faltando 2 dias para o expirar o usuário⚠️</center></span><center>🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨</center></span></span>' : ''}
  928. ${isBeforeExpiration(data.expiration_days, 1) ? '<span><span><span><center>⚠️Faltando 1 dias para o expirar o usuário⚠️</center></span><center>🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨</center></span></span>' : ''}
  929. </div>
  930. `;
  931. checkUserModal._element.querySelector('.chk-title').textContent = '📆 Olá, ' + data.username.toUpperCase() + '👤';
  932. checkUserModal._element.querySelector('.chk-message').innerHTML = html;
  933. checkUserModal.show();
  934. }
  935. const dtMessageErrorListener = message => {
  936. const data = JSON.parse(message)
  937. errorModal._element.querySelector('.err-title').textContent = data.title;
  938. errorModal._element.querySelector('.err-message').innerHTML = data.content;
  939. errorModal.show()
  940. }
  941. const dtOnNewLogListener = () => {
  942. const mock = [];
  943. for (let i = 0; i < 30; i++) {
  944. mock.push({ 'TIME': 'MESSAGE ' + i })
  945. }
  946. const log = window?.DtGetLogs?.execute() || JSON.stringify(mock)
  947. const data = JSON.parse(log)
  948. let content = '';
  949. data.forEach(item => {
  950. content += '<li class="list-group-item fs-6 bg-transparent text-white p-0 border-0 text-start ms-2 text-wrap">';
  951. content += Object.keys(item)[0] + " " + item[Object.keys(item)]
  952. content += '</li>';
  953. })
  954. loggerModal._element.querySelector('.logger-content').innerHTML = content;
  955. const listGroup = loggerModal._element.querySelector('.list-group')
  956. listGroup.scrollTo(0, listGroup.scrollHeight)
  957. }
  958. const dtVpnStartedSuccessListener = () => dtShowSuccessToastListener('Conectado com sucesso')
  959. const dtVpnStoppedSuccessListener = () => dtShowSuccessToastListener('Desconectado com sucesso')
  960. const dtShowSuccessToastListener = text => {
  961. Toastify({
  962. text: text,
  963. close: true,
  964. style: {
  965. background: 'linear-gradient(to right, #00b09b, #96c93d)',
  966. marginTop: '35px',
  967. }
  968. }).showToast()
  969. }
  970. const dtShowErrorToastListener = text => {
  971. Toastify({
  972. text: text,
  973. close: true,
  974. style: {
  975. background: 'linear-gradient(to right, #ff5c33, #e69900)',
  976. marginTop: '35px',
  977. }
  978. }).showToast()
  979. }
  980. const showConfigsModal = () => {
  981. const mock = '[{"sorter":6,"color":"#6D08041C","name":"CONFIG","id":1393,"items":[{"mode":"V2RAY - VLESS","sorter":4,"tlsVersion":"TLSv1.2","name":"CONFIG 01","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":11803,"status":"ACTIVE"},{"mode":"SSH_DIRECT","sorter":2,"tlsVersion":"TLSv1.2","name":"CONFIG 02","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":28627,"status":"ACTIVE"},{"mode":"OVPN_PROXY","sorter":23,"tlsVersion":"TLSv1.2","name":"CONFIG 03","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":30001,"status":"ACTIVE"}]},{"sorter":2,"color":"#6D08041C","name":"CONFIG 2","id":1846,"items":[{"mode":"SSH_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG 01","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":26295,"status":"ACTIVE"}]},{"sorter":4,"color":"#80000000","name":"CONFIG 3","id":3310,"items":[{"mode":"SSH_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG. TEST","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":29997,"status":"ACTIVE"},{"mode":"OVPN_PROXY","sorter":1,"tlsVersion":"TLSv1.2","name":"CONFIG. TEST 2","icon":"https://cdn-icons-png.flaticon.com/512/8187/8187143.png","id":29998,"status":"ACTIVE"}]}]'
  982. const data = JSON.parse(window?.DtGetConfigs?.execute() || mock)
  983. data.sort((a, b) => a.sorter - b.sorter)
  984. data.forEach(item => item.items.sort((a, b) => a.sorter - b.sorter))
  985. const body = configModal._element.querySelector('.config-body')
  986. body.innerHTML = ''
  987. data.forEach(category => {
  988. const categoryElement = document.createElement('li')
  989. categoryElement.classList.add('list-group-item', 'bg-transparent', 'text-white', 'border-0', 'mb-1', 'rounded-1', 'px-1')
  990. categoryElement.innerHTML = `<span class="fw-bold btn-dark w-100 d-block p-1 rounded-1 mb-1">${category.name}</span>`
  991. const configUlElement = document.createElement('ul')
  992. configUlElement.classList.add('list-group', 'bg-transparent', 'overflow-y-auto')
  993. category.items.forEach(item => {
  994. const configElement = document.createElement('li')
  995. configElement.classList.add('list-group-item', 'd-flex', 'btn-dark', 'text-white', 'border-0', 'rounded-2', 'px-1', 'py-2', 'mb-1')
  996. configElement.innerHTML = `
  997. <img src="${item.icon}" width="40" height="40">
  998. <div class="text-start d-flex flex-column ms-2 w-100 text-truncate">
  999. <span class="fw-bold text-uppercase" style="font-size: 0.8rem;">${item.name}</span>
  1000. <span class="fst-italic fw-bold" style="font-size: 0.7rem;">${item.description || ''}</span>
  1001. </div>
  1002. <div class="d-flex flex-column ms-2">
  1003. <span class="fst-italic fw-bold text-end text-uppercase text-nowrap" style="font-size: 0.8rem;">${item.mode}</span>
  1004. </div>
  1005. </li>
  1006. `
  1007. configElement.addEventListener('click', e => {
  1008. window?.DtSetConfig?.execute(item.id)
  1009. configModal.hide()
  1010. })
  1011. configUlElement.appendChild(configElement)
  1012. })
  1013. categoryElement.appendChild(configUlElement)
  1014. body.appendChild(categoryElement)
  1015. })
  1016. configModal.show()
  1017. }
  1018. username.value = window?.DtUsername?.get() ?? ''
  1019. password.value = window?.DtPassword?.get() ?? ''
  1020. uuid.value = window?.DtUuid?.get() ?? ''
  1021. username.placeholder = 'LBL_USERNAME'.t()
  1022. password.placeholder = 'LBL_PASSWORD'.t()
  1023. uuid.placeholder = 'LBL_UUID'.t()
  1024. dtOnNewLogListener()
  1025. dtVpnStateListener(window?.DtGetVpnState?.execute() ?? 'DISCONNECTED')
  1026. dtConfigClickListener()
  1027. console.log('ODAIR.Dev!🚀')
  1028. </script>
  1029. </body>
  1030. </html>

comments powered by Disqus