Twitter - Match username with user color

Change the color of the username to match with the desired user color

目前为 2016-03-10 提交的版本。查看 最新版本

// ==UserScript==
// @name           Twitter - Match username with user color
// @copyright      hzmen1 <[email protected]>
// @version        3.1.1
// @namespace      https://gf.qytechs.cn/users/11517
// @homepageURL    https://gf.qytechs.cn/scripts/9952
// @description    Change the color of the username to match with the desired user color
// @match          *://twitter.com/*
// @include        /^https?://twitter.com
// @grant          none
// @author         hzmen1
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @license        (CC) by-nc-sa 3.0
// @run-at         document-end
// ==/UserScript==

setInterval(function(){someFunction();},175);

function someFunction(){
var k=$(".u-textUserColor").css('color');

jQuery.fn.brightness=function(){var t,r,e;if(t=this.css("color"),null!=t&&t.length){if(r=t.match(/^rgb(?:a)?\(([0-9]{1,3}),\s([0-9]{1,3}),\s([0-9]{1,3})(?:,\s)?([0-9]{1,3})?\)$/),null!=r){if("0"!==r[4])return e=2.99*r[1]+5.87*r[2]+1.14*r[3],245>e?"dark":"light";if(this.parent().length)return this.parent().brightness()}}else if(this.parent().length)return this.parent().brightness()};var damn=jQuery(".u-textUserColor").brightness();

$('.ProfileHeaderCard-nameLink,.ProfileNameTruncated-link').each(function(){$(this).removeClass('u-textInheritColor');});
$('.ProfileHeaderCard-location,.DashboardProfileCard-name,.Icon--person,.PhotoRail-heading,.ProfileHeaderCard-joinDate,.ProfileHeaderCard-url,.ProfileHeaderCard-birthdate,.ProfileHeaderCard-vineProfile,.ProfileNameTruncated-link,.stream-end,.back-to-top,.player-container,.Icon--mediaplay,.OldMedia-attributionName,.Icon--verified,.Icon--protected,.Icon--translator,.twitter-atreply,.twitter-hashtag,.GridTimeline-footerIcon,.permalink .stream-end .Icon--logo,.GalleryNav-handle').each(function(){$(this).addClass('u-textUserColor');}
);
$('.avatar,.ProfileAvatar,.hovercard.profile-card .ProfileCard-avatarImage,.DashboardProfileCard-avatarImage,.DMAvatar-image,.ProfileCard-avatarImage').each(function(){$(this).addClass('u-borderUserColor');});
  
$('.PermalinkOverlay-spinner,.DMSpinner,.show-more-spinner,#trend-locations-loading,.DMConversation-spinner,.DMInbox-spinner,.pushstate-spinner,.spinner-bigger,.stream-end-inner .spinner,.GridTimeline .has-more-items .spinner').each(function(){$(this).css({"border-left-color":k});});

$('.ProfileNameTruncated-link').addClass('bypassuser');
$('.ProfileNameTruncated-link').removeClass('ProfileNameTruncated-link');

$('.util-link-complex-target').removeClass('util-link-complex-target');
    
$('.twitter-atreply').removeClass('pretty-link');
$('.twitter-hashtag').removeClass('pretty-link');
    
if(damn=="dark"){$('a,.btn-link,.btn-link:focus,.icon-btn,.pretty-link b,.pretty-link:hover s,.pretty-link:hover b,.pretty-link:focus s,.pretty-link:focus b,.metadata a:hover,.metadata a:focus,.account-group:hover .fullname,.account-group:focus .fullname,.account-summary:focus .fullname,.message .message-text a,.stats a strong,.plain-btn:hover,.plain-btn:focus,.dropdown.open .user-dropdown.plain-btn,.open > .plain-btn,#global-actions .new:before,.module .list-link:hover,.module .list-link:focus,.UserCompletion-step:hover,.stats a:hover,.stats a:hover strong,.stats a:focus,.stats a:focus strong,.profile-modal-header .fullname a:hover,.profile-modal-header .username a:hover,.profile-modal-header .fullname a:focus,.profile-modal-header .username a:focus,.find-friends-sources li:hover .source,.stream-item a:hover .fullname,.stream-item a:focus .fullname,.stream-item .view-all-supplements:hover,.stream-item .view-all-supplements:focus,.tweet .time a:hover,.tweet .time a:focus,.tweet .details.with-icn b,.tweet .details.with-icn .Icon,.tweet .tweet-geo-text a:hover,.stream-item:hover .original-tweet .details b,.stream-item .original-tweet.focus .details b,.stream-item.open .original-tweet .details b,.client-and-actions a:hover,.client-and-actions a:focus,.dismiss-btn:hover b,.tweet .context .pretty-link:hover s,.tweet .context .pretty-link:hover b,.tweet .context .pretty-link:focus s,.tweet .context .pretty-link:focus b,.list .username a:hover,.list .username a:focus,.list-membership-container .create-a-list,.list-membership-container .create-a-list:hover,.card .list-details a:hover,.card .list-details a:focus,.card .card-body:hover .attribution,.card .card-body .attribution:focus,.new-tweets-bar,.onebox .soccer ul.ticker a:hover,.onebox .soccer ul.ticker a:focus,.remove-background-btn,.stream-item-activity-notification .latest-tweet .tweet-row a:hover,.stream-item-activity-notification .latest-tweet .tweet-row a:focus,.stream-item-activity-notification .latest-tweet .tweet-row a:hover b,.stream-item-activity-notification .latest-tweet .tweet-row a:focus b,.bird-topbar-etched').each(function(){$(this).addClass('ScriptTest');});}
if(damn=="light"){$('.bird-topbar-etched').addClass('u-textUserColor');$('a,.btn-link,.btn-link:focus,.icon-btn,.pretty-link b,.pretty-link:hover s,.pretty-link:hover b,.pretty-link:focus s,.pretty-link:focus b,.metadata a:hover,.metadata a:focus,.account-group:hover .fullname,.account-group:focus .fullname,.account-summary:focus .fullname,.message .message-text a,.stats a strong,.plain-btn:hover,.plain-btn:focus,.dropdown.open .user-dropdown.plain-btn,.open > .plain-btn,#global-actions .new:before,.module .list-link:hover,.module .list-link:focus,.UserCompletion-step:hover,.stats a:hover,.stats a:hover strong,.stats a:focus,.stats a:focus strong,.profile-modal-header .fullname a:hover,.profile-modal-header .username a:hover,.profile-modal-header .fullname a:focus,.profile-modal-header .username a:focus,.find-friends-sources li:hover .source,.stream-item a:hover .fullname,.stream-item a:focus .fullname,.stream-item .view-all-supplements:hover,.stream-item .view-all-supplements:focus,.tweet .time a:hover,.tweet .time a:focus,.tweet .details.with-icn b,.tweet .details.with-icn .Icon,.tweet .tweet-geo-text a:hover,.stream-item:hover .original-tweet .details b,.stream-item .original-tweet.focus .details b,.stream-item.open .original-tweet .details b,.client-and-actions a:hover,.client-and-actions a:focus,.dismiss-btn:hover b,.tweet .context .pretty-link:hover s,.tweet .context .pretty-link:hover b,.tweet .context .pretty-link:focus s,.tweet .context .pretty-link:focus b,.list .username a:hover,.list .username a:focus,.list-membership-container .create-a-list,.list-membership-container .create-a-list:hover,.card .list-details a:hover,.card .list-details a:focus,.card .card-body:hover .attribution,.card .card-body .attribution:focus,.new-tweets-bar,.onebox .soccer ul.ticker a:hover,.onebox .soccer ul.ticker a:focus,.remove-background-btn,.stream-item-activity-notification .latest-tweet .tweet-row a:hover,.stream-item-activity-notification .latest-tweet .tweet-row a:focus,.stream-item-activity-notification .latest-tweet .tweet-row a:hover b,.stream-item-activity-notification .latest-tweet .tweet-row a:focus b,.bird-topbar-etched').each(function(){$(this).removeClass('ScriptTest');});}
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址