🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/14 07:10:07
🔄 下次更新时间:2026/01/14 08:10:07
手动刷新缓存

Dadafacer

Enjoy the pleasures of chaotic browsing

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name        Dadafacer
// @namespace   414c45.net
// @description Enjoy the pleasures of chaotic browsing
// @include     *
// @version     1
// @grant       none
// ==/UserScript==

/*
  Dadafacer
  Copyright (c) 2014 Ale
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation, version 2.1.
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA 02111-1307 USA
*/

var html     = document.getElementsByTagName('html')[0],
    doc      = document.documentElement,
    body     = html.getElementsByTagName('body')[0],
    elements = document.getElementsByTagName('div'),
    n        = elements.length;

//Setting up angle variations for each DOM element
var angles   = new Array(n);
for(var i = 0; i < n; i++) angles[i] = Math.random() - .5;            

//Dealing with crossbrowsing issues
var vendors = [
  'transform',
  'OTransform',
  'msTransform',
  'MozTransform',
  'WebkitTransform'
];

/**
 *  Define functions
 */

//Explode everything with care
function destroy()
{
   for(var i = 0; i < n; i++)
   {
       if(elements[i].tagName== 'body' || elements[i].tagName== 'ubershit') continue;
       //JQuery's crossbrowsing way of retrieving window's scroll top
       var top = (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0);
       var a = Math.floor(angles[i] * top);
       for (var v = 0; v < vendors.length; v++)
           elements[i].style[ vendors[v] ] = 'rotate('+a+'deg)';
   }      
}

//Redirect after text selection using 'I'm feeling ducky' option of DuckDuckGo
function redirect()
{
     var txt = window.getSelection().toString();
     if(txt)   window.location.href = "http://duckduckgo.com/?q=" + txt + " !";   
}

//Search a random element in current view
function search()
{
   var index = Math.floor( Math.random() * n );
   var rect  = elements[index].getBoundingClientRect();
   window.scrollTo(rect.left, rect.top);   
}

/**
 *  Add new elements to DOM
 */

//Title 
var title = document.createElement('ubershit');
title.innerHTML = 'Dadafacer';
title.setAttribute('style', 'background: #111; position: fixed; top: 20px; left: 20px; padding: 10px; color: yellow; font-family: monospace; letter-spacing: 2px; font-size: 10px; font-weight: bold; z-index: 101010;');
body.appendChild(title);
//Search button
var button = document.createElement('ubershit');
button.innerHTML = 'Enjoy chaos. Scroll to destroy. Click here to move. Select text to go.';
button.setAttribute('id', 'button');
button.setAttribute('style', 'background: yellow; position: fixed; top: 50px; left: 20px; padding: 10px; color: #111; font-family: monospace; letter-spacing: 2px; font-size: 10px; z-index: 101010;');
body.appendChild(button);


/**
 *  Customize style
 */

//Cursor
html.style.cursor = 'crosshair';


/**
 *  Bind events
 */

window.addEventListener('scroll', destroy, true);
body.addEventListener('mouseup', redirect, true);
button.addEventListener('click', search, true);