IDK

Adds a stylish button to the page that redirects you to a Rickroll link when clicked

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Joshua Francisco
今日安裝
0
安裝總數
7
評價
0 0 0
版本
3.5
建立日期
2024-02-07
更新日期
2024-02-07
尺寸
2.2 KB
授權條款
未知
腳本執行於
所有網站

// ==UserScript==
// @name RICKROLL
// @namespace http://tampermonkey.net/
// @version 3.5
// @description Adds a stylish button to the page that redirects you to a Rickroll link when clicked
// @author Joshua
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==

(function() {
'use strict';

function redirectToRickroll() {
window.location.href = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
}

// Check if the current page URL is the Rickroll link
if (window.location.href !== 'https://www.youtube.com/watch?v=dQw4w9WgXcQ') {
console.log('Creating button...');
var button = document.createElement('button');
button.textContent = 'Click here for a surprise!';
button.style.position = 'fixed';
button.style.top = '50%';
button.style.left = '50%';
button.style.transform = 'translate(-50%, -50%)';
button.style.zIndex = '9999';
button.style.padding = '15px 30px';
button.style.border = 'none';
button.style.backgroundColor = '#ff0000';
button.style.color = '#ffffff';
button.style.fontFamily = 'Arial, sans-serif';
button.style.fontSize = '18px';
button.style.fontWeight = 'bold';
button.style.borderRadius = '10px';
button.style.boxShadow = '0px 4px 8px rgba(0, 0, 0, 0.3)';
button.style.cursor = 'pointer';
button.style.transition = 'transform 0.2s, box-shadow 0.2s';

button.addEventListener('mouseenter', function() {
button.style.transform = 'translate(-50%, -50%) scale(1.05)';
button.style.boxShadow = '0px 8px 16px rgba(0, 0, 0, 0.3)';
});

button.addEventListener('mouseleave', function() {
button.style.transform = 'translate(-50%, -50%)';
button.style.boxShadow = '0px 4px 8px rgba(0, 0, 0, 0.3)';
});

button.addEventListener('click', function(event) {
event.preventDefault(); // Prevent default button click action
redirectToRickroll(); // Redirect to the Rickroll link
button.remove(); // Remove the button
});

console.log('Appending button to document...');
document.body.appendChild(button);
console.log('Button creation complete.');
}

// Additional information
console.log('IDK script loaded.');

// Usage instructions
console.log('To use this script, simply click on the "Click here for a surprise!" button that appears on the page.');

// Changelog
console.log('Changelog:');
console.log('Version 3.5:');
console.log('- Added stylish button with improved design.');

// End of script
})();