Twinkling Word Cloud React

Developer
Size
3,705 Kb
Views
18,216

How do I make an twinkling word cloud react?

Word cloud that twinkles each word every now and then. Mostly a CSS keyframe animation if you were to generate it from a backend.. What is a twinkling word cloud react? How do you make a twinkling word cloud react? This script and codes were developed by Ken Lane on 25 October 2022, Tuesday.

Twinkling Word Cloud React Previews

Twinkling Word Cloud React - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Twinkling Word Cloud React</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <head> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:100,100"> <style> @keyframes glow { 0% { text-shadow: 0 0 0px #ff0; color: #000; } 0.5% { text-shadow: 0 0 3px #ff0;} 1% { text-shadow: 0 0 0px #ff0; } 100% { text-shadow: 0 0 0px #ff0; } } </style>
</head>
<body> <p>Twinkling Word Cloud</p> <div class="cloud"> <span class="word">Cart</span> </div> <p><a href='https://tanjo.ai/' target='_blank'>Tanjo.ai</a></p> <div id='reactHere'/>
</body> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Twinkling Word Cloud React - Script Codes CSS Codes

.word { font-family: 'Source Sans Pro', arial; color: #489; transition: color 1s, font-size 3s; line-height: 25px; font-size: 10px; text-wrap: justify;
}
.word:hover { font-size: 35px !important; line-height: 25px; color: #000; cursor: default;
}
.cloud{ border: 1px #bbb solid; padding: 7px 17px; text-align: justify;
}
body, p { font-family: 'Source Sans Pro', arial;
}

Twinkling Word Cloud React - Script Codes JS Codes

class TodoApp extends React.Component { constructor(props) { super(props); this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.state = {items: [], text: ''}; } render() { return ( <div> <h3>TODO</h3> <TodoList items={this.state.items} /> <form onSubmit={this.handleSubmit}> <input onChange={this.handleChange} value={this.state.text} /> <button>{'Add #' + (this.state.items.length + 1)}</button> </form> </div> ); } handleChange(e) { this.setState({text: e.target.value}); } handleSubmit(e) { e.preventDefault(); var newItem = { text: this.state.text, id: Date.now() }; this.setState((prevState) => ({ items: prevState.items.concat(newItem), text: '' })); }
}
class TodoList extends React.Component { render() { return ( <ul> {this.props.items.map(item => ( <li key={item.id}>{item.text}</li> ))} </ul> ); }
}
ReactDOM.render(<TodoApp />, document.getElementById('reactHere') );
var wordTwinkle = { ctr: 1, twinkleAllWords: function( el ) { wordTwinkle.addGlowAnim( wordTwinkle.randomWordEl() ); setTimeout( wordTwinkle.twinkleAllWords, 1 ); }, randomWordEl: function() { var els = $('.word:not([style])'); if (els.length == 0) return null; else { return els[wordTwinkle.getRandomInt(0, els.length)]; } }, addGlowAnim: function(el) { $(el).attr('style', 'animation: glow '+ wordTwinkle.ctr*863*50 +'ms '+ wordTwinkle.ctr*103*50 +'ms '+ 'ease infinite; color:hsl(200,50%,'+((Math.random()*50)+30)+'%);'); wordTwinkle.ctr++; }, init: function() { $(document).ready( function() { wordTwinkle.twinkleAllWords(); }); }, getRandomInt: function( min, max ) { min = Math.ceil(min); max = Math.floor(max); return Math.floor( Math.random() * (max - min) ) + min; }
};
wordTwinkle.init(); // ♪ ♪ Twinkle twinkle little word ♪ ♪
//----------------------------------------------o
// Demo stuff below...
// Add random word size styles for this demo
setTimeout( function()
{ $('.word').each( function() { var sz = wordTwinkle.getRandomInt( 12, 22 ); var sty = $(this).attr('style') || ''; // existing style $(this).attr( 'style', sty + 'font-size:'+sz+'pt;' ); });
}, 1000 );
// Word cloud words for this demo
var words = "Intervention Hair Chicken Bottle Participant Retail Company Fat Service Runway Bag Carpet Stroke Walk Association Photo Study Medicaid Hormone Rice Model Drama Nike Sneakers Event Grocery Federal Family Calorie Design↥ Sew Author Sex Healthcare Assign Energy Live Fur Brother Juice Foot Trial Liquor Award Boom Heart Music Hazard History Lincoln Pomegranate Winner Brand Air Cardiovascular Diabetes Treatment Analyze Designer Loss Footwear Collection Water Inspire Parenthood Cancer Fund Goat Young Song Kid Dress Win Bell Wear↥ Fashion↥ Veggie Pizza Online Hat Bean White Blue France Style Antidepressant↧ Band Chan Jazz Leather Trump Meme Test Hollywood Age Shop Girl Retailer Gown Chicago Muslim Feminism Husband Woman New York City New York";
$.each( words.split(/[ \?,\.:]/), function(i,w)
{ if (w.length > 0) { $('.cloud').append("<span class='word'>"+ w +"</span> "); }
});
Twinkling Word Cloud React - Script Codes
Twinkling Word Cloud React - Script Codes
Home Page Home
Developer Ken Lane
Username kenlane22
Uploaded October 25, 2022
Rating 3
Size 3,705 Kb
Views 18,216
Do you need developer help for Twinkling Word Cloud React?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ken Lane (kenlane22) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!