r34init

r34fix

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/502404/1421028/r34init.js

  1. // ==UserScript==
  2. // @name r34init
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-08-01
  5. // @description r34fix
  6. // @author You
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10.  
  11. function initKVSPlayTrailer() {
  12. console.log('init start')
  13. var n, r, c, e = /iphone|ipad|Android|webOS|iPod|BlackBerry|Windows Phone/gi.test(navigator.appVersion), o = 0;
  14. function l(e) {
  15. var i, s = e, e = s.find("video"), o = s.find("img");
  16. e.length ? (e.get(0).play(),
  17. o.hide()) : ($(".js-swipe").hide(),
  18. i = $('<div class="preview-progress"></div>'),
  19. s.append(i),
  20. setTimeout(function() {
  21. i.addClass("is-full")
  22. }),
  23. n = setTimeout(function() {
  24. var e = s.attr("data-preview")
  25. , t = (s.attr("data-subtitles"),
  26. $('<video autoplay loop muted playsinline src="' + e + '"></video>'));
  27. function a() {
  28. s.append(t),
  29. t.get(0).play(),
  30. o.hide(),
  31. i.remove()
  32. }
  33. r = setTimeout(function() {
  34. 0 < t.get(0).readyState ? a() : c = setInterval(function() {
  35. 0 < t.get(0).readyState && (a(),
  36. clearInterval(c))
  37. }, 0)
  38. }, 0)
  39. }, 0))
  40. }
  41. e ? $("body").find("[data-preview]").swipe({
  42. swipeLeft: function(e, t, a, i, s) {
  43. clearTimeout(n),
  44. clearTimeout(r),
  45. clearInterval(c);
  46. $(this).find("img");
  47. o++,
  48. $("[data-preview]").each(function(e) {
  49. var t = $(this)
  50. , a = t.find("video");
  51. a.length && (a.get(0).remove(),
  52. $("img").show()),
  53. t.find(".preview-progress").remove()
  54. }),
  55. 1 < o ? ($(this).find("video").eq(0).length && ($(this).find("video").get(0).remove(),
  56. $("img").show()),
  57. o = 0) : l($(this))
  58. },
  59. swipeRight: function(e, t, a, i, s) {
  60. clearTimeout(n),
  61. clearTimeout(r),
  62. clearInterval(c);
  63. $(this).find("img");
  64. o++,
  65. $("[data-preview]").each(function(e) {
  66. var t = $(this)
  67. , a = t.find("video");
  68. a.length && (a.get(0).remove(),
  69. $("img").show()),
  70. t.find(".preview-progress").remove()
  71. }),
  72. 1 < o ? ($(this).find("video").eq(0).length && ($(this).find("video").get(0).remove(),
  73. $("img").show()),
  74. o = 0) : l($(this))
  75. },
  76. preventDefaultEvents: !1,
  77. threshold: 80
  78. }) : $("body").on("mouseenter", "[data-preview]", function() {
  79. l($(this))
  80. }).on("mouseleave", "[data-preview]", function() {
  81. clearTimeout(n),
  82. clearTimeout(r),
  83. clearInterval(c);
  84. var e = $(this);
  85. e.find("img").show();
  86. var t = e.find("video");
  87. t.length && t.get(0).remove(),
  88. e.find(".preview-progress").remove()
  89. })
  90. }

QingJ © 2025

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