您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds button to redirect OnlyFans,Fansly,Candfans to Coomer with enhancement
当前为
- // ==UserScript==
- // @name FanPass Btn
- // @version 1.1
- // @description Adds button to redirect OnlyFans,Fansly,Candfans to Coomer with enhancement
- // @namespace https://greasyfork.org/en/users/1333430
- // @match https://onlyfans.com/*
- // @match https://coomer.su/*
- // @match https://fansly.com/*
- // @match https://candfans.jp/*
- // @grant GM_openInTab
- // ==/UserScript==
- (function() {
- 'use strict';
- // Function to handle redirection
- function redirect(username, service) {
- const coomerUrl = `https://coomer.su/${service}/user/${username}`;
- GM_openInTab(coomerUrl, { active: true });
- }
- function createRedirectButton(username, service) {
- const button = document.createElement('button');
- button.innerHTML = `<img src="https://coomer.su/favicon.ico" style="width: 24px; height: 24px; display: block; margin: auto;">`;
- button.className = 'redirect-button';
- button.addEventListener('click', () => redirect(username, service));
- document.body.appendChild(button);
- }
- // Add styles for the button and main content adjustment
- const style = document.createElement('style');
- style.textContent = `
- .redirect-button {
- position: fixed;
- top: 20px;
- right: 20px;
- z-index: 9999;
- border: none;
- border-radius: 50%;
- background-color: rgba(105, 105, 105, 0.7);
- width: 50px;
- height: 50px;
- padding: 10px;
- box-sizing: border-box;
- cursor: pointer;
- }
- /* Adjust main content area after removing sidebar */
- .shifted.content-wrapper.full-width {
- width: 100% !important;
- margin-left: 0 !important;
- }
- /* Add rounded corners to post cards */
- .post-card {
- border-radius: 10px !important;
- overflow: hidden; /* Ensure content doesn't overflow the rounded corners */
- }
- /* Pop-out effect on hover for images */
- .post-card__image-container {
- overflow: visible; /* Allow the image to pop out beyond the container */
- }
- .post-card__image {
- transition: transform 0.3s ease, box-shadow 0.3s ease;
- }
- .post-card__image-container:hover .post-card__image {
- transform: scale(1.1); /* Scale image to 110% */
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- }
- /* Make post-card--preview 20% larger and add gap */
- .post-card.post-card--preview {
- transform: scale(1.2); /* Scale element to 120% */
- margin: 20px; /* Add larger gap between elements */
- transition: transform 0.3s ease, box-shadow 0.3s ease;
- backface-visibility: hidden;
- perspective: 1000px;
- }
- .post-card.post-card--preview:hover {
- transform: scale(1.3); /* Scale element to 130% on hover */
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- }
- /* Hide ads and banners */
- .ad-banner, .ad-container, .banner, .advertisement {
- display: none !important;
- }
- /* Style for the sticky navigation bar */
- .post__nav-links {
- position: sticky;
- top: 50%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- z-index: 1000;
- transform: translateY(-50%);
- }
- .post__nav-item {
- flex: 1;
- text-align: center;
- font-size: 130%; /* Make the text 30% larger */
- }
- .post__nav-item.subtitle {
- font-size: 130%; /* Make the text 30% larger */
- }
- .post__nav-item a {
- text-decoration: none;
- color: inherit;
- font-size: 130%; /* Make the text 30% larger */
- }
- .post__nav-item.previous {
- position: absolute;
- left: 20%;
- }
- .post__nav-item.next {
- position: absolute;
- right: 20%;
- }
- .glow {
- animation: glow 1.5s infinite alternate;
- }
- @keyframes glow {
- 0% {
- text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff00ff, 0 0 25px #ff00ff, 0 0 30px #ff00ff, 0 0 35px #ff00ff;
- }
- 55% {
- text-shadow: 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #fff, 0 0 25px #ff00ff, 0 0 30px #ff00ff, 0 0 35px #ff00ff, 0 0 40px #ff00ff;
- }
- 100% {
- text-shadow: 0 0 15px #fff, 0 0 25px #fff, 0 0 35px #fff, 0 0 45px #ff00ff, 0 0 55px #ff00ff, 0 0 65px #ff00ff, 0 0 75px #ff00ff;
- }
- }
- `;
- document.head.appendChild(style);
- function hideSidebar() {
- const sidebar = document.querySelector('.global-sidebar');
- if (sidebar) {
- sidebar.remove();
- }
- }
- function removeMatrixBanner() {
- const matrixBanner = document.querySelector('a[href="https://coomer.su/matrix"]');
- if (matrixBanner) {
- matrixBanner.remove();
- }
- }
- function moveNavElement() {
- const navElement = document.querySelector('.post__nav-links');
- const postBodyElement = document.querySelector('.post__body');
- if (navElement && postBodyElement) {
- const previousItem = navElement.querySelector('.post__nav-link.prev');
- if (previousItem) {
- previousItem.innerHTML = '←';
- previousItem.parentElement.classList.add('previous', 'glow');
- }
- const nextItem = navElement.querySelector('.post__nav-link.next');
- if (nextItem) {
- nextItem.innerHTML = '→';
- nextItem.parentElement.classList.add('next', 'glow');
- }
- postBodyElement.insertBefore(navElement, postBodyElement.firstChild);
- }
- }
- if (window.location.href.includes('onlyfans.com')) {
- const profileMatch = window.location.href.match(/https:\/\/onlyfans.com\/([^/]+)/);
- if (profileMatch) {
- const username = profileMatch[1];
- createRedirectButton(username, 'onlyfans');
- }
- }
- if (window.location.href.includes('fansly.com')) {
- (async () => {
- let userID = null;
- const profileMatch = window.location.href.match(/https:\/\/fansly.com\/([^/]+)/);
- if (profileMatch) {
- const userName = profileMatch[1];
- if (userName) {
- const res = await fetch(`https://apiv3.fansly.com/api/v1/account?usernames=${userName}&ngsw-bypass=true`);
- const data = await res.json();
- userID = data?.response?.[0]?.id ?? null;
- }
- if (userID) {
- createRedirectButton(userID, 'fansly');
- }
- }
- })();
- }
- if (window.location.href.includes('candfans.jp')) {
- const processedUserIds = new Set();
- const observer = new MutationObserver(() => {
- document.querySelectorAll('img[data-src]').forEach((imgElement) => {
- const userID = imgElement.getAttribute('data-src')?.match(/user\/(\d+)\//)?.[1];
- if (userID && !processedUserIds.has(userID)) {
- createRedirectButton(userID, 'candfans');
- processedUserIds.add(userID);
- }
- });
- });
- observer.observe(document.body, { childList: true, subtree: true });
- }
- if (window.location.href.includes('coomer.su')) {
- removeMatrixBanner();
- if (window.location.href.includes('coomer.su/onlyfans/user') ||
- window.location.href.includes('coomer.su/fansly/user') ||
- window.location.href.includes('coomer.su/candfans/user')) {
- hideSidebar();
- const mainContent = document.querySelector('.shifted.content-wrapper');
- if (mainContent) {
- mainContent.classList.add('full-width');
- }
- const imageContainers = document.querySelectorAll('.post-card.post-card--preview');
- imageContainers.forEach(container => {
- container.style.transform = 'scale(1.2)';
- container.style.margin = '20px';
- container.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';
- container.style.backfaceVisibility = 'hidden';
- container.style.perspective = '1000px';
- container.addEventListener('mouseover', () => {
- container.style.transform = 'scale(1.3)';
- container.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.2)';
- });
- container.addEventListener('mouseout', () => {
- container.style.transform = 'scale(1.2)';
- container.style.boxShadow = 'none';
- });
- });
- }
- }
- window.addEventListener('load', () => {
- const links = document.querySelectorAll('a.image-link');
- links.forEach(link => {
- link.addEventListener('click', (event) => {
- event.preventDefault();
- window.open(link.href, '_blank');
- });
- });
- moveNavElement();
- });
- })();