Skip to content

logo replace with cute, random anime GIF by jxchu

Screenshot of logo replace with cute, random anime GIF

Details

Authorjxchu

LicenseNo License

Categoryuserstyles.world

Created

Updated

Size1.7 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

FOR SOUNDCLOUDD BTW

Notes

tampermonkey version (works better (kinda))
// ==UserScript==
// @name replace sc logo with cute random anime gif
// @namespace http://your.namespace/
// @version 1.0
// @description make it pretty ig
// @author jxchu_luv
// @match https://soundcloud.com/*
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Function to replace the logos
function replaceLogo() {
    // Select all target elements except the excluded ones
    var elements = document.querySelectorAll('.header__logoLink, .header__logoLink-iconOnly, .sc-border-box, .sc-ir:not(.playbackTimeline__timePassed):not(.sc-text-primary):not(.sc-text-h5):not(.custom-cursor-default-hover):not(.shuffleControl):not(.skipControl):not(.playControl):not(.volume__button):not(.headerSearch__submit):not(.header__moreButton):not(.repeatControl):not(.m-none)');

    elements.forEach(function(element) {
        // Set the dimensions to match the original SoundCloud logo
        element.style.width = '102px';
        element.style.height = '45px';

        // Apply the background image (new GIF) and adjust background settings
        element.style.backgroundImage = 'url("https://i.pinimg.com/originals/1b/3f/7c/1b3f7c4653ca8bef2b2336e091521cf0.gif")';
        element.style.backgroundSize = 'cover';
        element.style.backgroundRepeat = 'no-repeat';

        // Hide any default SVG icons inside the element
        var svgIcon = element.querySelector('svg');
        if (svgIcon) {
            svgIcon.style.display = 'none';
        }
    });
}

// Observe changes in the DOM to apply the changes when the elements become available
const observer = new MutationObserver(function(mutations) {
    mutations.forEach(function() {
        replaceLogo();
    });
});

// Start observing the body for changes in the DOM
observer.observe(document.body, { childList: true, subtree: true });

// Run the function on page load as well
window.addEventListener('load', replaceLogo);

})();

Source code

/* ==UserStyle==
@name         Replace SoundCloud Logo with GIF (Size 103x45)
@namespace    http://tampermonkey.net/
@version      1.1
@description  Replace SoundCloud logo with custom GIF, overlay the GIF on the original logo, set size to 103x45 to match original logo
@match        https://soundcloud.com/*
@grant        none
==/UserStyle== */

@-moz-document url-prefix("https://soundcloud.com/") {
    /* Target the logo elements and apply new styles */
    .header__logoLink, 
    .header__logoLink-iconOnly, 
    .sc-border-box, 
    .sc-ir:not(.playbackTimeline__timePassed):not(.sc-text-primary):not(.sc-text-h5):not(.custom-cursor-default-hover):not(.shuffleControl):not(.skipControl):not(.playControl):not(.volume__button):not(.headerSearch__submit):not(.header__moreButton):not(.repeatControl):not(.m-none) {
        position: relative;
        width: 102px !important;
        height: 45px !important;
    }

    /* Add a GIF overlay as a pseudo-element */
    .header__logoLink::after, 
    .header__logoLink-iconOnly::after, 
    .sc-border-box::after, 
    .sc-ir::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 102px;
        height: 45px;
        background-image: url("https://i.pinimg.com/originals/1b/3f/7c/1b3f7c4653ca8bef2b2336e091521cf0.gif");
        background-size: cover;
        background-repeat: no-repeat;
        pointer-events: none; /* Ensure the overlay doesn't interfere with clicks */
    }

    /* Hide any SVG icons inside the logo link */
    .header__logoLink svg, 
    .header__logoLink-iconOnly svg {
        display: none !important; /* Ensures that SVG logos do not appear under the GIF */
    }
}

Reviews

No reviews yet.