// ==UserScript== // @name chika chika cc // @description C4 blink // @include http://* // @include https://* // ==/UserScript== /* * @title chika chika cc * @description C4 blink * @include http://* * @include https://* * @contributor chanchihiro http://let.hatelabo.jp/chanchihiro/let/hJmeu_TFhvoK (Fork of) * @license MIT License https://opensource.org/licenses/MIT * @javascript_url */ // smart blinking by hitode909 c.f. // http://hitode909.hatenablog.com/entry/2012/11/17/110000 // http://let.hatelabo.jp/hitode909/let/gYC-yuG7p7bWEg // e.g. // http://let.hatelabo.jp (function () { 'use strict'; var slice = Array.prototype.slice; var divs = slice.call(document.body.querySelectorAll('div')); var spinee = divs[Math.floor(Math.random() * divs.length)]; var msg_board = divs[Math.floor(Math.random() * divs.length)]; var degree = 0; var spin = function () { degree -= 1; spinee.style.transform = 'rotate(' + degree + 'deg' + ')'; }; var chancge_color = function () { var hex_color = '#' + ('00000' + Math.floor(Math.random() * 0x1000000) .toString(16)).slice(-6); document.body.style.background = hex_color; }; setInterval(spin, 10); setInterval(chancge_color, 50); var random_text = function (len) { var random_string = ''; while (random_string.length < len) { random_string += Math.random().toString(36).slice(2); } return random_string.slice(0, len); }; // TBD appendChild or replace textContent msg_board.innerHTML = '