|
- // ==UserScript==
- // [url=home.php?mod=space&uid=47252]@name[/url] for125_2
- // [url=home.php?mod=space&uid=158809]@Namespace[/url] http://tampermonkey.net/
- // [url=home.php?mod=space&uid=59980]@Version[/url] 0.2
- // @description try to take over the world!
- // @author shennv
- // @match https://bbs.125.la/*
- // [url=home.php?mod=space&uid=585119]@grant[/url] none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Your code here...
- function gradientColor(startClr, endClr, step) {
- var startR = startClr >> 16 & 255;
- var startG = startClr >> 8 & 255;
- var startB = startClr & 255;
- var endR = endClr >> 16 & 255;
- var endG = endClr >> 8 & 255;
- var endB = endClr & 255;
- var sR = endR - startR;
- var sG = endG - startG;
- var sB = endB - startB;
- //console.log('' + sR + '-' + sG + '-' + sB);
- var arrClr = [];
- for (var i = 0; i <= step; i++) arrClr.push(startR + sR * i / step << 16 | startG + sG * i / step << 8 | startB + sB * i / step);
- return arrClr;
- }
- function fullHex(value) {
- var map = '000000';
- var temp = value.toString(16);
- var len = temp.length;
- if (len < 6) temp = '000000'.substr(len - 6) + temp;
- return temp;
- }
- $("vfastpostform").submit = function() {
- var str = $('vmessage').value;
- var len = str.length;
- var arrClr = gradientColor(0xff00ff, 0xff00, len);
- var str2 = '';
- for (var i = 0; i < len; i++) {
- str2 += '[color=#' + fullHex(arrClr[i]) + ']' + str.substr(i, 1) + '[/color]';
- }
- $('fastpostmessage').value = str2;
- $('fastpostform').submit();
- }
- })();
复制代码 回帖在快速回复栏目的话自动变成渐变色,效果在评论区
|
评分
-
查看全部评分
|