By Loosetooth
import React, {Component} from 'react'; import './quote.scss' import { FaQuoteLeft, FaTwitter, FaFacebook } from 'react-icons/fa'; import quotesList from './quotes_list'; export default class quote extends Component { constructor(props) { super(props); this.state = {selectedQuote: this.randomInt(quotesList().length)}; this.selectRandom = this.selectRandom.bind(this); } randomInt(size){ return Math.floor(Math.random() * size); } selectRandom(){ this.setState({ selectedQuote: this.randomInt(quotesList().length) }) // Trigger appear animation again! let first = document.getElementById("quote-div"); let second = document.getElementById("author"); first.classList.add("appear"); setTimeout( () => first.classList.remove("appear"), 1000 ); second.classList.add("appear"); setTimeout( () => second.classList.remove("appear"), 1000 ); } render() { return
By Loosetooth