Post by Former Member on Mar 3, 2016 18:25:24 GMT -8
Hello, I'd like to know if it would be at all possible to create a plugin that gives specified users/groups a shiny username? By shiny, I mean something like this:Demo
I remember seeing it on a forum somewhere a few years back, but I haven't much coding experience. The only thing I could find was a code for the v4 proboards by Virgil Sovereign
and it looked like this:
I would be really grateful if anyone could either convert it or create a new plugin/code for this.
Thank you.
I remember seeing it on a forum somewhere a few years back, but I haven't much coding experience. The only thing I could find was a code for the v4 proboards by Virgil Sovereign
and it looked like this:
<script type="text/javascript" src="http://yourjavascript.com/1137015619/ccv.js"></script>
<script type="text/javascript">
/* VShiny 1.0 - Shines up your links. :)
V. Sovereign, July 2011
Code provided without warranties. Modify and distribute freely, so long as this header remains intact. Certain
parameters should be set. */
var VShiny = {
/* --- PARAMETERS TO EDIT --- */
/* Number of milliseconds between 'shines'. */
iDelay : 4000,
/* Number of letters covered per second by the shine. */
iLettersPerSecond : 12,
/* Spread of the shine (stdv of a Gaussian dist. in letters). Larger values mean a wider shine. */
rSpread : 2.6,
/* R,G,B triplet specifying the shine color. */
iShineCol : [255,255,255],
/* Glow radius in ems. Set to zero (0) to turn off glow.
Currently glow is turned off for Google Chrome since Chrome's text-shadow CSS effect mangles the letters. IE will
only respect the glow if the DOCTYPE tag is properly set--which it isn't for ProBoards pages. Hence, the glow
effect will only be visible to Firefox, Mozilla, Opera, and Safari users. */
rGlowRad : 0.22,
/* List of users to shine. */
sUsers : ['admin','tanxguide'],
/* --- EDIT BELOW THIS POINT AT YOUR OWN RISK :) --- */
fxIsCandidate : function( eA )
{ return (new RegExp( 'user=(' + VShiny.sUsers.join('|') + ')\\b', '' )).test( eA.href ); },
iTimeRef : 0,
oIval : null,
oAs : [],
add : function( eA ) {
eA = typeof( eA ) == 'string' ? document.getElementById( eA ) : eA;
var iDefCol = VShiny.colorFor( eA );
if( eA.children.length ) {
iDefCol = [];
for( var i = 0; i < eA.children.length; i++ )
iDefCol.push( VShiny.colorFor( eA.children ) );
}
VShiny.oAs.push( { e: eA, 'iDefCol' : iDefCol } );
if( !VShiny.oIval ) {
VShiny.rGlowRad = navigator.userAgent.toLowerCase().indexOf('chrome') != -1 ? 0.0 : VShiny.rGlowRad;
VShiny.iSpeed = 1000/VShiny.iLettersPerSecond;
VShiny.sShineCol = VShiny.escape( VShiny.iShineCol );
VShiny.oIval = setInterval( VShiny.update, 10 );
VShiny.iTimeRef = (new Date()).getTime();
}
},
update : function() {
var iTime_ = (new Date()).getTime() - VShiny.iTimeRef;
for( var i = 0; i < VShiny.oAs.length; i++ ) {
var iTime = iTime_,
oA = VShiny.oAs,
iL = oA.e.children.length;
if( !iL ) iL = VShiny.compartmentalize( oA.e );
if( !iL ) continue;
if( (iTime %= VShiny.denorm( iL, 6 )) < VShiny.iDelay )
continue;
for( var j = 0, e = oA.e.children[0]; j < iL; e = oA.e.children[++j %iL] ) {
var rZ = Math.abs( iTime - VShiny.denorm( j, 3 ) )/(VShiny.rSpread*VShiny.iSpeed),
iDefCol = typeof( oA.iDefCol[0] ) == 'number' ? oA.iDefCol : oA.iDefCol[j];
e.style.color = VShiny.escape( (rZ > 3) ? iDefCol :
VShiny.interp( VShiny.iShineCol, iDefCol, Math.exp( -rZ*rZ ) ) );
if( VShiny.rGlowRad ) {
if( rZ > 1.5 )
e.style.textShadow = 'none';
else {
var s = '0 0 ' + VShiny.rGlowRad + 'em ' + e.style.color;
e.style.textShadow = s + (rZ > 0.75 ? '' : (',' + s));
}
}
}
}
},
init : function() {
if( !VShiny.fxIsCandidate ) return;
for( var i = 0, eAs = document.getElementsByTagName('a'); i < eAs.length; i++ )
if( VShiny.fxIsCandidate( eAs ) )
VShiny.add( eAs );
},
compartmentalize : function( eA ) {
eA.innerHTML = ('' + eA.innerHTML).replace( /(.)/g, '<font>$1</font>' );
return eA.children.length;
},
denorm : function( i, i_ )
{ return Math.floor( VShiny.iDelay + (i + i_*VShiny.rSpread)*VShiny.iSpeed ); },
colorFor : function( e )
{ return VShiny.unescape( window.getComputedStyle ? getComputedStyle( e, null ).getPropertyValue( 'color' ) :
e.currentStyle['color'] ); },
HEX : "0123456789ABCDEF",
escape : function( iCol )
{ return '#' + VShiny.$3( iCol[0] ) + VShiny.$3( iCol[1] ) + VShiny.$3( iCol[2] ); },
unescape : function( sCol ) {
var s = /^rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\)$/.exec( sCol );
if( s )
return [parseInt( s[1] ), parseInt( s[2] ), parseInt( s[3] )];
s = /^#(\w\w)(\w\w)(\w\w)$/.exec( sCol.toUpperCase() ) || /^#(\w\w)(\w\w)(\w\w)$/.exec( CCV[sCol] );
return [VShiny.$2(s[1]), VShiny.$2(s[2]), VShiny.$2(s[3])];
},
interp : function( iCol, iCol_, r ) {
return [Math.round( iCol[0]*r + iCol_[0]*(1-r) ), Math.round( iCol[1]*r + iCol_[1]*(1-r) ),
Math.round( iCol[2]*r + iCol_[2]*(1-r) )];
},
$2 : function( s ) { return VShiny.HEX.indexOf(s.charAt(0))*16 + VShiny.HEX.indexOf(s.charAt(1)); },
$3 : function( i ) { return VShiny.HEX.charAt( Math.floor( i/16 ) ) + VShiny.HEX.charAt( i %16 ); }
};
VShiny.init();
I would be really grateful if anyone could either convert it or create a new plugin/code for this.
Thank you.