袋鼠快跳

浏览器快捷跳转

  1. // ==UserScript==
  2. // @name 袋鼠快跳
  3. // @namespace https://chensuiyi.me
  4. // @version 1.1.4
  5. // @author 陈随易
  6. // @description 浏览器快捷跳转
  7. // @license MIT
  8. // @icon https://static.yicode.tech/logo/kuaitiao2.png
  9. // @homepage https://chensuiyi.me
  10. // @homepageURL https://chensuiyi.me
  11. // @source https://github.com/chenbimo/kangaroo-jump
  12. // @match *://*/*
  13. // @grant GM_addStyle
  14. // @grant GM_deleteValue
  15. // @grant GM_getValue
  16. // @grant GM_listValues
  17. // @grant GM_setValue
  18. // ==/UserScript==
  19.  
  20. (o=>{if(typeof GM_addStyle=="function"){GM_addStyle(o);return}const i=document.createElement("style");i.textContent=o,document.head.append(i)})(" :root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}.kuaitiao{position:fixed;top:50vh;left:50vw;height:600px;width:1000px;margin-top:-300px;margin-left:-500px;z-index:999999999;display:none;background-color:#333;border:2px solid #999;border-radius:10px;font-size:14px}.kuaitiao a{text-decoration:none!important;color:inherit!important}.kuaitiao a:hover{text-decoration:none!important}.kuaitiao *{box-sizing:border-box;padding:0;border:0;margin:0;outline:0}.kuaitiao.active{display:block}.kuaitiao .logo{position:absolute;top:-30px;left:50%;margin-left:-30px;height:60px;width:60px;border:2px solid #999;background-repeat:no-repeat;background-position:center center;background-size:cover;border-radius:20px}.kuaitiao .panel{position:absolute;left:15px;right:0;bottom:41px;top:40px}.kuaitiao .panel .group .grid{display:flex;flex-wrap:wrap}.kuaitiao .panel .group .box{padding-right:15px;flex:0 0 16.6666666667%;margin-bottom:15px}.kuaitiao .panel .group .box .inner{position:relative;height:40px;background-color:#555;border-radius:20px;padding:0 10px;transition:all .2s;display:flex;justify-content:space-between;align-items:center}.kuaitiao .panel .group .box .inner.move .pointer .shou{fill:#e33}.kuaitiao .panel .group .box .inner .pointer{position:absolute;height:100%;width:14px;left:-13px;font-size:14px;display:flex;flex-direction:column;justify-content:flex-end}.kuaitiao .panel .group .box .inner .link{flex:1 1 100%;display:flex;align-items:center;color:#fff}.kuaitiao .panel .group .box .inner .close{flex:0 0 auto;font-size:18px;cursor:pointer;display:flex;align-items:center}.kuaitiao .panel .group .box .inner .close .close-icon{fill:#666;transition:all .2s}.kuaitiao .panel .group .box .inner .close:hover .close-icon{fill:#e33}.kuaitiao .panel .group .box .inner:hover{box-shadow:0 2px #888}.kuaitiao .panel .group .box .inner:hover .dot{background-color:#3fed2d}.kuaitiao .panel .group .box .inner .dot{flex:0 0 12px;height:12px;background-color:#999;margin-right:6px;border-radius:6px;transition:all .2s}.kuaitiao .panel .group .box .inner .text{flex:1 1 100%;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#eee!important;text-decoration:none!important}.kuaitiao .foot{position:absolute;bottom:0;left:15px;right:15px;height:26px;border-top:1px solid #444;display:flex;justify-content:space-between;align-items:center}.kuaitiao .foot .left{flex:0 0 45%;font-size:12px;color:#666;cursor:pointer;transition:all .2s}.kuaitiao .foot .left:hover{color:#999}.kuaitiao .foot .right{flex:0 0 45%;display:flex;justify-content:flex-end;font-size:16px}.kuaitiao .foot .right .icon{cursor:pointer}.kuaitiao .foot .right .icon svg{transition:all .2s;fill:#666}.kuaitiao .foot .right .icon:hover svg{fill:#999}.kuaitiao .foot .center{flex:0 0 10%;display:flex;justify-content:center;align-items:center;font-size:24px}.kuaitiao .foot .center .icon{cursor:pointer}.kuaitiao .foot .center .icon .plus{fill:#ccc;transition:all .2s}.kuaitiao .foot .center .icon:hover .plus{fill:#fff}.kuaitiao .dialog.add{position:absolute;bottom:35px;width:200px;height:52px;border:2px solid #999;background-color:#fff;left:50%;margin-left:-100px;border-radius:6px;display:none}.kuaitiao .dialog.add.active{display:block}.kuaitiao .dialog.add .info{position:absolute;left:0;top:0;bottom:0;width:160px}.kuaitiao .dialog.add .info .input:first-of-type{border-bottom:1px solid #ccc}.kuaitiao .dialog.add .info input{height:24px;background-color:transparent;padding:0 6px}.kuaitiao .dialog.add .info input::placeholder{font-size:12px}.kuaitiao .dialog.add .send{position:absolute;right:0;top:0;bottom:0;width:40px;display:flex;justify-content:center;align-items:center;font-size:20px;cursor:pointer}.kuaitiao .dialog.add .send .gou{fill:#666;transition:all .2s}.kuaitiao .dialog.add .send:hover .gou{fill:#00b42a} ");
  21.  
  22. (function () {
  23. 'use strict';
  24.  
  25. var __defProp = Object.defineProperty;
  26. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  27. var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  28. function noop() {
  29. }
  30. function run(fn) {
  31. return fn();
  32. }
  33. function blank_object() {
  34. return /* @__PURE__ */ Object.create(null);
  35. }
  36. function run_all(fns) {
  37. fns.forEach(run);
  38. }
  39. function is_function(thing) {
  40. return typeof thing === "function";
  41. }
  42. function safe_not_equal(a2, b) {
  43. return a2 != a2 ? b == b : a2 !== b || a2 && typeof a2 === "object" || typeof a2 === "function";
  44. }
  45. function is_empty(obj) {
  46. return Object.keys(obj).length === 0;
  47. }
  48. function append(target, node) {
  49. target.appendChild(node);
  50. }
  51. function insert(target, node, anchor) {
  52. target.insertBefore(node, anchor || null);
  53. }
  54. function detach(node) {
  55. if (node.parentNode) {
  56. node.parentNode.removeChild(node);
  57. }
  58. }
  59. function element(name) {
  60. return document.createElement(name);
  61. }
  62. function text(data) {
  63. return document.createTextNode(data);
  64. }
  65. function space() {
  66. return text(" ");
  67. }
  68. function listen(node, event, handler, options) {
  69. node.addEventListener(event, handler, options);
  70. return () => node.removeEventListener(event, handler, options);
  71. }
  72. function attr(node, attribute, value) {
  73. if (value == null) node.removeAttribute(attribute);
  74. else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
  75. }
  76. function children(element2) {
  77. return Array.from(element2.childNodes);
  78. }
  79. function set_data(text2, data) {
  80. data = "" + data;
  81. if (text2.data === data) return;
  82. text2.data = /** @type {string} */
  83. data;
  84. }
  85. function set_input_value(input, value) {
  86. input.value = value == null ? "" : value;
  87. }
  88. function set_style(node, key, value, important) {
  89. {
  90. node.style.setProperty(key, value, "");
  91. }
  92. }
  93. function toggle_class(element2, name, toggle) {
  94. element2.classList.toggle(name, !!toggle);
  95. }
  96. let current_component;
  97. function set_current_component(component) {
  98. current_component = component;
  99. }
  100. const dirty_components = [];
  101. const binding_callbacks = [];
  102. let render_callbacks = [];
  103. const flush_callbacks = [];
  104. const resolved_promise = /* @__PURE__ */ Promise.resolve();
  105. let update_scheduled = false;
  106. function schedule_update() {
  107. if (!update_scheduled) {
  108. update_scheduled = true;
  109. resolved_promise.then(flush);
  110. }
  111. }
  112. function add_render_callback(fn) {
  113. render_callbacks.push(fn);
  114. }
  115. const seen_callbacks = /* @__PURE__ */ new Set();
  116. let flushidx = 0;
  117. function flush() {
  118. if (flushidx !== 0) {
  119. return;
  120. }
  121. const saved_component = current_component;
  122. do {
  123. try {
  124. while (flushidx < dirty_components.length) {
  125. const component = dirty_components[flushidx];
  126. flushidx++;
  127. set_current_component(component);
  128. update(component.$$);
  129. }
  130. } catch (e2) {
  131. dirty_components.length = 0;
  132. flushidx = 0;
  133. throw e2;
  134. }
  135. set_current_component(null);
  136. dirty_components.length = 0;
  137. flushidx = 0;
  138. while (binding_callbacks.length) binding_callbacks.pop()();
  139. for (let i2 = 0; i2 < render_callbacks.length; i2 += 1) {
  140. const callback = render_callbacks[i2];
  141. if (!seen_callbacks.has(callback)) {
  142. seen_callbacks.add(callback);
  143. callback();
  144. }
  145. }
  146. render_callbacks.length = 0;
  147. } while (dirty_components.length);
  148. while (flush_callbacks.length) {
  149. flush_callbacks.pop()();
  150. }
  151. update_scheduled = false;
  152. seen_callbacks.clear();
  153. set_current_component(saved_component);
  154. }
  155. function update($$) {
  156. if ($$.fragment !== null) {
  157. $$.update();
  158. run_all($$.before_update);
  159. const dirty = $$.dirty;
  160. $$.dirty = [-1];
  161. $$.fragment && $$.fragment.p($$.ctx, dirty);
  162. $$.after_update.forEach(add_render_callback);
  163. }
  164. }
  165. function flush_render_callbacks(fns) {
  166. const filtered = [];
  167. const targets = [];
  168. render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
  169. targets.forEach((c) => c());
  170. render_callbacks = filtered;
  171. }
  172. const outroing = /* @__PURE__ */ new Set();
  173. function transition_in(block, local) {
  174. if (block && block.i) {
  175. outroing.delete(block);
  176. block.i(local);
  177. }
  178. }
  179. function ensure_array_like(array_like_or_iterator) {
  180. return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
  181. }
  182. function destroy_block(block, lookup) {
  183. block.d(1);
  184. lookup.delete(block.key);
  185. }
  186. function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block2, next, get_context) {
  187. let o2 = old_blocks.length;
  188. let n2 = list.length;
  189. let i2 = o2;
  190. const old_indexes = {};
  191. while (i2--) old_indexes[old_blocks[i2].key] = i2;
  192. const new_blocks = [];
  193. const new_lookup = /* @__PURE__ */ new Map();
  194. const deltas = /* @__PURE__ */ new Map();
  195. const updates = [];
  196. i2 = n2;
  197. while (i2--) {
  198. const child_ctx = get_context(ctx, list, i2);
  199. const key = get_key(child_ctx);
  200. let block = lookup.get(key);
  201. if (!block) {
  202. block = create_each_block2(key, child_ctx);
  203. block.c();
  204. } else {
  205. updates.push(() => block.p(child_ctx, dirty));
  206. }
  207. new_lookup.set(key, new_blocks[i2] = block);
  208. if (key in old_indexes) deltas.set(key, Math.abs(i2 - old_indexes[key]));
  209. }
  210. const will_move = /* @__PURE__ */ new Set();
  211. const did_move = /* @__PURE__ */ new Set();
  212. function insert2(block) {
  213. transition_in(block, 1);
  214. block.m(node, next);
  215. lookup.set(block.key, block);
  216. next = block.first;
  217. n2--;
  218. }
  219. while (o2 && n2) {
  220. const new_block = new_blocks[n2 - 1];
  221. const old_block = old_blocks[o2 - 1];
  222. const new_key = new_block.key;
  223. const old_key = old_block.key;
  224. if (new_block === old_block) {
  225. next = new_block.first;
  226. o2--;
  227. n2--;
  228. } else if (!new_lookup.has(old_key)) {
  229. destroy(old_block, lookup);
  230. o2--;
  231. } else if (!lookup.has(new_key) || will_move.has(new_key)) {
  232. insert2(new_block);
  233. } else if (did_move.has(old_key)) {
  234. o2--;
  235. } else if (deltas.get(new_key) > deltas.get(old_key)) {
  236. did_move.add(new_key);
  237. insert2(new_block);
  238. } else {
  239. will_move.add(old_key);
  240. o2--;
  241. }
  242. }
  243. while (o2--) {
  244. const old_block = old_blocks[o2];
  245. if (!new_lookup.has(old_block.key)) destroy(old_block, lookup);
  246. }
  247. while (n2) insert2(new_blocks[n2 - 1]);
  248. run_all(updates);
  249. return new_blocks;
  250. }
  251. function mount_component(component, target, anchor) {
  252. const { fragment, after_update } = component.$$;
  253. fragment && fragment.m(target, anchor);
  254. add_render_callback(() => {
  255. const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
  256. if (component.$$.on_destroy) {
  257. component.$$.on_destroy.push(...new_on_destroy);
  258. } else {
  259. run_all(new_on_destroy);
  260. }
  261. component.$$.on_mount = [];
  262. });
  263. after_update.forEach(add_render_callback);
  264. }
  265. function destroy_component(component, detaching) {
  266. const $$ = component.$$;
  267. if ($$.fragment !== null) {
  268. flush_render_callbacks($$.after_update);
  269. run_all($$.on_destroy);
  270. $$.fragment && $$.fragment.d(detaching);
  271. $$.on_destroy = $$.fragment = null;
  272. $$.ctx = [];
  273. }
  274. }
  275. function make_dirty(component, i2) {
  276. if (component.$$.dirty[0] === -1) {
  277. dirty_components.push(component);
  278. schedule_update();
  279. component.$$.dirty.fill(0);
  280. }
  281. component.$$.dirty[i2 / 31 | 0] |= 1 << i2 % 31;
  282. }
  283. function init(component, options, instance2, create_fragment2, not_equal, props, append_styles = null, dirty = [-1]) {
  284. const parent_component = current_component;
  285. set_current_component(component);
  286. const $$ = component.$$ = {
  287. fragment: null,
  288. ctx: [],
  289. // state
  290. props,
  291. update: noop,
  292. not_equal,
  293. bound: blank_object(),
  294. // lifecycle
  295. on_mount: [],
  296. on_destroy: [],
  297. on_disconnect: [],
  298. before_update: [],
  299. after_update: [],
  300. context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
  301. // everything else
  302. callbacks: blank_object(),
  303. dirty,
  304. skip_bound: false,
  305. root: options.target || parent_component.$$.root
  306. };
  307. append_styles && append_styles($$.root);
  308. let ready = false;
  309. $$.ctx = instance2 ? instance2(component, options.props || {}, (i2, ret, ...rest) => {
  310. const value = rest.length ? rest[0] : ret;
  311. if ($$.ctx && not_equal($$.ctx[i2], $$.ctx[i2] = value)) {
  312. if (!$$.skip_bound && $$.bound[i2]) $$.bound[i2](value);
  313. if (ready) make_dirty(component, i2);
  314. }
  315. return ret;
  316. }) : [];
  317. $$.update();
  318. ready = true;
  319. run_all($$.before_update);
  320. $$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
  321. if (options.target) {
  322. if (options.hydrate) {
  323. const nodes = children(options.target);
  324. $$.fragment && $$.fragment.l(nodes);
  325. nodes.forEach(detach);
  326. } else {
  327. $$.fragment && $$.fragment.c();
  328. }
  329. if (options.intro) transition_in(component.$$.fragment);
  330. mount_component(component, options.target, options.anchor);
  331. flush();
  332. }
  333. set_current_component(parent_component);
  334. }
  335. class SvelteComponent {
  336. constructor() {
  337. /**
  338. * ### PRIVATE API
  339. *
  340. * Do not use, may change at any time
  341. *
  342. * @type {any}
  343. */
  344. __publicField(this, "$$");
  345. /**
  346. * ### PRIVATE API
  347. *
  348. * Do not use, may change at any time
  349. *
  350. * @type {any}
  351. */
  352. __publicField(this, "$$set");
  353. }
  354. /** @returns {void} */
  355. $destroy() {
  356. destroy_component(this, 1);
  357. this.$destroy = noop;
  358. }
  359. /**
  360. * @template {Extract<keyof Events, string>} K
  361. * @param {K} type
  362. * @param {((e: Events[K]) => void) | null | undefined} callback
  363. * @returns {() => void}
  364. */
  365. $on(type, callback) {
  366. if (!is_function(callback)) {
  367. return noop;
  368. }
  369. const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
  370. callbacks.push(callback);
  371. return () => {
  372. const index = callbacks.indexOf(callback);
  373. if (index !== -1) callbacks.splice(index, 1);
  374. };
  375. }
  376. /**
  377. * @param {Partial<Props>} props
  378. * @returns {void}
  379. */
  380. $set(props) {
  381. if (this.$$set && !is_empty(props)) {
  382. this.$$.skip_bound = true;
  383. this.$$set(props);
  384. this.$$.skip_bound = false;
  385. }
  386. }
  387. }
  388. const PUBLIC_VERSION = "4";
  389. if (typeof window !== "undefined")
  390. (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
  391. var t = ["Shift", "Meta", "Alt", "Control"], e = "object" == typeof navigator ? navigator.platform : "", n = /Mac|iPod|iPhone|iPad/.test(e), r = n ? "Meta" : "Control", o = "Win32" === e ? ["Control", "Alt"] : n ? ["Alt"] : [];
  392. function i(t2, e2) {
  393. return "function" == typeof t2.getModifierState && (t2.getModifierState(e2) || o.includes(e2) && t2.getModifierState("AltGraph"));
  394. }
  395. function a(t2) {
  396. return t2.trim().split(" ").map(function(t3) {
  397. var e2 = t3.split(/\b\+/), n2 = e2.pop();
  398. return [e2 = e2.map(function(t4) {
  399. return "$mod" === t4 ? r : t4;
  400. }), n2];
  401. });
  402. }
  403. function u(e2, n2) {
  404. var r2;
  405. void 0 === n2 && (n2 = {});
  406. var o2 = null != (r2 = n2.timeout) ? r2 : 1e3, u2 = Object.keys(e2).map(function(t2) {
  407. return [a(t2), e2[t2]];
  408. }), c = /* @__PURE__ */ new Map(), f = null;
  409. return function(e3) {
  410. e3 instanceof KeyboardEvent && (u2.forEach(function(n3) {
  411. var r3 = n3[0], o3 = n3[1], a2 = c.get(r3) || r3;
  412. !function(e4, n4) {
  413. return !(n4[1].toUpperCase() !== e4.key.toUpperCase() && n4[1] !== e4.code || n4[0].find(function(t2) {
  414. return !i(e4, t2);
  415. }) || t.find(function(t2) {
  416. return !n4[0].includes(t2) && n4[1] !== t2 && i(e4, t2);
  417. }));
  418. }(e3, a2[0]) ? i(e3, e3.key) || c.delete(r3) : a2.length > 1 ? c.set(r3, a2.slice(1)) : (c.delete(r3), o3(e3));
  419. }), f && clearTimeout(f), f = setTimeout(c.clear.bind(c), o2));
  420. };
  421. }
  422. var _GM_deleteValue = /* @__PURE__ */ (() => typeof GM_deleteValue != "undefined" ? GM_deleteValue : void 0)();
  423. var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  424. var _GM_listValues = /* @__PURE__ */ (() => typeof GM_listValues != "undefined" ? GM_listValues : void 0)();
  425. var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  426. const logoSvg = "data:image/png;base64,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";
  427. const addSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r\n <path class="plus" fill="#cccccc" d="M4.139 20q-.703 0-1.06-.606q-.358-.605.01-1.221L10.95 4.789q.187-.299.467-.457t.58-.159q.301 0 .584.159t.469.457l7.88 13.384q.368.616.01 1.221q-.357.606-1.06.606zm7.361-4.846v1.442q0 .213.144.357t.357.143t.356-.143t.143-.357v-1.442h1.48q.213 0 .357-.144t.144-.357t-.144-.356t-.356-.143H12.5V12.73q0-.213-.144-.356t-.357-.144t-.356.144t-.143.356v1.423h-1.461q-.213 0-.357.144t-.144.357t.144.356t.356.143z" />\r\n</svg>';
  428. const githubSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r\n <path d="M12 2.247a10 10 0 0 0-3.162 19.487c.5.088.687-.212.687-.475c0-.237-.012-1.025-.012-1.862c-2.513.462-3.163-.613-3.363-1.175a3.636 3.636 0 0 0-1.025-1.413c-.35-.187-.85-.65-.013-.662a2.001 2.001 0 0 1 1.538 1.025a2.137 2.137 0 0 0 2.912.825a2.104 2.104 0 0 1 .638-1.338c-2.225-.25-4.55-1.112-4.55-4.937a3.892 3.892 0 0 1 1.025-2.688a3.594 3.594 0 0 1 .1-2.65s.837-.262 2.75 1.025a9.427 9.427 0 0 1 5 0c1.912-1.3 2.75-1.025 2.75-1.025a3.593 3.593 0 0 1 .1 2.65a3.869 3.869 0 0 1 1.025 2.688c0 3.837-2.338 4.687-4.562 4.937a2.368 2.368 0 0 1 .674 1.85c0 1.338-.012 2.413-.012 2.75c0 .263.187.575.687.475A10.005 10.005 0 0 0 12 2.247" />\r\n</svg>';
  429. const gouSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="1.18em" height="1em" viewBox="0 0 1179 1000">\r\n <path class="gou" fill="#666666" d="M1179 72Q929 294 579 822l-115 179Q320 821 0 501l107-107l286 250q150-150 279-271.5T877.5 185T1009 74t77-59l21-14q4 0 11 2t26 19.5t35 49.5" />\r\n</svg>';
  430. const closeSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r\n <path class="close-icon" fill="#666666" fill-rule="evenodd" d="M6.793 6.793a1 1 0 0 1 1.414 0L12 10.586l3.793-3.793a1 1 0 1 1 1.414 1.414L13.414 12l3.793 3.793a1 1 0 0 1-1.414 1.414L12 13.414l-3.793 3.793a1 1 0 0 1-1.414-1.414L10.586 12L6.793 8.207a1 1 0 0 1 0-1.414" clip-rule="evenodd" />\r\n</svg>';
  431. const pointerSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r\n <g fill="none">\r\n <path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z" />\r\n <path class="shou" fill="none" d="M9.5 2a2.5 2.5 0 0 1 2.495 2.336L12 4.5v4.605l5.442.605a4 4 0 0 1 3.553 3.772l.005.203V14a8 8 0 0 1-7.75 7.996L13 22h-.674a8 8 0 0 1-7.024-4.171l-.131-.251l-2.842-5.684c-.36-.72-.093-1.683.747-2.028c1.043-.427 2.034-.507 3.055.012q.333.17.654.414l.215.17V4.5A2.5 2.5 0 0 1 9.5 2M4 6a1 1 0 0 1 0 2H3a1 1 0 0 1 0-2zm12-1a1 1 0 0 1 .117 1.993L16 7h-1a1 1 0 0 1-.117-1.993L15 5zM4.707 1.293l1 1a1 1 0 0 1-1.414 1.414l-1-1a1 1 0 0 1 1.414-1.414m11 0a1 1 0 0 1 0 1.414l-1 1a1 1 0 1 1-1.414-1.414l1-1a1 1 0 0 1 1.414 0" />\r\n </g>\r\n</svg>';
  432. function get_each_context(ctx, list, i2) {
  433. const child_ctx = ctx.slice();
  434. child_ctx[18] = list[i2];
  435. child_ctx[20] = i2;
  436. return child_ctx;
  437. }
  438. function create_each_block(key_1, ctx) {
  439. let div5;
  440. let div4;
  441. let div0;
  442. let raw0_value = (
  443. /*getSvgCode*/
  444. ctx[5](pointerSvg) + ""
  445. );
  446. let t0;
  447. let a2;
  448. let div1;
  449. let t1;
  450. let div2;
  451. let t2_value = (
  452. /*item*/
  453. ctx[18].name + ""
  454. );
  455. let t2;
  456. let a_href_value;
  457. let t3;
  458. let div3;
  459. let raw1_value = (
  460. /*getSvgCode*/
  461. ctx[5](closeSvg) + ""
  462. );
  463. let t4;
  464. let div5_data_key_value;
  465. let div5_data_index_value;
  466. let mounted;
  467. let dispose;
  468. return {
  469. key: key_1,
  470. first: null,
  471. c() {
  472. div5 = element("div");
  473. div4 = element("div");
  474. div0 = element("div");
  475. t0 = space();
  476. a2 = element("a");
  477. div1 = element("div");
  478. t1 = space();
  479. div2 = element("div");
  480. t2 = text(t2_value);
  481. t3 = space();
  482. div3 = element("div");
  483. t4 = space();
  484. attr(div0, "class", "pointer");
  485. attr(div1, "class", "dot");
  486. attr(div2, "class", "text");
  487. attr(a2, "class", "link");
  488. attr(a2, "target", "_blank");
  489. attr(a2, "href", a_href_value = /*item*/
  490. ctx[18].link);
  491. attr(div3, "class", "close");
  492. attr(div3, "aria-hidden", "true");
  493. attr(div4, "class", "inner");
  494. attr(div5, "class", "box");
  495. attr(div5, "data-key", div5_data_key_value = /*item*/
  496. ctx[18].key);
  497. attr(div5, "data-index", div5_data_index_value = /*index*/
  498. ctx[20]);
  499. attr(div5, "draggable", "true");
  500. this.first = div5;
  501. },
  502. m(target, anchor) {
  503. insert(target, div5, anchor);
  504. append(div5, div4);
  505. append(div4, div0);
  506. div0.innerHTML = raw0_value;
  507. append(div4, t0);
  508. append(div4, a2);
  509. append(a2, div1);
  510. append(a2, t1);
  511. append(a2, div2);
  512. append(div2, t2);
  513. append(div4, t3);
  514. append(div4, div3);
  515. div3.innerHTML = raw1_value;
  516. append(div5, t4);
  517. if (!mounted) {
  518. dispose = [
  519. listen(
  520. a2,
  521. "click",
  522. /*click_handler*/
  523. ctx[8]
  524. ),
  525. listen(div3, "click", function() {
  526. if (is_function(
  527. /*fnDelSite*/
  528. ctx[7](
  529. /*item*/
  530. ctx[18].key
  531. )
  532. )) ctx[7](
  533. /*item*/
  534. ctx[18].key
  535. ).apply(this, arguments);
  536. })
  537. ];
  538. mounted = true;
  539. }
  540. },
  541. p(new_ctx, dirty) {
  542. ctx = new_ctx;
  543. if (dirty & /*sitesGrid*/
  544. 16 && t2_value !== (t2_value = /*item*/
  545. ctx[18].name + "")) set_data(t2, t2_value);
  546. if (dirty & /*sitesGrid*/
  547. 16 && a_href_value !== (a_href_value = /*item*/
  548. ctx[18].link)) {
  549. attr(a2, "href", a_href_value);
  550. }
  551. if (dirty & /*sitesGrid*/
  552. 16 && div5_data_key_value !== (div5_data_key_value = /*item*/
  553. ctx[18].key)) {
  554. attr(div5, "data-key", div5_data_key_value);
  555. }
  556. if (dirty & /*sitesGrid*/
  557. 16 && div5_data_index_value !== (div5_data_index_value = /*index*/
  558. ctx[20])) {
  559. attr(div5, "data-index", div5_data_index_value);
  560. }
  561. },
  562. d(detaching) {
  563. if (detaching) {
  564. detach(div5);
  565. }
  566. mounted = false;
  567. run_all(dispose);
  568. }
  569. };
  570. }
  571. function create_fragment(ctx) {
  572. let div14;
  573. let div0;
  574. let t0;
  575. let div3;
  576. let div2;
  577. let div1;
  578. let each_blocks = [];
  579. let each_1_lookup = /* @__PURE__ */ new Map();
  580. let t1;
  581. let div8;
  582. let div4;
  583. let t3;
  584. let div6;
  585. let div5;
  586. let raw0_value = (
  587. /*getSvgCode*/
  588. ctx[5](addSvg) + ""
  589. );
  590. let t4;
  591. let div7;
  592. let a1;
  593. let raw1_value = (
  594. /*getSvgCode*/
  595. ctx[5](githubSvg) + ""
  596. );
  597. let t5;
  598. let div13;
  599. let div11;
  600. let div9;
  601. let input0;
  602. let t6;
  603. let div10;
  604. let input1;
  605. let t7;
  606. let div12;
  607. let raw2_value = (
  608. /*getSvgCode*/
  609. ctx[5](gouSvg) + ""
  610. );
  611. let mounted;
  612. let dispose;
  613. let each_value = ensure_array_like(
  614. /*sitesGrid*/
  615. ctx[4]
  616. );
  617. const get_key = (ctx2) => (
  618. /*item*/
  619. ctx2[18].key
  620. );
  621. for (let i2 = 0; i2 < each_value.length; i2 += 1) {
  622. let child_ctx = get_each_context(ctx, each_value, i2);
  623. let key = get_key(child_ctx);
  624. each_1_lookup.set(key, each_blocks[i2] = create_each_block(key, child_ctx));
  625. }
  626. return {
  627. c() {
  628. div14 = element("div");
  629. div0 = element("div");
  630. t0 = space();
  631. div3 = element("div");
  632. div2 = element("div");
  633. div1 = element("div");
  634. for (let i2 = 0; i2 < each_blocks.length; i2 += 1) {
  635. each_blocks[i2].c();
  636. }
  637. t1 = space();
  638. div8 = element("div");
  639. div4 = element("div");
  640. div4.innerHTML = `<a target="_blank" href="https://chensuiyi.me">作者:陈随易</a>`;
  641. t3 = space();
  642. div6 = element("div");
  643. div5 = element("div");
  644. t4 = space();
  645. div7 = element("div");
  646. a1 = element("a");
  647. t5 = space();
  648. div13 = element("div");
  649. div11 = element("div");
  650. div9 = element("div");
  651. input0 = element("input");
  652. t6 = space();
  653. div10 = element("div");
  654. input1 = element("input");
  655. t7 = space();
  656. div12 = element("div");
  657. attr(div0, "class", "logo");
  658. set_style(div0, "background-image", "url('" + logoSvg + "')");
  659. attr(div1, "class", "grid");
  660. attr(div1, "id", "grid");
  661. attr(div2, "class", "group");
  662. attr(div3, "class", "panel");
  663. attr(div4, "class", "left");
  664. attr(div5, "class", "icon add-site");
  665. attr(div5, "aria-hidden", "true");
  666. attr(div6, "class", "center");
  667. attr(a1, "class", "icon");
  668. attr(a1, "target", "_blank");
  669. attr(a1, "href", "https://github.com/chenbimo/kangaroo-jump");
  670. attr(div7, "class", "right");
  671. attr(div8, "class", "foot");
  672. attr(input0, "placeholder", "请输入名称");
  673. attr(div9, "class", "input");
  674. attr(input1, "placeholder", "请输入网址");
  675. attr(div10, "class", "input");
  676. attr(div11, "class", "info");
  677. attr(div12, "class", "send");
  678. attr(div12, "aria-hidden", "true");
  679. attr(div13, "class", "dialog add");
  680. toggle_class(
  681. div13,
  682. "active",
  683. /*isActiveAddDialog*/
  684. ctx[1]
  685. );
  686. attr(div14, "class", "kuaitiao");
  687. toggle_class(
  688. div14,
  689. "active",
  690. /*isActiveKuaiTiao*/
  691. ctx[0]
  692. );
  693. },
  694. m(target, anchor) {
  695. insert(target, div14, anchor);
  696. append(div14, div0);
  697. append(div14, t0);
  698. append(div14, div3);
  699. append(div3, div2);
  700. append(div2, div1);
  701. for (let i2 = 0; i2 < each_blocks.length; i2 += 1) {
  702. if (each_blocks[i2]) {
  703. each_blocks[i2].m(div1, null);
  704. }
  705. }
  706. append(div14, t1);
  707. append(div14, div8);
  708. append(div8, div4);
  709. append(div8, t3);
  710. append(div8, div6);
  711. append(div6, div5);
  712. div5.innerHTML = raw0_value;
  713. append(div8, t4);
  714. append(div8, div7);
  715. append(div7, a1);
  716. a1.innerHTML = raw1_value;
  717. append(div14, t5);
  718. append(div14, div13);
  719. append(div13, div11);
  720. append(div11, div9);
  721. append(div9, input0);
  722. set_input_value(
  723. input0,
  724. /*siteName*/
  725. ctx[2]
  726. );
  727. append(div11, t6);
  728. append(div11, div10);
  729. append(div10, input1);
  730. set_input_value(
  731. input1,
  732. /*siteLink*/
  733. ctx[3]
  734. );
  735. append(div13, t7);
  736. append(div13, div12);
  737. div12.innerHTML = raw2_value;
  738. if (!mounted) {
  739. dispose = [
  740. listen(
  741. div5,
  742. "click",
  743. /*click_handler_1*/
  744. ctx[9]
  745. ),
  746. listen(
  747. input0,
  748. "input",
  749. /*input0_input_handler*/
  750. ctx[10]
  751. ),
  752. listen(
  753. input1,
  754. "input",
  755. /*input1_input_handler*/
  756. ctx[11]
  757. ),
  758. listen(
  759. div12,
  760. "click",
  761. /*fnAddSite*/
  762. ctx[6]
  763. )
  764. ];
  765. mounted = true;
  766. }
  767. },
  768. p(ctx2, [dirty]) {
  769. if (dirty & /*sitesGrid, fnDelSite, getSvgCode, isActiveKuaiTiao*/
  770. 177) {
  771. each_value = ensure_array_like(
  772. /*sitesGrid*/
  773. ctx2[4]
  774. );
  775. each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div1, destroy_block, create_each_block, null, get_each_context);
  776. }
  777. if (dirty & /*siteName*/
  778. 4 && input0.value !== /*siteName*/
  779. ctx2[2]) {
  780. set_input_value(
  781. input0,
  782. /*siteName*/
  783. ctx2[2]
  784. );
  785. }
  786. if (dirty & /*siteLink*/
  787. 8 && input1.value !== /*siteLink*/
  788. ctx2[3]) {
  789. set_input_value(
  790. input1,
  791. /*siteLink*/
  792. ctx2[3]
  793. );
  794. }
  795. if (dirty & /*isActiveAddDialog*/
  796. 2) {
  797. toggle_class(
  798. div13,
  799. "active",
  800. /*isActiveAddDialog*/
  801. ctx2[1]
  802. );
  803. }
  804. if (dirty & /*isActiveKuaiTiao*/
  805. 1) {
  806. toggle_class(
  807. div14,
  808. "active",
  809. /*isActiveKuaiTiao*/
  810. ctx2[0]
  811. );
  812. }
  813. },
  814. i: noop,
  815. o: noop,
  816. d(detaching) {
  817. if (detaching) {
  818. detach(div14);
  819. }
  820. for (let i2 = 0; i2 < each_blocks.length; i2 += 1) {
  821. each_blocks[i2].d();
  822. }
  823. mounted = false;
  824. run_all(dispose);
  825. }
  826. };
  827. }
  828. function instance($$self, $$props, $$invalidate) {
  829. const generateRandomString = (length) => {
  830. let result = "";
  831. let characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  832. let charactersLength = characters.length;
  833. for (var i2 = 0; i2 < length; i2++) {
  834. result += characters.charAt(Math.floor(Math.random() * charactersLength));
  835. }
  836. return result;
  837. };
  838. let isActiveKuaiTiao = false;
  839. let isActiveAddDialog = false;
  840. let siteName = "";
  841. let siteLink = "";
  842. let sitesGrid = [];
  843. let sitesMap = {};
  844. let dragoverTime = 0;
  845. const handlerKeydown = u({
  846. "Control+q": () => {
  847. $$invalidate(0, isActiveKuaiTiao = !isActiveKuaiTiao);
  848. }
  849. });
  850. window.addEventListener("keydown", handlerKeydown);
  851. const getSvgCode = (data) => {
  852. return decodeURIComponent(data).replace(/https?\:\/\/.+\/assets\//, "");
  853. };
  854. const renderSiteGrids = () => {
  855. $$invalidate(4, sitesGrid = _GM_listValues().map((key, index) => {
  856. const group = _GM_getValue(key);
  857. const data = {
  858. name: group.name,
  859. link: group.link,
  860. key: group.key
  861. };
  862. sitesMap[key] = data;
  863. return data;
  864. }));
  865. };
  866. const fnAddSite = () => {
  867. if (sitesGrid.length < 100) {
  868. const siteKey = generateRandomString(10);
  869. _GM_setValue(siteKey, {
  870. name: siteName,
  871. link: siteLink,
  872. key: siteKey
  873. });
  874. $$invalidate(2, siteName = "");
  875. $$invalidate(3, siteLink = "");
  876. $$invalidate(1, isActiveAddDialog = false);
  877. renderSiteGrids();
  878. } else {
  879. alert("常用导航熟练不能超过100个");
  880. }
  881. };
  882. const fnDelSite = (siteKey) => {
  883. _GM_deleteValue(siteKey);
  884. renderSiteGrids();
  885. };
  886. let draggedElement = null;
  887. document.addEventListener("click", function(e2) {
  888. const kuaitiaoElement = e2.target.closest(".kuaitiao");
  889. if (!kuaitiaoElement) {
  890. $$invalidate(0, isActiveKuaiTiao = false);
  891. }
  892. });
  893. document.addEventListener("dragstart", function(e2) {
  894. draggedElement = e2.target.closest(".box");
  895. });
  896. document.addEventListener("dragover", function(e2) {
  897. e2.preventDefault();
  898. const nowMs = Date.now();
  899. if (nowMs - dragoverTime > 100) {
  900. dragoverTime = nowMs;
  901. document.querySelectorAll(".box .inner").forEach((el) => {
  902. el.closest(".inner").classList.remove("move");
  903. });
  904. const boxInnerEl = e2.target.closest(".inner");
  905. if (boxInnerEl) {
  906. boxInnerEl.classList.add("move");
  907. }
  908. }
  909. });
  910. document.addEventListener("drop", function(e2) {
  911. e2.preventDefault();
  912. const boxEl = e2.target.closest(".box");
  913. if (boxEl) {
  914. document.querySelectorAll(".box .inner").forEach((el) => {
  915. el.closest(".inner").classList.remove("move");
  916. });
  917. const siteKeyOld = draggedElement.dataset.key;
  918. const siteKeyNew = boxEl.dataset.key;
  919. if (siteKeyOld === siteKeyNew) return;
  920. const siteIndexOld = Number(draggedElement.dataset.index);
  921. const siteIndexNew = Number(boxEl.dataset.index);
  922. const siteItemOld = sitesMap[siteKeyOld];
  923. const siteItemNew = sitesMap[siteKeyNew];
  924. const sitesGrid2 = [];
  925. for (let item of sitesGrid) {
  926. if (item.key !== siteKeyOld) {
  927. if (siteIndexOld > siteIndexNew) {
  928. if (item.key !== siteKeyNew) {
  929. sitesGrid2.push(item);
  930. } else {
  931. sitesGrid2.push(siteItemOld);
  932. sitesGrid2.push(siteItemNew);
  933. }
  934. } else {
  935. if (item.key !== siteKeyOld) {
  936. sitesGrid2.push(item);
  937. if (item.key === siteKeyNew) {
  938. sitesGrid2.push(siteItemOld);
  939. }
  940. }
  941. }
  942. }
  943. }
  944. sitesGrid2.map((item) => {
  945. _GM_deleteValue(item.key);
  946. });
  947. sitesGrid2.map((item) => {
  948. _GM_setValue(item.key, item);
  949. });
  950. $$invalidate(4, sitesGrid = sitesGrid2);
  951. }
  952. });
  953. renderSiteGrids();
  954. const click_handler = () => $$invalidate(0, isActiveKuaiTiao = false);
  955. const click_handler_1 = () => $$invalidate(1, isActiveAddDialog = !isActiveAddDialog);
  956. function input0_input_handler() {
  957. siteName = this.value;
  958. $$invalidate(2, siteName);
  959. }
  960. function input1_input_handler() {
  961. siteLink = this.value;
  962. $$invalidate(3, siteLink);
  963. }
  964. return [
  965. isActiveKuaiTiao,
  966. isActiveAddDialog,
  967. siteName,
  968. siteLink,
  969. sitesGrid,
  970. getSvgCode,
  971. fnAddSite,
  972. fnDelSite,
  973. click_handler,
  974. click_handler_1,
  975. input0_input_handler,
  976. input1_input_handler
  977. ];
  978. }
  979. class App extends SvelteComponent {
  980. constructor(options) {
  981. super();
  982. init(this, options, instance, create_fragment, safe_not_equal, {});
  983. }
  984. }
  985. new App({
  986. target: (() => {
  987. const app = document.createElement("div");
  988. document.body.append(app);
  989. return app;
  990. })()
  991. });
  992.  
  993. })();

QingJ © 2025

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