Adds a fixed header element for use by other scripts
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/18233/160323/Window%20floating%20container.js
// ==UserScript==
// @name Window floating container
// @version 1.1.0
// @description Adds a fixed header element for use by other scripts
// @author @_jnblog
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
// @grant GM_addStyle
// ==/UserScript==
/* jshint -W097 */
/* global $ */
/* jshint asi: true, multistr: true */
'use strict'
var ijgFloater = $('#ijgWindowFloater')
if (!ijgFloater.length) {
GM_addStyle('#ijgWindowFloater {\
position: fixed;\
top: 32px;\
left: 0;\
z-index: 2000;\
color: white;\
background-color: #EB6841;\
}\
#ijgWindowFloater a {\
color: white !important;\
padding: 5px;\
display: inline-block;\
}\
#ijgWindowFloater a:hover {\
color: #FAF667 !important;\
}\
.ijgWindowFloater-item {\
display: none;\
}\
.ijgWindowFloater-item + .ijgWindowFloater-item {\
padding-left: 1em;\
}\
.ijgWindowFloater-toggle {\
padding: 0;\
top: -1px;\
left: -22px;\
box-shadow: inset 0 0 0 32px;\
-webkit-transform-origin: right;\
-ms-transform-origin: right;\
transform-origin: right;\
transform: rotate(180deg);\
display: inline-block;\
vertical-align: middle;\
position: relative;\
font-style: normal;\
color: transparent;\
text-align: left;\
text-indent: -9999px;\
direction: ltr;\
box-sizing: border-box;\
border: 2px solid white;\
transition: all .2s;\
border-radius: 50%;\
width: 24px;\
height: 24px;\
margin: 2px;\
background-color: transparent;\
}\
.ijgWindowFloater-toggle:before {\
content: "";\
width: 14px;\
height: 2px;\
position: absolute;\
bottom: 0;\
margin: auto 0;\
box-shadow: inset 0 0 0 32px;\
-webkit-transform-origin: right;\
-ms-transform-origin: right;\
transform-origin: right;\
top: 2px;\
-webkit-transform: rotate(45deg);\
-ms-transform: rotate(45deg);\
transform: rotate(45deg);\
pointer-events: none;\
width: 9px;\
right: 6px;\
color: white;\
}\
.ijgWindowFloater-toggle:after {\
content: "";\
height: 2px;\
position: absolute;\
bottom: 0;\
margin: auto 0;\
box-shadow: inset 0 0 0 32px;\
-webkit-transform-origin: right;\
-ms-transform-origin: right;\
transform-origin: right;\
top: 0;\
-webkit-transform: rotate(-45deg);\
-ms-transform: rotate(-45deg);\
transform: rotate(-45deg);\
pointer-events: none;\
width: 9px;\
right: 6px;\
color: white;\
}\
.ijgWindowFloater-toggle.ijg-is-closed:before {\
top: 12px;\
right: 7px;\
}\
.ijgWindowFloater-toggle.ijg-is-closed:after {\
top: -10;\
right: 7px;\
}')
ijgFloater = $('<div id="ijgWindowFloater"><i class="ijgWindowFloater-toggle"></i></div>')
$('body').prepend(ijgFloater)
}
function getFloater() {
return ijgFloater
}