Auto-Duolingo

[Lite Version] Automatically farm experience points, hacking Duolingo is so easy!

Verze ze dne 14. 02. 2025. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Auto-Duolingo
  3. // @version 1.0.8
  4. // @author DevX
  5. // @namespace http://tampermonkey.net/
  6. // @description [Lite Version] Automatically farm experience points, hacking Duolingo is so easy!
  7. // @match https://*.duolingo.*/*
  8. // @grant none
  9. // @license MIT
  10. // @icon https://autoduo.click/assets/imgs/favicon.ico
  11. // ==/UserScript==
  12.  
  13. (() => {
  14. const AUTODUOLINGO_STORAGE = "autoDuolingoStorage";
  15. const { isSafeMode, isShowUI, isAnimationOff, exp, time, version, isNewNotify, rmNotiVer, rmNotiContent } =
  16. getSession();
  17. const { notifyVersion } = getLocal(AUTODUOLINGO_STORAGE);
  18.  
  19. const autoDuoLite = {
  20. initSignature: function () {
  21. this.signatureElm = document.createElement("div");
  22. Object.assign(this.signatureElm, {
  23. className: "signature-listening",
  24. innerHTML: `
  25. <div>
  26. Auto-Duolingo DevX
  27. <div class="autoduo-lite-version">
  28. LITE VERSION <button class="autoduo-upgrade" title="Upgrade version"></button>
  29. </div>
  30. </div>
  31. `,
  32. });
  33. const upgrade = this.signatureElm.querySelector('.autoduo-upgrade')
  34. upgrade.addEventListener('click', () => this.updateBtn.click())
  35. document.body.appendChild(this.signatureElm);
  36. },
  37.  
  38. initContact: function () {
  39. this.contactWrapper = document.createElement("div");
  40. Object.assign(this.contactWrapper, {
  41. className: "contact-wrapper-listening",
  42. innerHTML: `<a class="contact-item-listening" href="https://t.me/imdevx" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/tele-icon.ndx')">
  43. <p class="popup">Chat with DevX</p>
  44. </a>
  45. <a class="contact-item-listening" href="https://t.me/autoduofamily" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/tele-gr-icon.ndx')">
  46. <p class="popup">Telegram Community</p>
  47. </a>
  48. <a class="contact-item-listening" href="https://zalo.me/g/lmhfps187" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/zalo-icon.ndx')">
  49. <p class="popup">Zalo Community</p>
  50. </a>
  51. <a class="contact-item-listening" href="https://www.youtube.com/@autoduofamily" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/youtube-icon.ndx')">
  52. <p class="popup">Youtube Channel</p>
  53. </a>
  54. <a class="contact-item-listening" href="https://www.facebook.com/groups/autoduofamily" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/facebook-icon.png')">
  55. <p class="popup">Facebook Community</p>
  56. </a>
  57. <a class="contact-item-listening" id="greasyfork" href="https://greatest.deepsurf.us/en/scripts/487867-auto-duolingo" target="_blank" style="--data-img: url('https://autoduo.click/assets/client/greasyfork-icon.ndx')">
  58. <p class="popup">Greasy Fork</p>
  59. </a>`,
  60. });
  61. },
  62.  
  63. initPopup: function () {
  64. this.updateGuidePopup = document.createElement("div");
  65. Object.assign(this.updateGuidePopup, {
  66. className: "update-guide-popup",
  67. innerHTML: `
  68. <div class="guide-popup-main">
  69. <h2 class="guide-popup-title">AUTO GUIDE</h2>
  70. <div class="guide-popup-content">
  71. <p class="guide-popup-text" style="color: rgb(0,159,235); margin-bottom: 24px">
  72. This is a lite version of AutoDuo with the main feature of automatically farming listening exercises (requires Super Duolingo). To use auto, follow the steps below:
  73. </p>
  74. <p class="guide-popup-text">
  75. <b>Step 1:</b> Go to the Super workout page (with the dumbbell icon).
  76. </p>
  77. <p class="guide-popup-text">
  78. <b>Step 2</b>: Press the "Start Farm XP" button to start the automatic farming process!.
  79. </p>
  80. <i style="font-size: 13px; margin-top: 12px; line-height: 1.3; display: inline-block"><b style="color: #ff5555">Note: </b>Super Duolingo is required to use this version. If you want to auto or use all the other useful features without Super, click to watch the video tutorial!</i>
  81. <div class="guide-popup-btn">
  82. <button class="autoduo-btn popup-btn-close"><span>Close</span></button>
  83. <a class="autoduo-btn btn-green popup-btn-access" href="https://autoduo.click/l/tutorial/" target="_blank">
  84. <span>Watch tutorial</span>
  85. </a>
  86. </div>
  87. </div>
  88. </div>
  89. `,
  90. });
  91.  
  92. const closePopupBtn = this.updateGuidePopup.querySelector(".popup-btn-close");
  93. closePopupBtn.addEventListener("click", () => {
  94. document.body.contains(this.updateGuidePopup) && this.updateGuidePopup.remove();
  95. });
  96. },
  97.  
  98. initBtn: function () {
  99. this.autoBtn = document.createElement("button");
  100. Object.assign(this.autoBtn, {
  101. className: "autoduo-btn btn-green auto-farm-btn-listening",
  102. innerText: "START FARM XP",
  103. onclick: () => {
  104. this.isAuto ? this.stop() : this.start();
  105. },
  106. });
  107.  
  108. this.updateBtn = document.createElement("button");
  109. Object.assign(this.updateBtn, {
  110. className: "autoduo-btn guide-btn-listening",
  111. innerText: "Instructions for use",
  112. onclick: () => {
  113. this.isAuto && this.stop();
  114. document.body.appendChild(this.updateGuidePopup);
  115. },
  116. });
  117.  
  118. this.showHideBtn = document.createElement("button");
  119. Object.assign(this.showHideBtn, {
  120. className: "show-hide-listening",
  121. style: `--data-version: 'V${this.version}'`,
  122. innerHTML: "<i></i>",
  123. });
  124.  
  125. this.showHideBtn.addEventListener("click", () => {
  126. this.isShowUI = !this.isShowUI;
  127. this.handleShowHideUI(true);
  128. });
  129. document.body.append(this.showHideBtn);
  130. },
  131.  
  132. initBubbles: function () {
  133. this.notifyBubble = document.createElement("button");
  134. Object.assign(this.notifyBubble, {
  135. className: "bubble-item-listening notify-bubble-listening",
  136. title: "Notification",
  137. });
  138.  
  139. this.superBubble = document.createElement("a");
  140. Object.assign(this.superBubble, {
  141. className: "bubble-item-listening super-bubble-listening",
  142. title: "Duolingo Super Free",
  143. href: "https://t.me/duolingosuperfree",
  144. target: "_blank",
  145. });
  146.  
  147. this.marketerBubble = document.createElement("a");
  148. Object.assign(this.marketerBubble, {
  149. className: "bubble-item-listening streak-bubble-listening",
  150. title: "Hack Streak Service",
  151. href: "https://autoduo.click/l/hack-streak/",
  152. target: "_blank",
  153. });
  154. },
  155.  
  156. initStatistics: function () {
  157. this.statistic = document.createElement("div");
  158. this.keyTypeElm = document.createElement("p");
  159. this.expElm = document.createElement("p");
  160. this.dateElm = document.createElement("p");
  161. const statisticWrapper = document.createElement("div");
  162.  
  163. Object.assign(this.keyTypeElm, {
  164. className: "key-type-listening",
  165. innerHTML: "<b style='color: #009feb'>Auto-Duolingo Lite</b>",
  166. });
  167.  
  168. this.expElm.className = "total-exp-listening";
  169. this.expElm.innerText = this.exp;
  170. this.statistic.className = "statistic-listening";
  171. this.dateElm.className = "time-listening";
  172. statisticWrapper.className = "statistic-wrapper-listening";
  173.  
  174. statisticWrapper.append(this.expElm, this.dateElm);
  175. this.statistic.append(this.keyTypeElm, statisticWrapper);
  176. },
  177.  
  178. initFunctions: function () {
  179. this.animationOffWrapper = document.createElement("div");
  180. this.animationOffWrapper.style = `--data-name: "Hide Animation"`;
  181. const animationOffInfo =
  182. "HIDE ANIMATION MODE:\n" +
  183. "- When this mode is enabled, images and animations on the website will be hidden to optimize performance.\n\n" +
  184. "Suggestion: To achieve the best performance, you should find and disable items related to effects in Duolingo's settings!";
  185. this.autoduoCreateSwitch(
  186. animationOffInfo,
  187. this.animationOffWrapper,
  188. 1,
  189. this.isAnimationOff,
  190. (setSwitch) => {
  191. this.isAnimationOff = !this.isAnimationOff;
  192. this.handleAnimationOff(true);
  193. setSwitch(this.isAnimationOff);
  194. }
  195. );
  196.  
  197. this.safeModeWrapper = document.createElement("div");
  198. this.safeModeWrapper.style = `--data-name: "Safe Mode"`;
  199. const safeModeInfo =
  200. "SAFE MODE:\n" +
  201. "- When this mode is enabled, the system will simulate user actions when using auto. The speed will be more relaxed, " +
  202. "in exchange for the completion time of lessons and the amount of experience will be the most natural, minimizing " +
  203. "the risks of REPORT and account BAN!";
  204. this.autoduoCreateSwitch(safeModeInfo, this.safeModeWrapper, 2, this.isSafeMode, () => {
  205. this.isSafeMode ? this.handleSafeModeOff() : this.handleSafeModeOn();
  206. });
  207.  
  208. this.turboModeWrapper = document.createElement("div");
  209. this.turboModeWrapper.style = `--data-name: "Turbo Mode"`;
  210. const turboModeInfo =
  211. "TURBO MODE:\n" +
  212. "- When enabled, the system will significantly boost the auto speed. It will utilize higher performance and " +
  213. "is not recommended for use on low-performance devices.\n- Turn it off and refresh the page if you encounter " +
  214. "issues while activating this mode!\n\n- Note: This is an experimental feature and requires a VIP Key to use. " +
  215. "Only enable it when you truly require speed and understand its implications!!";
  216. this.autoduoCreateSwitch(turboModeInfo, this.turboModeWrapper, 4, false);
  217.  
  218. this.legendModeWrapper = document.createElement("div");
  219. this.legendModeWrapper.style = `--data-name: "Lesson Pass Mode"`;
  220. const legendModeInfo =
  221. "LESSON PASS MODE:\n" +
  222. "- When activated, the system won't repeat exercises as in the regular mode but will engage in exercises actively selected by the user. " +
  223. "This mode is used for legendary exercises, story exercises, and most other similar exercises.\n- You need to enter the lesson you want to " +
  224. "pass in, and then the system will automatically complete that lesson for you!\n" +
  225. "- When this mode is activated, the basic auto button will be temporarily disabled.";
  226. this.autoduoCreateSwitch(legendModeInfo, this.legendModeWrapper, 5, false);
  227.  
  228. this.targetModeWrapper = document.createElement("div");
  229. this.targetModeWrapper.style = `--data-name: "XP Target Mode"`;
  230. const targetModeInfo =
  231. "EXPERIENCE POINT TARGET MODE:\n" +
  232. "- By setting an experience point target, the system will automatically stop auto mode when the total experience points " +
  233. "obtained equal or exceed the specified target.\n- This helps you better control the auto function, " +
  234. "preventing unintentional accumulation of excess experience points due to forgetting to turn off auto mode!\n\n" +
  235. "- Note: The experience point target must be greater than the current amount of experience points obtained through auto mode!";
  236. this.autoduoCreateSwitch(targetModeInfo, this.targetModeWrapper, 6, false);
  237.  
  238. this.passModeWrapper = document.createElement("div");
  239. this.passModeWrapper.style = `--data-name: "Auto Pass Mode"`;
  240. const passModeInfo =
  241. "AUTO PASS MODE:\n" +
  242. "- By setting the number of lessons you wish to pass, the system will automatically pass the corresponding " +
  243. "number of new lessons as per the value you've set!\n\n" +
  244. "- Note: the lesson value should be within the range of 1 - 1000 (Enter 0 for unlimited auto)!";
  245. this.autoduoCreateSwitch(passModeInfo, this.passModeWrapper, 7, false);
  246.  
  247. this.darkModeWrapper = document.createElement("div");
  248. this.darkModeWrapper.style = `--data-name: "Dark Mode"`;
  249. const darkModeInfo = "DARK MODE\n- Enable/disable website dark mode faster!";
  250. this.autoduoCreateSwitch(darkModeInfo, this.darkModeWrapper, 3, this.isDarkMode, (setSwitch) => {
  251. this.isDarkMode = !this.isDarkMode;
  252. const [theme, value, css] = this.isDarkMode
  253. ? ["dark", "on", "--app-offset: 0px; --color-snow: 19, 31, 36; --color-snow-always-light: 255, 255, 255; --color-snow-always-dark: 19, 31, 36; --color-polar: 32, 47, 54; --color-swan: 55, 70, 79; --color-swan-always-light: 229, 229, 229; --color-swan-always-dark: 55, 70, 79; --color-hare: 82, 101, 109; --color-hare-always-light: 175, 175, 175; --color-wolf: 220, 230, 236; --color-eel: 241, 247, 251; --color-squid: 235, 227, 227; --color-walking-fish: 32, 47, 54; --color-flamingo: 148, 81, 81; --color-pig: 245, 164, 164; --color-crab: 255, 120, 120; --color-cardinal: 238, 85, 85; --color-fire-ant: 216, 72, 72; --color-canary: 32, 47, 54; --color-duck: 251, 229, 109; --color-bee: 255, 199, 0; --color-bee-always-dark: 255, 199, 0; --color-lion: 255, 177, 0; --color-fox: 255, 171, 51; --color-cheetah: 32, 47, 54; --color-monkey: 229, 162, 89; --color-camel: 231, 166, 1; --color-guinea-pig: 215, 148, 51; --color-grizzly: 187, 113, 73; --color-sea-sponge: 32, 47, 54; --color-turtle: 95, 132, 40; --color-owl: 147, 211, 51; --color-tree-frog: 121, 185, 51; --color-peacock: 0, 205, 156; --color-iguana: 32, 47, 54; --color-anchovy: 210, 228, 232; --color-beluga: 187, 242, 255; --color-moon-jelly: 122, 240, 242; --color-blue-jay: 63, 133, 167; --color-macaw: 73, 192, 248; --color-whale: 24, 153, 214; --color-humpback: 43, 112, 201; --color-narwhal: 20, 83, 163; --color-manta-ray: 4, 44, 96; --color-starfish: 255, 134, 208; --color-beetle: 206, 130, 255; --color-betta: 144, 105, 205; --color-butterfly: 111, 78, 161; --color-dragon: 204, 52, 141; --color-starling: 92, 108, 252; --color-martin: 71, 85, 223; --color-grackle: 167, 160, 255; --color-honeycreeper: 193, 187, 255; --color-deep-starling: 34, 33, 81; --color-deep-martin: 16, 15, 62; --color-legendary-foreground: 140, 65, 3; --color-stardust: 199, 255, 254; --color-cosmos: 60, 77, 255; --color-nebula: 63, 34, 236; --color-nova: 207, 23, 200; --color-gamma: 38, 246, 99; --color-starlight: 38, 138, 255; --color-quasar: 252, 85, 255; --color-celestia: 255, 255, 255; --color-eclipse: 0, 4, 55; --color-black: 0, 0, 0; --color-aqua: 43, 164, 176; --color-aqua-always-light: 56, 238, 255; --color-ocean: 56, 238, 255; --color-seafoam: 30, 89, 97; --color-ice: 23, 52, 58; --color-max-shadow: 20, 208, 225; --color-black-white: 255, 255, 255; --color-diamond-stat: 86, 219, 226; --color-mask-green: 144, 220, 72; --color-pearl-stat: 255, 170, 222; --color-snow-dark-swan: 55, 70, 79; --color-black-text: 241, 247, 251; --color-blue-space: 11, 62, 113; --color-juicy-blue-space: 10, 74, 130; --color-juicy-blue-space-light: 35, 83, 144; --color-gold: 250, 169, 25; --color-gray-text: 220, 230, 236; --color-orange: 255, 157, 0; --color-diamond-highlight: 231, 251, 251; --color-diamond: 56, 208, 208; --color-banana: 255, 176, 32; --color-cloud: 207, 207, 207; --color-cloud-light: 221, 221, 221; --color-cloud-lightest: 240, 240, 240; --color-kiwi: 122, 199, 12; --color-kiwi-dark: 93, 151, 9; --color-kiwi-light: 142, 224, 0; --color-facebook: 59, 89, 152; --color-facebook-dark: 45, 67, 115; --color-google: 66, 133, 244; --color-twitter: 29, 161, 242; --color-hv-light-peach: 241, 218, 179; --color-hv-peach: 219, 186, 131; --color-hv-light-orange: 255, 177, 64; --color-hv-orange: 204, 121, 0; --color-hv-brown: 140, 90, 17; --color-streak-panel-extended-background: 205, 121, 0; --color-streak-panel-frozen-background: 43, 112, 201; --color-streak-panel-frozen-flair-background: 73, 192, 248; --color-streak-panel-frozen-subtitle: 255, 255, 255; --color-streak-panel-frozen-text: 255, 255, 255; --color-streak-panel-frozen-topbar-text: 255, 255, 255; --color-streak-panel-streak-society-background: 215, 148, 51; --color-streak-panel-streak-society-text: 255, 255, 255; --color-streak-panel-unextended-heading-text: 82, 101, 109; --color-streak-panel-unextended-heading-background: 32, 47, 54; --color-streak-panel-unextended-topbar-text: 255, 255, 255; --color-streak-panel-milestone-gradient-start: 255, 147, 58; --color-streak-panel-milestone-gradient-end: 255, 200, 0; --color-streak-society-dark-orange: 255, 151, 1; --color-streak-society-light-orange: 255, 179, 1; --color-friends-quest-own-incomplete: 111, 139, 157; --color-friends-quest-friend-incomplete: 79, 100, 113; --color-black-text-always-light: 60, 60, 60; --color-cardinal-always-light: 255, 75, 75; --color-cowbird: 174, 104, 2; --color-eel-always-light: 75, 75, 75; --color-fox-always-light: 255, 150, 0; --color-fire-ant-always-light: 234, 43, 43; --color-grizzly-lite: 220, 143, 71; --color-guinea-pig-always-light: 205, 121, 0; --color-iguana-always-light: 221, 244, 255; --color-macaw-always-light: 28, 176, 246; --color-owl-always-light: 88, 204, 2; --color-polar-always-light: 247, 247, 247; --color-sea-sponge-always-light: 215, 255, 184; --color-tree-frog-always-light: 88, 167, 0; --color-turtle-always-light: 165, 237, 110; --color-walking-fish-always-light: 255, 223, 224; --color-wolf-always-light: 119, 119, 119; --color-cardinal-always-dark: 238, 85, 85; --color-eel-always-dark: 241, 247, 251; --color-hare-always-dark: 82, 101, 109; --color-macaw-always-dark: 73, 192, 248; --color-owl-always-dark: 147, 211, 51; --color-polar-always-dark: 32, 47, 54; --color-wolf-always-dark: 220, 230, 236; --color-rookie: 0, 175, 133; --color-explorer: 255, 100, 191; --color-traveler: 255, 145, 83; --color-trailblazer: 154, 143, 232; --color-adventurer: 96, 12, 199; --color-discoverer: 111, 44, 57; --color-daredevil: 46, 83, 138; --color-navigator: 9, 47, 119; --color-champion: 255, 110, 53; --color-daily_refresh: 0, 148, 255; --color-dark-mode-locked-path-section-text-color: 82, 101, 109; --color-rookie-progress-bar: 0, 198, 150; --color-explorer-progress-bar: 255, 138, 207; --color-traveler-progress-bar: 255, 167, 106; --color-trailblazer-progress-bar: 169, 157, 254; --color-adventurer-progress-bar: 122, 13, 199; --color-discoverer-progress-bar: 131, 50, 65; --color-daredevil-progress-bar: 54, 98, 165; --color-navigator-progress-bar: 12, 57, 141; --color-champion-progress-bar: 255, 129, 80; --color-daily_refresh-progress-bar: 28, 160, 255; --color-course-complete-cta: 120, 219, 224; --color-course-complete-cta-border: 94, 201, 204; --color-bea-secondary: 24, 153, 214; --color-eddy-secondary: 234, 43, 43; --color-gilded-secondary: 231, 166, 1; --color-lily-secondary: 165, 104, 204; --color-vikram-secondary: 163, 42, 113; --color-zari-secondary: 204, 107, 166; --color-oscar-secondary: 0, 164, 125; --color-falstaff-secondary: 150, 90, 58; --color-bea-radio: 20, 123, 172; --color-duo-radio: 62, 143, 1; --color-eddy-radio: 179, 53, 53; --color-falstaff-radio: 131, 79, 51; --color-lin-lucy-radio: 179, 105, 0; --color-lily-radio: 144, 91, 179; --color-vikram-radio: 143, 36, 99; --color-zari-radio: 179, 94, 146; --color-oscar-radio: 0, 144, 109; --color-bea-junior-shine: 67, 190, 248; --color-duo-shine: 114, 214, 39; --color-eddy-shine: 255, 105, 105; --color-falstaff-shine: 227, 165, 108; --color-lily-shine: 214, 150, 255; --color-lin-lucy-shine: 255, 168, 44; --color-oscar-shine: 63, 217, 181; --color-vikram-shine: 214, 90, 162; --color-zari-shine: 255, 158, 217; --color-super-background-secondary: 26, 30, 76; --color-super-gradient-background: 12, 47, 113; --color-super-gradient-top-halo: 12, 76, 70; --color-super-gradient-bottom-halo: 76, 29, 115; --color-gold-shine: 255, 231, 0; --color-legendary-dark-background: 24, 24, 24; --color-roseate: 223, 75, 162; --color-rosefinch: 180, 28, 117; --color-bluebird: 3, 144, 211; --color-cotinga: 121, 58, 227; --color-sabrewing: 165, 112, 255; --color-blueberry: 17, 82, 167; --color-ether: 60, 89, 141; --color-diamond-tournament-purple: 161, 161, 238; --color-diamond-tournament-reaction: 118, 163, 231; --color-yir-page0: 221, 244, 255; --color-yir-page1: 227, 255, 235; --color-yir-page1-shadow: 19, 31, 36; --color-yir-page3-shadow: 187, 172, 252; --color-yir-page4-shadow: 143, 219, 255; --color-yir-page5-shadow: 255, 183, 80; --color-super-gradient-green-variant1: 38, 255, 85; --color-super-gradient-blue-variant1: 38, 139, 255; --color-super-gradient-pink-variant1: 252, 85, 255; --color-super-gradient-purple-variant1: 17, 34, 181; --color-unknown-001e2d: 0, 30, 45; --color-unknown-0047a4: 0, 71, 164; --color-unknown-0087d0: 0, 135, 208; --color-unknown-00aff9: 0, 175, 249; --color-unknown-013047: 1, 48, 71; --color-unknown-048fd1: 4, 143, 209; --color-unknown-0e0f10: 14, 15, 16; --color-unknown-0e3d79: 14, 61, 121; --color-unknown-172071: 23, 32, 113; --color-unknown-280378: 40, 3, 120; --color-unknown-3ebbf6: 62, 187, 246; --color-unknown-655ebb: 101, 94, 187; --color-unknown-696cee: 105, 108, 238; --color-unknown-7c0000: 124, 0, 0; --color-unknown-89e219: 137, 226, 25; --color-unknown-935051: 147, 80, 81; --color-unknown-959595: 149, 149, 149; --color-unknown-a2a2a2: 162, 162, 162; --color-unknown-a3dbeb: 163, 219, 235; --color-unknown-a4dffb: 164, 223, 251; --color-unknown-aaa: 170, 170, 170; --color-unknown-d087ff: 208, 135, 255; --color-unknown-d9d9d9: 217, 217, 217; --color-unknown-ddd: 221, 221, 221; --color-unknown-de8029: 222, 128, 41; --color-unknown-e3e3e3: 227, 227, 227; --color-unknown-e4ffff: 228, 255, 255; --color-unknown-ed8c01: 237, 140, 1; --color-unknown-f3484e: 243, 72, 78; --color-unknown-f4fafe: 244, 250, 254; --color-unknown-fbdec5: 251, 222, 197; --color-unknown-ffc700: 255, 199, 0; --color-unknown-fff2aa: 255, 242, 170; --color-unknown-fffbef: 255, 251, 239;"]
  254. : ["light", "off", "--app-offset: 0px; --color-snow: 255, 255, 255; --color-snow-always-light: 255, 255, 255; --color-snow-always-dark: 19, 31, 36; --color-polar: 247, 247, 247; --color-swan: 229, 229, 229; --color-swan-always-light: 229, 229, 229; --color-swan-always-dark: 55, 70, 79; --color-hare: 175, 175, 175; --color-hare-always-light: 175, 175, 175; --color-wolf: 119, 119, 119; --color-eel: 75, 75, 75; --color-squid: 235, 227, 227; --color-walking-fish: 255, 223, 224; --color-flamingo: 255, 178, 178; --color-pig: 245, 164, 164; --color-crab: 255, 120, 120; --color-cardinal: 255, 75, 75; --color-fire-ant: 234, 43, 43; --color-canary: 255, 245, 211; --color-duck: 251, 229, 109; --color-bee: 255, 200, 0; --color-bee-always-dark: 255, 199, 0; --color-lion: 255, 177, 0; --color-fox: 255, 150, 0; --color-cheetah: 255, 206, 142; --color-monkey: 229, 162, 89; --color-camel: 231, 166, 1; --color-guinea-pig: 205, 121, 0; --color-grizzly: 187, 113, 73; --color-sea-sponge: 215, 255, 184; --color-turtle: 165, 237, 110; --color-owl: 88, 204, 2; --color-tree-frog: 88, 167, 0; --color-peacock: 0, 205, 156; --color-iguana: 221, 244, 255; --color-anchovy: 210, 228, 232; --color-beluga: 187, 242, 255; --color-moon-jelly: 122, 240, 242; --color-blue-jay: 132, 216, 255; --color-macaw: 28, 176, 246; --color-whale: 24, 153, 214; --color-humpback: 43, 112, 201; --color-narwhal: 20, 83, 163; --color-manta-ray: 4, 44, 96; --color-starfish: 255, 134, 208; --color-beetle: 206, 130, 255; --color-betta: 144, 105, 205; --color-butterfly: 111, 78, 161; --color-dragon: 204, 52, 141; --color-starling: 92, 108, 252; --color-martin: 71, 85, 223; --color-grackle: 167, 160, 255; --color-honeycreeper: 193, 187, 255; --color-deep-starling: 34, 33, 81; --color-deep-martin: 16, 15, 62; --color-legendary-foreground: 140, 65, 3; --color-stardust: 199, 255, 254; --color-cosmos: 60, 77, 255; --color-nebula: 63, 34, 236; --color-nova: 207, 23, 200; --color-gamma: 38, 246, 99; --color-starlight: 38, 138, 255; --color-quasar: 252, 85, 255; --color-celestia: 255, 255, 255; --color-eclipse: 0, 4, 55; --color-black: 0, 0, 0; --color-aqua: 56, 238, 255; --color-aqua-always-light: 56, 238, 255; --color-ocean: 0, 124, 143; --color-seafoam: 158, 224, 233; --color-ice: 225, 253, 255; --color-max-shadow: 20, 208, 225; --color-black-white: 0, 0, 0; --color-diamond-stat: 86, 219, 226; --color-mask-green: 137, 226, 25; --color-pearl-stat: 255, 170, 222; --color-snow-dark-swan: 255, 255, 255; --color-black-text: 60, 60, 60; --color-blue-space: 11, 62, 113; --color-juicy-blue-space: 10, 74, 130; --color-juicy-blue-space-light: 35, 83, 144; --color-gold: 250, 169, 25; --color-gray-text: 153, 153, 153; --color-orange: 255, 157, 0; --color-diamond-highlight: 231, 251, 251; --color-diamond: 56, 208, 208; --color-banana: 255, 176, 32; --color-cloud: 207, 207, 207; --color-cloud-light: 221, 221, 221; --color-cloud-lightest: 240, 240, 240; --color-kiwi: 122, 199, 12; --color-kiwi-dark: 93, 151, 9; --color-kiwi-light: 142, 224, 0; --color-facebook: 59, 89, 152; --color-facebook-dark: 45, 67, 115; --color-google: 66, 133, 244; --color-twitter: 29, 161, 242; --color-hv-light-peach: 241, 218, 179; --color-hv-peach: 219, 186, 131; --color-hv-light-orange: 255, 177, 64; --color-hv-orange: 204, 121, 0; --color-hv-brown: 140, 90, 17; --color-streak-panel-extended-background: 255, 150, 0; --color-streak-panel-frozen-background: 221, 244, 255; --color-streak-panel-frozen-flair-background: 132, 216, 255; --color-streak-panel-frozen-subtitle: 28, 176, 246; --color-streak-panel-frozen-text: 132, 216, 255; --color-streak-panel-frozen-topbar-text: 24, 153, 214; --color-streak-panel-streak-society-background: 255, 200, 0; --color-streak-panel-streak-society-text: 205, 121, 0; --color-streak-panel-unextended-heading-text: 235, 195, 127; --color-streak-panel-unextended-heading-background: 255, 245, 211; --color-streak-panel-unextended-topbar-text: 235, 195, 127; --color-streak-panel-milestone-gradient-start: 255, 147, 58; --color-streak-panel-milestone-gradient-end: 255, 200, 0; --color-streak-society-dark-orange: 255, 151, 1; --color-streak-society-light-orange: 255, 179, 1; --color-friends-quest-own-incomplete: 175, 175, 175; --color-friends-quest-friend-incomplete: 145, 145, 145; --color-black-text-always-light: 60, 60, 60; --color-cardinal-always-light: 255, 75, 75; --color-cowbird: 174, 104, 2; --color-eel-always-light: 75, 75, 75; --color-fox-always-light: 255, 150, 0; --color-fire-ant-always-light: 234, 43, 43; --color-grizzly-lite: 220, 143, 71; --color-guinea-pig-always-light: 205, 121, 0; --color-iguana-always-light: 221, 244, 255; --color-macaw-always-light: 28, 176, 246; --color-owl-always-light: 88, 204, 2; --color-polar-always-light: 247, 247, 247; --color-sea-sponge-always-light: 215, 255, 184; --color-tree-frog-always-light: 88, 167, 0; --color-turtle-always-light: 165, 237, 110; --color-walking-fish-always-light: 255, 223, 224; --color-wolf-always-light: 119, 119, 119; --color-cardinal-always-dark: 238, 85, 85; --color-eel-always-dark: 241, 247, 251; --color-hare-always-dark: 82, 101, 109; --color-macaw-always-dark: 73, 192, 248; --color-owl-always-dark: 147, 211, 51; --color-polar-always-dark: 32, 47, 54; --color-wolf-always-dark: 220, 230, 236; --color-rookie: 0, 175, 133; --color-explorer: 255, 100, 191; --color-traveler: 255, 145, 83; --color-trailblazer: 154, 143, 232; --color-adventurer: 96, 12, 199; --color-discoverer: 111, 44, 57; --color-daredevil: 46, 83, 138; --color-navigator: 9, 47, 119; --color-champion: 255, 110, 53; --color-daily_refresh: 0, 148, 255; --color-dark-mode-locked-path-section-text-color: 82, 101, 109; --color-rookie-progress-bar: 0, 198, 150; --color-explorer-progress-bar: 255, 138, 207; --color-traveler-progress-bar: 255, 167, 106; --color-trailblazer-progress-bar: 169, 157, 254; --color-adventurer-progress-bar: 122, 13, 199; --color-discoverer-progress-bar: 131, 50, 65; --color-daredevil-progress-bar: 54, 98, 165; --color-navigator-progress-bar: 12, 57, 141; --color-champion-progress-bar: 255, 129, 80; --color-daily_refresh-progress-bar: 28, 160, 255; --color-course-complete-cta: 120, 219, 224; --color-course-complete-cta-border: 94, 201, 204; --color-bea-secondary: 24, 153, 214; --color-eddy-secondary: 234, 43, 43; --color-gilded-secondary: 231, 166, 1; --color-lily-secondary: 165, 104, 204; --color-vikram-secondary: 163, 42, 113; --color-zari-secondary: 204, 107, 166; --color-oscar-secondary: 0, 164, 125; --color-falstaff-secondary: 150, 90, 58; --color-bea-radio: 20, 123, 172; --color-duo-radio: 62, 143, 1; --color-eddy-radio: 179, 53, 53; --color-falstaff-radio: 131, 79, 51; --color-lin-lucy-radio: 179, 105, 0; --color-lily-radio: 144, 91, 179; --color-vikram-radio: 143, 36, 99; --color-zari-radio: 179, 94, 146; --color-oscar-radio: 0, 144, 109; --color-bea-junior-shine: 67, 190, 248; --color-duo-shine: 114, 214, 39; --color-eddy-shine: 255, 105, 105; --color-falstaff-shine: 227, 165, 108; --color-lily-shine: 214, 150, 255; --color-lin-lucy-shine: 255, 168, 44; --color-oscar-shine: 63, 217, 181; --color-vikram-shine: 214, 90, 162; --color-zari-shine: 255, 158, 217; --color-super-background-secondary: 26, 30, 76; --color-super-gradient-background: 12, 47, 113; --color-super-gradient-top-halo: 12, 76, 70; --color-super-gradient-bottom-halo: 76, 29, 115; --color-gold-shine: 255, 231, 0; --color-legendary-dark-background: 24, 24, 24; --color-roseate: 223, 75, 162; --color-rosefinch: 180, 28, 117; --color-bluebird: 3, 144, 211; --color-cotinga: 121, 58, 227; --color-sabrewing: 165, 112, 255; --color-blueberry: 17, 82, 167; --color-ether: 60, 89, 141; --color-diamond-tournament-purple: 161, 161, 238; --color-diamond-tournament-reaction: 118, 163, 231; --color-yir-page0: 221, 244, 255; --color-yir-page1: 227, 255, 235; --color-yir-page1-shadow: 19, 31, 36; --color-yir-page3-shadow: 187, 172, 252; --color-yir-page4-shadow: 143, 219, 255; --color-yir-page5-shadow: 255, 183, 80; --color-super-gradient-green-variant1: 38, 255, 85; --color-super-gradient-blue-variant1: 38, 139, 255; --color-super-gradient-pink-variant1: 252, 85, 255; --color-super-gradient-purple-variant1: 17, 34, 181; --color-unknown-001e2d: 0, 30, 45; --color-unknown-0047a4: 0, 71, 164; --color-unknown-0087d0: 0, 135, 208; --color-unknown-00aff9: 0, 175, 249; --color-unknown-013047: 1, 48, 71; --color-unknown-048fd1: 4, 143, 209; --color-unknown-0e0f10: 14, 15, 16; --color-unknown-0e3d79: 14, 61, 121; --color-unknown-172071: 23, 32, 113; --color-unknown-280378: 40, 3, 120; --color-unknown-3ebbf6: 62, 187, 246; --color-unknown-655ebb: 101, 94, 187; --color-unknown-696cee: 105, 108, 238; --color-unknown-7c0000: 124, 0, 0; --color-unknown-89e219: 137, 226, 25; --color-unknown-935051: 147, 80, 81; --color-unknown-959595: 149, 149, 149; --color-unknown-a2a2a2: 162, 162, 162; --color-unknown-a3dbeb: 163, 219, 235; --color-unknown-a4dffb: 164, 223, 251; --color-unknown-aaa: 170, 170, 170; --color-unknown-d087ff: 208, 135, 255; --color-unknown-d9d9d9: 217, 217, 217; --color-unknown-ddd: 221, 221, 221; --color-unknown-de8029: 222, 128, 41; --color-unknown-e3e3e3: 227, 227, 227; --color-unknown-e4ffff: 228, 255, 255; --color-unknown-ed8c01: 237, 140, 1; --color-unknown-f3484e: 243, 72, 78; --color-unknown-f4fafe: 244, 250, 254; --color-unknown-fbdec5: 251, 222, 197; --color-unknown-ffc700: 255, 199, 0; --color-unknown-fff2aa: 255, 242, 170; --color-unknown-fffbef: 255, 251, 239;"];
  255.  
  256. document.documentElement.setAttribute("data-duo-theme", theme);
  257. document.documentElement.setAttribute("style", css);
  258.  
  259. const darkModeDataLocal = getLocal("duo.darkMode")
  260. for(const key in darkModeDataLocal){
  261. darkModeDataLocal[key] = value
  262. }
  263.  
  264. localStorage.setItem("duo.darkMode", JSON.stringify(darkModeDataLocal));
  265. setSwitch(this.isDarkMode);
  266. });
  267.  
  268. this.farmingLocationWrapper = document.createElement("div");
  269. this.farmingLocationWrapper.style = `--data-name: "Set XP Farm Location"`;
  270. const farmingLocationInfo =
  271. "SET XP FARM LOCATION\n" +
  272. "- By default, the system can only Farm XP in practice exercises or listening practices. However, with this feature, you can Farm XP " +
  273. "in any lesson you want, even in story lessons!\n" +
  274. "- Usage: Activate the feature and enter the URL of the lesson you want, then enable the XP Farm mode to start farming.\n" +
  275. "- NOTE: The URL to the lesson must be accurate and the lesson must be repeatable. Entering an inaccurate URL may lead " +
  276. "to errors or even pose risks to your account!";
  277. this.autoduoCreateSwitch(farmingLocationInfo, this.farmingLocationWrapper, 8, false);
  278.  
  279. this.autoX2Wrapper = document.createElement("div");
  280. this.autoX2Wrapper.style = `--data-name: "Auto Collect x2 XP"`;
  281. const autoX2Info =
  282. "AUTO COLLECT X2 XP:\n" +
  283. '- This is a supplementary feature for "Auto Farm KN", helping to maintain the x2 KN status during farming. When enabled, ' +
  284. "it will check and automatically do new lessons to get x2 KN rewards if it detects the current state doesn't have x2. " +
  285. "This will help you farm more KN points than usual. \n\n- NOTE: This feature will do new lessons to maintain the x2 status, so " +
  286. "consider before enabling it if you have constraints with these lessons.";
  287. this.autoduoCreateSwitch(autoX2Info, this.autoX2Wrapper, 8, false);
  288.  
  289. this.functionWrapper = document.createElement("div");
  290. this.functionWrapper.className = "function-wrapper-listening";
  291. this.functionWrapper.append(
  292. this.darkModeWrapper,
  293. this.animationOffWrapper,
  294. this.safeModeWrapper,
  295. this.turboModeWrapper
  296. );
  297. },
  298.  
  299. initSetting: function () {
  300. this.settingBtn = document.createElement("button");
  301. Object.assign(this.settingBtn, {
  302. className: "autoduo-btn setting-btn-listening",
  303. innerText: "Other settings",
  304. });
  305. this.settingBtn.addEventListener("click", () => {
  306. this.controlContainer.contains(this.settingOverlay) ||
  307. this.controlContainer.appendChild(this.settingOverlay);
  308. });
  309.  
  310. this.closeSettingBtn = document.createElement("button");
  311. Object.assign(this.closeSettingBtn, {
  312. className: "autoduo-btn close-setting-btn-listening",
  313. innerText: "Close",
  314. });
  315. this.closeSettingBtn.addEventListener("click", () => {
  316. this.controlContainer.contains(this.settingOverlay) &&
  317. this.controlContainer.removeChild(this.settingOverlay);
  318. });
  319.  
  320. this.settingOverlay = document.createElement("div");
  321. Object.assign(this.settingOverlay, {
  322. className: "setting-overlay-listening",
  323. innerHTML: `
  324. <h3>Other settings</h3>
  325. `,
  326. });
  327.  
  328. this.settingFunction = document.createElement("div");
  329. this.settingFunction.className = "setting-function-listening";
  330. this.settingFunction.append(
  331. this.legendModeWrapper,
  332. this.passModeWrapper,
  333. this.targetModeWrapper,
  334. this.farmingLocationWrapper,
  335. this.autoX2Wrapper
  336. );
  337.  
  338. this.settingOverlay.append(this.settingFunction, this.closeSettingBtn);
  339. },
  340.  
  341. initContainer: function () {
  342. this.autoduoPowered = document.createElement('div')
  343. Object.assign(this.autoduoPowered, {
  344. className: 'autoduo-powered',
  345. innerHTML: `Powered by <a href="https://autoduo.click" target="_blank">🔥autoduo.click</a>`
  346. })
  347.  
  348. this.autoContainer = document.createElement("div");
  349. this.autoContainer.className = "auto-container-listening";
  350. this.autoContainer.append(
  351. this.statistic,
  352. this.functionWrapper,
  353. this.settingBtn,
  354. this.autoBtn,
  355. this.updateBtn
  356. );
  357.  
  358. this.overlayContainer = document.createElement("div");
  359. this.overlayContainer.className = "overlay-listening";
  360.  
  361. this.controlContainer = document.createElement("div");
  362. this.controlContainer.className = "control-container-listening";
  363. this.controlContainer.append(this.autoContainer, this.contactWrapper, this.autoduoPowered);
  364.  
  365. this.bubbleContainer = document.createElement("div");
  366. this.bubbleContainer.className = "bubble-container-listening";
  367. this.bubbleContainer.append(this.marketerBubble, this.superBubble, this.notifyBubble);
  368.  
  369. document.body.append(this.controlContainer, this.bubbleContainer);
  370. },
  371.  
  372. fetchNoti: async function () {
  373. try {
  374. const res = await (
  375. await fetch("https://api.autoduo.click/super/data/notify/?c7f54a73e6340a16176=91bf0d18b83")
  376. )?.json();
  377. if (res?.code === 200) {
  378. const { notifyVersion: rmVersion, notifyContent: rmContent } = res.data[0];
  379. setDataSession({
  380. isNewNotify: (this.isNewNotify = +rmVersion > this.notifyVersion),
  381. rmNotiVer: (this.rmNotiVer = +rmVersion),
  382. rmNotiContent: (this.rmNotiContent = rmContent.replaceAll("\\n", "\n")),
  383. });
  384. this.setNoti();
  385. }
  386. } catch (e) {}
  387. },
  388.  
  389. setNoti: function () {
  390. if (!this.rmNotiVer) {
  391. return;
  392. }
  393. if (this.isNewNotify) {
  394. this.notifyBubble.classList.add("new");
  395. }
  396. this.notifyBubble.addEventListener("click", () => {
  397. if (this.isNewNotify) {
  398. this.notifyBubble.classList.remove("new");
  399. setDataSession("isNewNotify", (this.isNewNotify = false));
  400. setDataLocal("notifyVersion", this.rmNotiVer);
  401. }
  402. window.alert(this.rmNotiContent);
  403. });
  404. },
  405.  
  406. handleShowHideUI: function (isSave = false) {
  407. if (this.isShowUI) {
  408. this.showHideBtn.classList.remove("hide");
  409. document.body.append(this.controlContainer, this.signatureElm, this.bubbleContainer);
  410. } else {
  411. this.showHideBtn.classList.add("hide");
  412. this.controlContainer.remove();
  413. this.signatureElm.remove();
  414. this.bubbleContainer.remove();
  415. }
  416.  
  417. if (isSave) {
  418. setDataSession("isShowUI", this.isShowUI);
  419. this.controlContainer.classList.contains("autoduo-animate") ||
  420. this.controlContainer.classList.add("autoduo-animate");
  421. }
  422. },
  423.  
  424. handleAnimationOff: function (isSave = false) {
  425. this.isAnimationOff
  426. ? document.head.appendChild(this.animationStyle)
  427. : document.head.removeChild(this.animationStyle);
  428. isSave && setDataSession("isAnimationOff", this.isAnimationOff);
  429. },
  430.  
  431. handleSafeModeOn: function () {
  432. this.safeModeWrapper.setAutoduoSwitch(this.setSafeMode(true));
  433. },
  434.  
  435. handleSafeModeOff: function () {
  436. this.safeModeWrapper.setAutoduoSwitch(this.setSafeMode(false));
  437. },
  438.  
  439. start: function () {
  440. if (this.isAuto || this.isAutoRunning) {
  441. return;
  442. }
  443.  
  444. document.body.appendChild(this.overlayContainer);
  445. this.isAuto = true;
  446. this.autoBtn.classList.add("running");
  447. this.autoBtn.innerText = "STOP FARM XP";
  448. setDataSession("isBasicAuto", this.isAuto);
  449. this.startTm = Date.now();
  450. this.handleLocation();
  451. },
  452.  
  453. stop: function () {
  454. if (!this.isAuto || this.isLegendMode) {
  455. return;
  456. }
  457. document.body.removeChild(this.overlayContainer);
  458. this.isAuto = false;
  459. this.autoBtn.classList.remove("running");
  460. this.autoBtn.innerText = "START FARM XP";
  461. setDataSession("isBasicAuto", this.isAuto);
  462. },
  463.  
  464. handleLocation: function () {
  465. if (!this.isAuto) {
  466. return;
  467. }
  468.  
  469. const currentPath = window.location.pathname;
  470.  
  471. switch (currentPath) {
  472. case this.practiceHubPath:
  473. this.goPracticeHubChallenge();
  474. break;
  475.  
  476. case this.listeningPacticePath:
  477. this.handlePracticeHubChallenge();
  478. break;
  479.  
  480. default:
  481. this.autoduoError(
  482. "[Inappropriate location]: Only enable auto when on the practice page (with the dumbbell icon) of Duolingo Super!" +
  483. "\n- Enabling auto on Duolingo Super's practice page will automatically farm listening exercises (20 XP)." +
  484. "\n- Upgrade to the full version of Auto-Duolingo to use auto farming and many other useful features without needing Super Duolingo!"
  485. , true);
  486. break;
  487. }
  488. },
  489.  
  490. goPracticeHubChallenge: function () {
  491. if (this.isAuto === false) {
  492. return;
  493. }
  494. const challengeBtn = $(
  495. 'img[src="https://d35aaqx5ub95lt.cloudfront.net/images/practiceHub/2ebe830fd55a7f2754d371bcd79faf32.svg"]'
  496. );
  497.  
  498. if (!challengeBtn) {
  499. setTimeout(this.goPracticeHubChallenge.bind(this), 1000);
  500. return;
  501. }
  502.  
  503. challengeBtn.click();
  504. setTimeout(this.handlePracticeHubChallenge.bind(this), 1000);
  505. },
  506.  
  507. handlePracticeHubChallenge: function () {
  508. if (window.location.pathname === this.practiceHubPath) {
  509. this.goPracticeHubChallenge();
  510. return;
  511. }
  512.  
  513. // Flag:BETA
  514. const challengeWrapper = $(".wqSzE");
  515. if (challengeWrapper) {
  516. this.getDataStateNode(challengeWrapper);
  517. this.next();
  518. return;
  519. }
  520. const nextActiveBtn = $('[data-test="player-next"][aria-disabled="false"]');
  521.  
  522. if (nextActiveBtn) {
  523. this.next();
  524. return;
  525. }
  526.  
  527. setTimeout(this.handlePracticeHubChallenge.bind(this), 1000);
  528. },
  529.  
  530. handleChallenge: async function () {
  531. if (this.isSafeMode) {
  532. await this.sleep(1000);
  533. }
  534. if (!this.isAuto || this.isAutoRunning) {
  535. return;
  536. }
  537.  
  538. const challengeTypeElm = $('[data-test*="challenge challenge"]');
  539.  
  540. if (!challengeTypeElm) {
  541. return this.autoduoError("Undefined challenge!!");
  542. }
  543.  
  544. const challengeType = challengeTypeElm.dataset.test?.split(' ')[1]
  545.  
  546. this.setAutoRunning(true);
  547. switch (challengeType) {
  548. case "challenge-listenTap":
  549. this.handleChallengeTranslate();
  550. break;
  551.  
  552. case "challenge-gapFill":
  553. case "challenge-listenIsolation":
  554. case "challenge-assist":
  555. case "challenge-selectTranscription":
  556. case "challenge-characterIntro":
  557. case "challenge-characterSelect":
  558. case "challenge-selectPronunciation":
  559. case "challenge-dialogue":
  560. case "challenge-readComprehension":
  561. case "challenge-listenComprehension":
  562. case "challenge-select":
  563. case "challenge-form":
  564. case "challenge-definition":
  565. case "challenge-sameDifferent":
  566. this.handleChallengeChoice();
  567. break;
  568.  
  569. default:
  570. this.autoduoError(
  571. "This exercise is not currently supported in this version. Try updating to the full version of Auto-Duolingo and try again!"
  572. );
  573. break;
  574. }
  575. },
  576.  
  577. handleChallengeTranslate: function () {
  578. if (this.isAuto === false) {
  579. return;
  580. }
  581.  
  582. let data = this.getData("correctTokens");
  583.  
  584. if (this.isAuto === false) {
  585. return;
  586. }
  587.  
  588. if (!data?.length) {
  589. data = this.getData(["challengeResponseTrackingProperties", "best_solution"])?.split(" ");
  590. }
  591.  
  592. if (!data) {
  593. return this.autoduoError("Lesson data not found.");
  594. }
  595.  
  596. const textArea = $('textarea[data-test="challenge-translate-input"]:not([disabled])');
  597. if (textArea) {
  598. const toggleKeyboard = $('[data-test="player-toggle-keyboard"]');
  599. if (toggleKeyboard) {
  600. toggleKeyboard.click();
  601. return setTimeout(this.handleChallengeTranslate.bind(this), 500);
  602. }
  603.  
  604. const inputEvent = new Event("input", {
  605. bubbles: true,
  606. });
  607.  
  608. let answer = "";
  609.  
  610. const inputCaseHandler = () => {
  611. setTimeout(() => {
  612. if (data.length === 0) {
  613. this.setAutoRunning(false);
  614. this.next(true);
  615. return;
  616. }
  617.  
  618. answer += " " + data.shift();
  619. this.nativeTextareaValueSetter.call(textArea, answer);
  620. textArea.dispatchEvent(inputEvent);
  621. inputCaseHandler();
  622. }, this.rmSafeDlTm());
  623. };
  624. inputCaseHandler();
  625. return;
  626. }
  627.  
  628. // Flag:BETA
  629. let options = arr($$('button[data-test*="challenge-tap-token"]'));
  630. if (options.length === 0) {
  631. return setTimeout(this.handleChallengeTranslate.bind(this), 500);
  632. }
  633.  
  634. const getIndexOfOption = (targetData) => {
  635. const index = options.findIndex((option) => option.textContent === targetData);
  636. return index;
  637. };
  638.  
  639. const selectCaseHandler = () => {
  640. setTimeout(() => {
  641. if (data.length === 0) {
  642. this.setAutoRunning(false);
  643. this.next(true);
  644. return;
  645. }
  646.  
  647. const firstValue = data.shift();
  648. const index = getIndexOfOption(firstValue);
  649.  
  650. if (index === -1) {
  651. return this.autoduoLessonError("No suitable option found.");
  652. }
  653.  
  654. options[index].click();
  655. options.splice(index, 1);
  656. selectCaseHandler();
  657. }, this.rmSafeDlTm());
  658. };
  659. selectCaseHandler();
  660. },
  661.  
  662. handleChallengeChoice: function () {
  663. if (!this.isAuto) {
  664. return;
  665. }
  666.  
  667. const optionElm = $$('[data-test="challenge-choice"]');
  668. const correctIndex = this.getData("correctIndex");
  669.  
  670. if (correctIndex === null) {
  671. return this.autoduoError("Lesson data not found.");
  672. }
  673.  
  674. setTimeout(() => {
  675. optionElm[correctIndex].click();
  676. setTimeout(() => {
  677. this.setAutoRunning(false);
  678. this.next();
  679. }, this.rmSafeDlTm());
  680. }, this.rmSafeDlTm());
  681. },
  682.  
  683. next: function () {
  684. if (!this.isAuto) {
  685. return;
  686. }
  687.  
  688. // Flag:BETA
  689. const expWrapper = $('[class="_1XNQX"]');
  690. if (expWrapper) {
  691. const exp = this.getExp(expWrapper);
  692.  
  693. if (exp !== undefined) {
  694. this.exp += exp;
  695. this.expElm.innerText = this.exp;
  696.  
  697. const timeNow = Date.now();
  698. const finishTime = timeNow - this.startTm;
  699. this.totalTime += finishTime;
  700. this.startTm = timeNow;
  701. this.renderTime();
  702.  
  703. setDataSession({
  704. exp: this.exp,
  705. time: this.totalTime,
  706. });
  707.  
  708. const currentPath = window.location.pathname;
  709. if (currentPath === this.listeningPacticePath) {
  710. if ((this.totalReloadTime += finishTime) >= this.reloadTm) {
  711. window.location.reload();
  712. return;
  713. }
  714. }
  715. }
  716. }
  717.  
  718. const nextBtn = $('[data-test="player-next"]');
  719.  
  720. if (!nextBtn) {
  721. setTimeout(this.handleLocation.bind(this), this.goChallengeTm);
  722. return;
  723. }
  724.  
  725. const isDisabled = nextBtn.getAttribute("aria-disabled") === "true";
  726. const isFullProgress = !!$('[aria-valuenow="1"]');
  727.  
  728. if (isDisabled && !isFullProgress) {
  729. boom(this.handleChallenge.bind(this));
  730. return;
  731. }
  732.  
  733. !isDisabled && nextBtn.click();
  734. boom(this.next.bind(this));
  735. },
  736.  
  737. findReactProps: function (wrapperElm) {
  738. this.reactProps = Object.keys(wrapperElm).find((key) => key.startsWith("__reactProps"));
  739.  
  740. if (!this.reactProps) {
  741. return this.autoduoError("ERROR");
  742. }
  743. },
  744.  
  745. getDataStateNode: function (wrapperElm) {
  746. this.reactProps === null && this.findReactProps(wrapperElm);
  747. const childrenData = wrapperElm?.[this.reactProps]?.children;
  748.  
  749. if (Array.isArray(childrenData)) {
  750. this.dataStateNode = childrenData?.[0]?._owner?.stateNode;
  751. } else {
  752. this.dataStateNode = childrenData?._owner?.stateNode;
  753. }
  754. },
  755.  
  756. getData: function (subGenealogy) {
  757. const currentChallenge = this.dataStateNode?.props?.currentChallenge;
  758. if (!currentChallenge) {
  759. return this.autoduoError("There was an error while loading challenge data!");
  760. }
  761.  
  762. if (Array.isArray(subGenealogy)) {
  763. const result = subGenealogy.reduce((acc, currentKey) => {
  764. if (acc === null) {
  765. return null;
  766. }
  767.  
  768. const currentValue = acc[currentKey];
  769. return currentValue || null;
  770. }, currentChallenge);
  771.  
  772. if (result === null) {
  773. return this.autoduoError("There was an error while getting the data!");
  774. }
  775.  
  776. return Array.isArray(result) ? [...result] : result;
  777. } else {
  778. const result = currentChallenge[subGenealogy];
  779. return Array.isArray(result) ? [...result] : result;
  780. }
  781. },
  782.  
  783. getExp: function (expWrapper) {
  784. const keys = Object.keys(expWrapper);
  785. const key = keys.find((key) => key.startsWith("__reactProps"));
  786.  
  787. const exp = expWrapper?.[key]?.children?.props?.slide?.xpGoalSessionProgress?.totalXpThisSession;
  788. return exp;
  789. },
  790.  
  791. renderTime: function () {
  792. const timeString = timeFormat(this.totalTime);
  793. this.dateElm.innerText = timeString;
  794. },
  795.  
  796. setAutoRunning: function (isRunning) {
  797. this.isAutoRunning = isRunning;
  798. },
  799.  
  800. setSafeMode: function (isSafeMode) {
  801. this.isSafeMode = isSafeMode;
  802. setDataSession("isSafeMode", isSafeMode);
  803. return isSafeMode;
  804. },
  805.  
  806. rmSafeDlTm: function () {
  807. if (!this.isSafeMode) {
  808. return 0;
  809. }
  810. return Math.floor(Math.random() * 700 + 300);
  811. },
  812.  
  813. sleep: async function (time) {
  814. await new Promise((resolve) => setTimeout(resolve, time));
  815. },
  816.  
  817. autoduoError: function (message = '', native = false) {
  818. this.isAutoRunning && this.setAutoRunning(false);
  819. this.isAuto && this.stop();
  820. const tips =
  821. "\n- If this message persists, try updating to the full version of Auto-Duolingo. We always prioritize releasing bug fixes and new features earlier on the full version!";
  822. native ? alert(message + tips) : alert("ERROR: " + message + tips);
  823. },
  824.  
  825. autoduoLessonError: function (errorText) {
  826. // Flag:BETA
  827. const settingIcon = $("._2VEsk");
  828. if (settingIcon) {
  829. settingIcon.click();
  830.  
  831. return setTimeout(() => {
  832. this.autoduoError(
  833. `${errorText}. If you are currently displaying the pronunciation guide, please turn it off first, then reload the page, and finally turn on auto again!`
  834. );
  835. }, 800);
  836. }
  837. return this.autoduoError(errorText);
  838. },
  839.  
  840. autoduoCreateSwitch: function (descriptionText = "", wrapperElm, id, isChecked, handleSwitch) {
  841. const infoElm = document.createElement("i");
  842. Object.assign(infoElm, {
  843. className: "switch-info-listening",
  844. title: "Detail",
  845. onclick: () => {
  846. alert(descriptionText);
  847. },
  848. });
  849.  
  850. const checkboxElm = document.createElement("input");
  851. Object.assign(checkboxElm, {
  852. type: "checkbox",
  853. hidden: true,
  854. checked: isChecked,
  855. });
  856.  
  857. const setSwitch = (isEnable) => {
  858. checkboxElm.checked = isEnable;
  859. };
  860.  
  861. const labelElm = document.createElement("label");
  862. labelElm.addEventListener("click", () => {
  863. id > 3 ? notAvailable() : handleSwitch(setSwitch);
  864. });
  865.  
  866. const switchContainer = document.createElement("div");
  867. switchContainer.className = "switch-container-listening";
  868. switchContainer.append(infoElm, checkboxElm, labelElm);
  869.  
  870. wrapperElm.classList.add("switch-wrapper-listening");
  871. if (id > 3) {
  872. wrapperElm.classList.add("unavailable");
  873. }
  874. wrapperElm.append(switchContainer);
  875. wrapperElm.setAutoduoSwitch = setSwitch;
  876. },
  877.  
  878. autoduoCheckUpdate: async function () {
  879. let rmVersion =
  880. version || (await (await fetch("https://api.autoduo.click/lite/version/"))?.json())?.version;
  881.  
  882. if (this.version !== rmVersion) {
  883. $("#greasyfork").classList.add("has-update");
  884. $("#greasyfork .popup").innerText = "A new updated version is available!";
  885. }
  886.  
  887. if (!version) {
  888. setDataSession("version", rmVersion);
  889. }
  890. },
  891.  
  892. initStyle: function () {
  893. this.animationStyle = document.createElement("style");
  894. this.animationStyle.innerHTML = `
  895. img, svg, canvas {
  896. visibility: hidden !important;
  897. }
  898. div:not(.autoduo-animate):not(.setting-overlay-listening) {
  899. transition: none !important;
  900. animation-duration: 0s !important;
  901. }
  902. .fSJFz {
  903. display: none !important;
  904. }
  905. `;
  906.  
  907. const listenStyle = document.createElement("style");
  908. listenStyle.innerHTML = `
  909. @import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');
  910. :root{
  911. --autoduo-bg: 255,255,255;
  912. --autoduo-color: 75,75,75;
  913. --autoduo-h-color: 0,159,235;
  914. }
  915. :root[data-duo-theme="dark"]{
  916. --autoduo-bg: 19,31,36;
  917. --autoduo-color: 241,247,251;
  918. --autoduo-h-color: 241,247,251;
  919. }
  920. .control-container-listening{
  921. position: fixed;
  922. z-index: 9999999;
  923. left: 20px;
  924. bottom: 75px;
  925. padding: 12px 10px;
  926. border: 2px dotted #00b3c1;
  927. border-radius: 20px;
  928. box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
  929. background-color: rgba(var(--autoduo-bg), 0.4);
  930. backdrop-filter: blur(4px);
  931. }
  932. .autoduo-animate{
  933. animation: autoduo-control-eff .15s;
  934. }
  935. .autoduo-animate::after{
  936. animation: autoduo-control-border-eff .35s .12s backwards;
  937. }
  938. @keyframes autoduo-control-eff {
  939. from {
  940. transform: scale(.8);
  941. opacity: .5;
  942. }
  943. to {
  944. transform: scale(1);
  945. opacity: 1;
  946. }
  947. }
  948. @keyframes autoduo-control-border-eff {
  949. from {
  950. transform: scale(1);
  951. opacity: 1;
  952. }
  953. to {
  954. transform: scale(1.15);
  955. opacity: 0;
  956. }
  957. }
  958. .control-container-listening::after{
  959. content: '';
  960. position: absolute;
  961. z-index: -1;
  962. inset: 0;
  963. border-radius: inherit;
  964. background-color: transparent;
  965. box-shadow: rgb(104 149 199 / 50%) 0px 0px 0px 5px;
  966. opacity: 0;
  967. }
  968. .autoduo-powered {
  969. position: absolute;
  970. top: calc(100% + 8px);
  971. left: 4px;
  972. font-size: 12px;
  973. }
  974. .autoduo-powered a {
  975. display: inline-block;
  976. color: #1cb0f6;
  977. font-weight: 700;
  978. transition: all 0.25s;
  979. }
  980. .autoduo-powered a:hover {
  981. color: #d555ff;
  982. text-decoration: underline;
  983. transform: scale(1.1);
  984. }
  985. .auto-container-listening{
  986. width: 250px !important;
  987. }
  988. .setting-overlay-listening {
  989. position: absolute;
  990. inset: 0;
  991. display: flex;
  992. flex-direction: column;
  993. padding: inherit;
  994. padding-bottom: 20px;
  995. border-radius: inherit;
  996. backdrop-filter: inherit;
  997. background-color: rgba(var(--autoduo-bg), 0.8);
  998. animation: setting-overlay-eff 0.4s;
  999. }
  1000. @keyframes setting-overlay-eff {
  1001. from {
  1002. opacity: 0;
  1003. transform: perspective(450px) rotateY(-90deg);
  1004. }
  1005. to {
  1006. opacity: 1;
  1007. transform: perspective(450px) rotateY(0deg);
  1008. }
  1009. }
  1010. .setting-overlay-listening h3 {
  1011. padding: 8px 0 12px 0;
  1012. text-align: center;
  1013. text-transform: uppercase;
  1014. }
  1015. .setting-function-listening{
  1016. flex-grow: 1;
  1017. }
  1018. .setting-function-listening .switch-wrapper-listening {
  1019. margin-bottom: 11px;
  1020. font-weight: bold;
  1021. color: #ff4e00;
  1022. }
  1023. .close-setting-btn-listening {
  1024. width: 80%;
  1025. margin: 0 auto;
  1026. }
  1027. .autoduo-btn {
  1028. display: flex;
  1029. justify-content: center;
  1030. align-items: center;
  1031. position: relative;
  1032. height: 46px;
  1033. margin-bottom: 4px;
  1034. background-color: transparent;
  1035. color: rgb(var(--autoduo-bg));
  1036. border: none;
  1037. border-radius: 16px;
  1038. text-transform: uppercase;
  1039. letter-spacing: 1px;
  1040. font-weight: bold;
  1041. font-size: 15px;
  1042. cursor: pointer;
  1043. user-select: none;
  1044. }
  1045. .autoduo-btn::before {
  1046. content: '';
  1047. position: absolute;
  1048. inset: 0;
  1049. z-index: -1;
  1050. background-color: #1cb0f6;
  1051. color: rgb(25, 132, 183);
  1052. border-radius: inherit;
  1053. box-shadow: 0 4px 0;
  1054. }
  1055. .autoduo-btn:hover {
  1056. filter: brightness(1.1);
  1057. }
  1058. .autoduo-btn:active {
  1059. transform: translateY(4px);
  1060. }
  1061. .autoduo-btn:active::before {
  1062. box-shadow: none;
  1063. }
  1064. .btn-green::before {
  1065. background-color: #58CC02;
  1066. color: rgb(81, 151, 4);
  1067. }
  1068. button.setting-btn-listening {
  1069. width: 100% !important;
  1070. margin-top: 10px;
  1071. }
  1072. button.setting-btn-listening::before {
  1073. background-image: url(https://autoduo.click/assets/client/setting.svg);
  1074. background-repeat: no-repeat;
  1075. background-size: 22px;
  1076. background-position: 18px;
  1077. }
  1078. button.auto-farm-btn-listening{
  1079. width: 100% !important;
  1080. margin-top: 8px;
  1081. }
  1082. button.auto-farm-btn-listening::before {
  1083. background-image: url(https://autoduo.click/assets/client/xp.svg);
  1084. background-repeat: no-repeat;
  1085. background-size: 32px;
  1086. background-position: 12px;
  1087. }
  1088. button.auto-farm-btn-listening.running::before {
  1089. background-color: #FF4B4B;
  1090. color: rgb(234,43,43);
  1091. }
  1092. .statistic-listening {
  1093. color: rgb(var(--autoduo-color));
  1094. font-size: 18px;
  1095. font-weight: bold;
  1096. }
  1097. .statistic-listening p{
  1098. margin-bottom: 8px;
  1099. }
  1100. .statistic-listening > p::before{
  1101. display: inline-block;
  1102. min-width: 60px;
  1103. }
  1104. .statistic-wrapper-listening{
  1105. display: flex;
  1106. justify-content: space-between;
  1107. margin: 16px 0;
  1108. }
  1109. .time-listening, .total-exp-listening{
  1110. display: flex;
  1111. align-items: center;
  1112. margin-bottom: 0 !important;
  1113. }
  1114. .time-listening::before,
  1115. .total-exp-listening::before{
  1116. content: '';
  1117. width: 21px;
  1118. height: 21px;
  1119. margin-right: 4px;
  1120. background-image: url('https://autoduo.click/assets/client/clock.svg');
  1121. background-size: cover;
  1122. }
  1123. .total-exp-listening::before{
  1124. width: 16px;
  1125. height: 21px;
  1126. background-image: url('https://autoduo.click/assets/client/exp.svg');
  1127. }
  1128. .total-exp-listening::after{
  1129. content: 'XP';
  1130. margin-left: 4px;
  1131. }
  1132. .guide-btn-listening{
  1133. width: 100%;
  1134. margin-top: 8px;
  1135. }
  1136. .guide-btn-listening::before{
  1137. background-image: url('https://autoduo.click/assets/client/twinkle.ndx');
  1138. background-size: 85px auto;
  1139. }
  1140. .notify-bubble-listening::before {
  1141. background-image: url('https://autoduo.click/assets/client/notify-icon-lite.png');
  1142. }
  1143. .super-bubble-listening::before {
  1144. background-image: url('https://autoduo.click/assets/client/superfree-icon.png');
  1145. }
  1146. .streak-bubble-listening::before {
  1147. background-image: url('https://autoduo.click/assets/imgs/streak.svg'), url('https://autoduo.click/assets/client/marketer.webp');
  1148. background-size: 22px, 250% !important;
  1149. background-position: center;
  1150. background-repeat: no-repeat;
  1151. }
  1152. .bubble-container-listening {
  1153. position: fixed;
  1154. z-index: 99999;
  1155. right: 8px;
  1156. bottom: 69px;
  1157. display: flex;
  1158. flex-direction: column;
  1159. }
  1160. .bubble-item-listening + .bubble-item-listening {
  1161. margin-top: 16px;
  1162. }
  1163. .bubble-item-listening {
  1164. position: relative;
  1165. width: 48px;
  1166. height: 48px;
  1167. border-radius: 50%;
  1168. border: 1px solid #ccc;
  1169. background-color: #ffffff40;
  1170. backdrop-filter: blur(4px);
  1171. box-shadow: rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em, rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em, rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
  1172. cursor: pointer;
  1173. }
  1174. .bubble-item-listening:hover {
  1175. filter: brightness(0.9);
  1176. }
  1177. .bubble-item-listening::before,
  1178. .bubble-item-listening::after {
  1179. content: '';
  1180. position: absolute;
  1181. inset: 0;
  1182. border-radius: inherit;
  1183. pointer-events: none;
  1184. }
  1185. .bubble-item-listening::before {
  1186. background-size: cover;
  1187. }
  1188. .bubble-item-listening::after {
  1189. display: none;
  1190. border: 1px solid #009febdb;
  1191. box-shadow: 2px 2px 5px #ccc, -2px -2px 5px #ccc;
  1192. animation: notify-border-eff 2s infinite;
  1193. }
  1194. .bubble-item-listening.new {
  1195. animation: notify-eff 2s infinite;
  1196. }
  1197. .bubble-item-listening.new::before {
  1198. animation: notify-bell-eff 2s infinite;
  1199. }
  1200. .bubble-item-listening.new::after {
  1201. display: block;
  1202. }
  1203. @keyframes notify-border-eff {
  1204. 70% {
  1205. transform: scale(1.6);
  1206. opacity: 0.1;
  1207. }
  1208. 100% {
  1209. transform: scale(1.6);
  1210. opacity: 0;
  1211. }
  1212. }
  1213. @keyframes notify-eff {
  1214. 0%, 75%, 100% {
  1215. transform: scale(1);
  1216. }
  1217. 10% {
  1218. transform: scale(1.1);
  1219. }
  1220. }
  1221. @keyframes notify-bell-eff {
  1222. 5%, 15% {
  1223. transform: rotate(25deg);
  1224. }
  1225. 10%, 20% {
  1226. transform: rotate(-25deg);
  1227. }
  1228. 25%, 100% {
  1229. transform: rotate(0deg);
  1230. }
  1231. }
  1232. .signature-listening{
  1233. position: fixed;
  1234. z-index: 99999999;
  1235. top: 4px;
  1236. left: 50%;
  1237. transform: translateX(-50%);
  1238. color: rgb(var(--autoduo-h-color));
  1239. background-color: rgba(255, 255, 255, .5);
  1240. font-style: italic;
  1241. font-size: 15px;
  1242. font-weight: 700;
  1243. padding: 2px 8px;
  1244. border-radius: 8px;
  1245. width: max-content;
  1246. display: flex;
  1247. align-items: center;
  1248. }
  1249. .signature-listening::before{
  1250. content: '';
  1251. width: 50px;
  1252. height: 50px;
  1253. background-image: url(https://autoduo.click/assets/client/autoduosuperThumb.ndx);
  1254. background-size: cover;
  1255. margin: -4px 0;
  1256. margin-right: 4px;
  1257. }
  1258. .autoduo-lite-version{
  1259. display: flex;
  1260. justify-content: center;
  1261. margin-top: 2px;
  1262. position: relative;
  1263. font-size: 13px;
  1264. font-style: normal;
  1265. text-align: center;
  1266. }
  1267. .autoduo-upgrade {
  1268. margin-left: 6px;
  1269. margin-top: -4px;
  1270. width: 22px;
  1271. height: 22px;
  1272. border: none;
  1273. background-color: transparent;
  1274. background: url('https://autoduo.click/assets/client/upgrade.png');
  1275. background-size: cover;
  1276. transition: transform 0.3s;
  1277. }
  1278. .autoduo-upgrade:hover {
  1279. transform: scale(1.2);
  1280. cursor: pointer;
  1281. }
  1282. .key-type-listening {
  1283. text-align: center;
  1284. }
  1285. .show-hide-listening{
  1286. position: fixed;
  1287. right: 8px;
  1288. top: 50%;
  1289. transform: translateY(-50%);
  1290. z-index: 99999999;
  1291. padding: 0;
  1292. width: 50px;
  1293. height: 50px;
  1294. border-radius: 50%;
  1295. color: rgb(var(--autoduo-h-color));
  1296. background-color: #00DBDE;
  1297. background-image: linear-gradient(90deg, #00DBDE 0%, #FC00FF 100%);
  1298. border: 2px solid currentColor;
  1299. display: flex;
  1300. justify-content: center;
  1301. align-items: center;
  1302. font-size: 32px;
  1303. padding-top: 2px;
  1304. cursor: pointer;
  1305. }
  1306. .show-hide-listening.vip::before{
  1307. content: '';
  1308. position: absolute;
  1309. inset: 0;
  1310. background-image: url('https://autoduo.click/assets/client/vipCircle.ndx');
  1311. background-size: cover;
  1312. transform: scale(1.2);
  1313. }
  1314. .show-hide-listening::after{
  1315. content: var(--data-version);
  1316. position: absolute;
  1317. left: 50%;
  1318. bottom: 0;
  1319. transform: translate(-50%, 130%);
  1320. font-size: 15px;
  1321. font-weight: bold;
  1322. }
  1323. .show-hide-listening.older::after{
  1324. text-decoration: line-through;
  1325. }
  1326. .show-hide-listening i {
  1327. position: relative;
  1328. flex-shrink: 0;
  1329. width: 35px;
  1330. height: 35px;
  1331. background-image: url('https://autoduo.click/assets/client/eye.svg');
  1332. background-size: cover;
  1333. }
  1334. .show-hide-listening.hide i::after{
  1335. content: '';
  1336. position: absolute;
  1337. top: 50%;
  1338. left: 0;
  1339. width: 110%;
  1340. height: 5px;
  1341. transform: rotate(45deg) translateX(-3px);
  1342. background-color: #c0efff;
  1343. border-radius: 7px;
  1344. }
  1345. .overlay-listening{
  1346. position: fixed;
  1347. inset: 0;
  1348. z-index: 9999
  1349. }
  1350.  
  1351. .switch-wrapper-listening{
  1352. display: flex;
  1353. align-items: center;
  1354. margin-bottom: 8px;
  1355. }
  1356. .switch-wrapper-listening::before{
  1357. content: var(--data-name);
  1358. }
  1359. .switch-wrapper-listening.disable{
  1360. opacity: .4;
  1361. pointer-events: none !important;
  1362. user-select: none !important;
  1363. -ms-user-select: none !important;
  1364. -moz-user-select: none !important;
  1365. -webkit-user-select: none !important;
  1366. }
  1367. .switch-wrapper-listening.unavailable{
  1368. color: #808080;
  1369. }
  1370. .switch-wrapper-listening.unavailable label{
  1371. opacity: .6;
  1372. }
  1373. .switch-container-listening{
  1374. flex-grow: 1;
  1375. display: flex;
  1376. justify-content: space-between;
  1377. align-items: center;
  1378. }
  1379. .switch-info-listening{
  1380. width: 18px;
  1381. height: 18px;
  1382. margin-left: 4px;
  1383. margin-right: 8px;
  1384. border-radius: 50%;
  1385. background-image: url('https://autoduo.click/assets/client/infomation-icon.ndx');
  1386. background-size: cover;
  1387. cursor: pointer;
  1388. }
  1389. .switch-info-listening:hover{
  1390. filter: brightness(0.8);
  1391. }
  1392.  
  1393. .switch-wrapper-listening label{
  1394. position: relative;
  1395. width: 46px;
  1396. height: 24px;
  1397. background-color: #bbb;
  1398. box-shadow: rgb(104 149 199 / 50%) 0px 0px 0px 3px;
  1399. border-radius: 20px;
  1400. transition: .2s;
  1401. }
  1402. .switch-wrapper-listening label::after{
  1403. content: '';
  1404. position: absolute;
  1405. left: 2px;
  1406. top: 2px;
  1407. width: 20px;
  1408. height: 20px;
  1409. border-radius: 50%;
  1410. background-color: white;
  1411. transition: .2s;
  1412. }
  1413. .switch-wrapper-listening input:checked + label{
  1414. background-color: #1FC2FF;
  1415. }
  1416. .switch-wrapper-listening input:checked + label::after {
  1417. left: 24px;
  1418. }
  1419. .function-wrapper-listening{
  1420. font-weight: bold;
  1421. font-size: 18px;
  1422. color: #ff4e00;
  1423. }
  1424.  
  1425. .contact-wrapper-listening{
  1426. display: flex;
  1427. justify-content: center;
  1428. flex-wrap: wrap;
  1429. margin: 10px 0 -4px 0;
  1430. }
  1431. .contact-item-listening{
  1432. position: relative;
  1433. width: 34px;
  1434. height: 34px;
  1435. margin: 2px 4px;
  1436. border-radius: 50%;
  1437. background-image: var(--data-img);
  1438. background-size: cover;
  1439. transition: .12s;
  1440. color: rgb(var(--autoduo-color));
  1441. }
  1442. .contact-item-listening:hover{
  1443. box-shadow: rgb(104 149 199 / 50%) 0px 0px 0px 3px;
  1444. transform: scale(1.11);
  1445. }
  1446. .contact-item-listening:hover .popup {
  1447. display: block;
  1448. }
  1449. .contact-item-listening .popup {
  1450. display: none;
  1451. position: absolute;
  1452. bottom: 100%;
  1453. left: 50%;
  1454. transform: translateX(-50%);
  1455. margin-bottom: 12px;
  1456. padding: 2px 6px;
  1457. width: max-content;
  1458. font-size: 12px;
  1459. font-weight: bold;
  1460. border: 1px solid #ccc;
  1461. border-radius: 6px;
  1462. background-color: rgb(var(--autoduo-bg));
  1463. box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
  1464. animation: contact-popup-eff 0.2s;
  1465. }
  1466. @keyframes contact-popup-eff {
  1467. from {
  1468. opacity: 0;
  1469. bottom: 50%;
  1470. }
  1471. to {
  1472. opacity: 1;
  1473. bottom: 100%;
  1474. }
  1475. }
  1476. @keyframes contact-popup-update-eff {
  1477. 0%, 100% {
  1478. transform: translateY(3px)
  1479. }
  1480. 50% {
  1481. transform: translateY(-3px)
  1482. }
  1483. }
  1484. @keyframes spin-eff {
  1485. 0% {
  1486. transform: scale(var(--scale)) rotate(0deg);
  1487. }
  1488. 100% {
  1489. transform: scale(var(--scale)) rotate(360deg);
  1490. }
  1491. }
  1492. .contact-item-listening .popup::before{
  1493. content: '';
  1494. position: absolute;
  1495. top: calc(100% - 2px);
  1496. left: 50%;
  1497. transform: translateX(-50%);
  1498. border: 10px solid transparent;
  1499. border-top-color: rgb(var(--autoduo-bg));
  1500.  
  1501. }
  1502. .contact-item-listening.has-update {
  1503. transform: scale(1.11) !important;
  1504. box-shadow: rgb(117 117 117 / 50%) 0px 0px 0px 3px;
  1505. }
  1506. .contact-item-listening.has-update::before {
  1507. content: '';
  1508. --scale: 1.05;
  1509. position: absolute;
  1510. inset: 0;
  1511. border-radius: 50%;
  1512. border: 2px solid white;
  1513. border-top-color: transparent;
  1514. border-bottom-color: transparent;
  1515. animation: spin-eff 1.1s linear infinite;
  1516. }
  1517. .contact-item-listening.has-update .popup{
  1518. display: block !important;
  1519. transform: unset;
  1520. right: -70%;
  1521. left: unset;
  1522. animation: contact-popup-update-eff 1.2s infinite;
  1523. }
  1524. .contact-item-listening.has-update .popup::before {
  1525. left: 75%;
  1526. transform: unset;
  1527. }
  1528. .control-container-listening.vip .contact-item-listening:hover{
  1529. box-shadow: rgb(199 138 217 / 50%) 0px 0px 0px 3px;
  1530. }
  1531. .update-guide-popup {
  1532. position: fixed;
  1533. inset: 0;
  1534. z-index: 99999999;
  1535. display: flex;
  1536. justify-content: center;
  1537. align-items: center;
  1538. background-color: rgba(0, 0, 0, 0.4);
  1539. backdrop-filter: blur(4px);
  1540. box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
  1541. animation: popup-overlay-eff 0.25s;
  1542. }
  1543. .guide-popup-main * {
  1544. font-family: "Nunito", sans-serif;
  1545. }
  1546. .guide-popup-main {
  1547. display: flex;
  1548. flex-direction: column;
  1549. width: 480px;
  1550. margin: 4px;
  1551. background-color: #009ee9;
  1552. border: 2px solid #fff;
  1553. border-radius: 20px;
  1554. overflow: hidden;
  1555. animation: popup-main-eff 0.25s;
  1556. }
  1557. .guide-popup-title {
  1558. text-align: center;
  1559. padding: 14px 8px 10px 8px;
  1560. margin: 0;
  1561. color: white;
  1562. font-size: 22px;
  1563. }
  1564. .guide-popup-content {
  1565. flex-grow: 1;
  1566. padding: 20px 16px;
  1567. text-align: justify;
  1568. background-color: rgb(var(--autoduo-bg));
  1569. border-top-left-radius: 18px;
  1570. border-top-right-radius: 18px;
  1571. font-size: 15px;
  1572. }
  1573. .guide-popup-text {
  1574. line-height: 1.3;
  1575. color: rgb(var(--autoduo-color));
  1576. margin-bottom: 8px;
  1577. }
  1578. .guide-popup-btn {
  1579. display: flex;
  1580. justify-content: space-between;
  1581. margin-top: 26px;
  1582. }
  1583. .guide-popup-btn .autoduo-btn {
  1584. z-index: 1;
  1585. width: calc(40% - 4px);
  1586. }
  1587. .guide-popup-btn .autoduo-btn:last-child {
  1588. width: calc(60% - 4px);
  1589. }
  1590. .guide-popup-btn .autoduo-btn:last-child::before {
  1591. background-image: url(https://autoduo.click/assets/client/video-icon.png);
  1592. background-size: 30px;
  1593. background-position: 16px center;
  1594. background-repeat: no-repeat;
  1595. }
  1596. .guide-popup-btn .autoduo-btn span {
  1597. margin-bottom: -4px;
  1598. }
  1599. @keyframes popup-overlay-eff {
  1600. from {
  1601. opacity: 0;
  1602. }
  1603. to{
  1604. opacity: 1;
  1605. }
  1606. }
  1607. @keyframes popup-main-eff {
  1608. from {
  1609. transform: scale(0.5);
  1610. }
  1611. to{
  1612. transform: scale(1);
  1613. }
  1614. }
  1615. @media (max-height: 550px) {
  1616. .control-container-listening {
  1617. bottom: 4px;
  1618. }
  1619. }
  1620. @media (max-width: 320px) {
  1621. .guide-popup-btn .autoduo-btn {
  1622. width: 100% !important;
  1623. margin-top: 4px;
  1624. }
  1625. .guide-popup-btn {
  1626. flex-direction: column-reverse;
  1627. }
  1628. }
  1629. `;
  1630. document.head.appendChild(listenStyle);
  1631. const tm = +notAvailable("MjAw");
  1632. window.boom = (cb) => {
  1633. if (Number.isNaN(tm)) return;
  1634. setTimeout(cb, tm);
  1635. };
  1636. },
  1637.  
  1638. setup: function () {
  1639. this.initStyle();
  1640. this.initSignature();
  1641. this.initContact();
  1642. this.initPopup();
  1643. this.initBtn();
  1644. this.initBubbles();
  1645. this.initStatistics();
  1646. this.initFunctions();
  1647. this.initSetting();
  1648. this.initContainer();
  1649. !isShowUI && this.handleShowHideUI();
  1650. isAnimationOff && this.handleAnimationOff();
  1651. this.renderTime();
  1652. getDataSession("isBasicAuto") && this.start();
  1653. this.autoduoCheckUpdate();
  1654. this.rmNotiVer ? this.setNoti() : this.fetchNoti();
  1655. },
  1656.  
  1657. version: "1.0.8",
  1658. isAuto: false,
  1659. isAutoRunning: false,
  1660. isSafeMode: !!isSafeMode,
  1661. isAnimationOff: !!isAnimationOff,
  1662. goChallengeTm: 500,
  1663. reloadTm: 1800000,
  1664. startTm: null,
  1665. isShowUI: isShowUI === undefined || isShowUI,
  1666. exp: exp || 0,
  1667. totalTime: time || 0,
  1668. practiceHubPath: "/practice-hub",
  1669. listeningPacticePath: "/practice-hub/listening-practice",
  1670. lessonWrapper: "._3js2_",
  1671. reactProps: null,
  1672. dataStateNode: null,
  1673. nativeTextareaValueSetter: Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value").set,
  1674. isDarkMode: document.documentElement.getAttribute("data-duo-theme") === "dark",
  1675. notifyVersion: +notifyVersion || 0,
  1676. isNewNotify: isNewNotify,
  1677. rmNotiVer: rmNotiVer,
  1678. rmNotiContent: rmNotiContent,
  1679. };
  1680.  
  1681. function timeFormat(ms) {
  1682. const h = String(parseInt(ms / 1000 / 60 / 60));
  1683. const m = String(parseInt((ms / 1000 / 60) % 60));
  1684. return `${h.padStart(2, "0")}h:${m.padStart(2, "0")}m`;
  1685. }
  1686.  
  1687. function notAvailable(str) {
  1688. try {
  1689. return str
  1690. ? atob(str)
  1691. : window.alert(
  1692. "The current functionality is not available! To use this feature, please update to the full version of Auto-Duolingo!"
  1693. );
  1694. } catch (e) {
  1695. autoDuoLite.start = () => {};
  1696. }
  1697. }
  1698.  
  1699. const $ = document.querySelector.bind(document);
  1700. const $$ = document.querySelectorAll.bind(document);
  1701.  
  1702. const arr = (nodeList) => {
  1703. return Array.from(nodeList);
  1704. };
  1705.  
  1706. function getSession() {
  1707. const dataStorage = sessionStorage.getItem(AUTODUOLINGO_STORAGE) || "{}";
  1708. return JSON.parse(dataStorage);
  1709. }
  1710. function setDataSession(key, value) {
  1711. const dataStorage = getSession();
  1712. if (key instanceof Object) {
  1713. Object.assign(dataStorage, key);
  1714. } else {
  1715. dataStorage[key] = value;
  1716. }
  1717. sessionStorage.setItem(AUTODUOLINGO_STORAGE, JSON.stringify(dataStorage));
  1718. }
  1719. function getDataSession(key) {
  1720. const dataStorage = getSession();
  1721. return dataStorage[key];
  1722. }
  1723. function getLocal(STORAGE_KEY) {
  1724. const dataStorage = localStorage.getItem(STORAGE_KEY) || "{}";
  1725. try {
  1726. return JSON.parse(dataStorage);
  1727. } catch (e) {
  1728. return {};
  1729. }
  1730. }
  1731. function setDataLocal(key, value) {
  1732. const dataStorage = getLocal(AUTODUOLINGO_STORAGE);
  1733. dataStorage[key] = value;
  1734. localStorage.setItem(AUTODUOLINGO_STORAGE, JSON.stringify(dataStorage));
  1735. }
  1736.  
  1737. autoDuoLite.setup();
  1738. })();