youtube-danmaku

Youtube livechat danmaku

当前为 2020-11-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name youtube-danmaku
  3. // @namespace https://github.com/IronKinoko/ytb-danmaku
  4. // @version 2.1.2
  5. // @license MIT
  6. // @description Youtube livechat danmaku
  7. // @author Ironkinoko
  8. // @match https://www.youtube.com/*
  9. // @exclude https://www.youtube.com/live_chat*
  10. // @grant none
  11. // @require https://cdn.jsdelivr.net/npm/comment-core-library-html-comment@1.0.0/dist/CommentCoreLibrary.js
  12. // @require https://cdn.jsdelivr.net/gh/IronKinoko/ytb-danmaku@40a0272542e9b8627b57650d4045d81873b68527/dist/ytb-danmaku-core.min.js
  13. // ==/UserScript==
  14.  
  15. ;(function () {
  16. 'use strict'
  17. const style = document.createElement('style')
  18. style.innerHTML =
  19. ".danmaku-container{border:0;bottom:0;display:block;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0;touch-callout:none;-webkit-transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.danmaku-container .cmt{pointer-events:none;color:#fff;font-family:SimHei,SimSun,Heiti,'MS Mincho',Meiryo,'Microsoft YaHei',monospace;font-size:25px;letter-spacing:0;line-height:100%;margin:0;padding:3px 0 0 0;position:absolute;text-decoration:none;text-shadow:-1px 0 #000,0 1px #000,1px 0 #000,0 -1px #000;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;white-space:pre;word-break:keep-all}.danmaku-container .cmt.no-shadow{text-shadow:none}.danmaku-container .cmt.reverse-shadow{text-shadow:-1px 0 #fff,0 1px #fff,1px 0 #fff,0 -1px #fff}.danmaku-container .cmt.css-optimize{will-change:transform} .cmt.css-optimize img{width:24px;height:24px;}"
  20. document.head.append(style)
  21. })()