Auto-Duolingo

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

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