Auto-Duolingo

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

目前为 2025-02-14 提交的版本。查看 最新版本

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址