<commit_before>import FlipCard from './FlipCard';
import util from './Util';

const {Front, Back} =  FlipCard;

class Banner extends React.Component{
	constructor(props){
		super(props);
		this.state ={
			bgIndex: 0
		};

		this.colors = [ '#1fbda5', '#8c6954', '#542733'];
	}


	switchBackground(){
		this.setState({
			bgIndex: (this.state.bgIndex+1)%this.colors.length
		});
	}

	componentDidMount(){
		this.trigger = setInterval(()=>{
			this.switchBackground();
		}, 60*1000);
	}

	componentWillUnMount(){
		clearInterval(this.trigger);
	}


	render(){
		let t = this;
		let config = util.loadConfig();
		return (
			<div className='drip-ui-banner' style={{background:t.colors[t.state.bgIndex]}}>
				<FlipCard className='drip-ui-photo'>
					<Front><img src={ config.cdn + this.props.photo}/></Front>
					<Back>
						<div className='drip-ui-photo-title'>
							<h4>醒醒</h4>
							<p>国家有任务交给你啦</p>
						</div>
					</Back>
				</FlipCard>
				<h1 className='css44c9c1f15647b'>{this.props.title || ''}</h1>
			</div><commit_msg>Revert "fix defect."<commit_after>import FlipCard from './FlipCard';

const {Front, Back} =  FlipCard;

class Banner extends React.Component{
	constructor(props){
		super(props);
		this.state ={
			bgIndex: 0
		};

		this.colors = [ '#1fbda5', '#8c6954', '#542733'];
	}


	switchBackground(){
		this.setState({
			bgIndex: (this.state.bgIndex+1)%this.colors.length
		});
	}

	componentDidMount(){
		this.trigger = setInterval(()=>{
			this.switchBackground();
		}, 60*1000);
	}

	componentWillUnMount(){
		clearInterval(this.trigger);
	}


	render(){
		let t = this;
		return (
			<div className='drip-ui-banner' style={{background:t.colors[t.state.bgIndex]}}>
				<FlipCard className='drip-ui-photo'>
					<Front><img src={  this.props.photo}/></Front>
					<Back>
						<div className='drip-ui-photo-title'>
							<h4>醒醒</h4>
							<p>国家有任务交给你啦</p>
						</div>
					</Back>
				</FlipCard>
				<h1 className='css44c9c1f15647b'>{this.props.title || ''}</h1>
			</div>
{'fraction_non_alphanumeric': 0.19073705179282868, 'fraction_numerical': 0.03386454183266932, 'mean_word_length': 3.4348785871964678, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7555407', 'n_tokens_mistral': 942, 'n_tokens_neox': 775, 'n_words': 123}