diff --git a/public/styles/shared.css b/public/styles/shared.css index 6bdeb4c..b49cdfa 100644 --- a/public/styles/shared.css +++ b/public/styles/shared.css @@ -332,4 +332,17 @@ pre { .alwaysCentered { text-align: center !important; -} \ No newline at end of file +} + +.rainbowText { + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-image: -webkit-gradient(linear, left top, left bottom, + color-stop(0.00, red), + color-stop(16%, orange), + color-stop(32%, yellow), + color-stop(48%, green), + color-stop(60%, blue), + color-stop(76%, indigo), + color-stop(1.00, violet)); + } \ No newline at end of file diff --git a/src/components/panels/paged_ladder.jsx b/src/components/panels/paged_ladder.jsx index 32aa023..cc4d3d4 100644 --- a/src/components/panels/paged_ladder.jsx +++ b/src/components/panels/paged_ladder.jsx @@ -2,6 +2,8 @@ import React from 'react'; import { withRouter, Link } from 'react-router-dom'; import PropTypes from 'prop-types'; +import ProgressiveRainbowText from './progressive_rainbow_text.jsx'; + class PagedLadder extends React.Component { constructor(props) { super(props); @@ -27,7 +29,11 @@ class PagedLadder extends React.Component {
-

{this.state[key].username}

+ { + this.state[key].username === 'Ratstail91' ? + {this.state[key].username} : +

{this.state[key].username}

+ }

Soldiers: {this.state[key].soldiers}

Recruits: {this.state[key].recruits}

Gold: {this.state[key].gold}

diff --git a/src/components/panels/progressive_rainbow_text.jsx b/src/components/panels/progressive_rainbow_text.jsx new file mode 100644 index 0000000..08e22b2 --- /dev/null +++ b/src/components/panels/progressive_rainbow_text.jsx @@ -0,0 +1,27 @@ +import React from 'react'; + +class ProgressiveRainbowText extends React.Component { + constructor(props) { + super(props); + + this.state = { + colors: props.colors || ['red', 'orange', 'yellow', 'green', 'blue', 'violet', 'indigo'], + counter: 0, + unsubscribeKey: setInterval(() => this.setState({ counter: this.state.counter + 1}), 1000) + } + } + + componentWillUnmount() { + clearInterval(this.state.unsubscribeKey); + } + + render() { + return ( +

+ {Object.keys(this.props.children).map((key) => {this.props.children[key]})} +

+ ); + } +}; + +export default ProgressiveRainbowText; \ No newline at end of file