You can also checkout the source code below and take reference from video tutorial to create this 3D rotating text cloud.
Checkout TagCloud.js Here : https://www.npmjs.com/package/TagCloud
Download source code file
In the main directory (outermost folder) run the command : `npm install`
To start the development server run the command: `npm start`
🎉Great! You have successfully setup and run the project.
import React, { useEffect } from "react";
import "../styles/TextShpere.css";
// Importing TagCloud package
import TagCloud from "TagCloud";
const TextShpere = () => {
// Animation settings for Text Cloud
useEffect(() => {
return () => {
const container = ".tagcloud";
const texts = [
"HTML",
"CSS",
"SASS",
"JavaScript",
"React",
"Vue",
"Nuxt",
"NodeJS",
"Babel",
"Jquery",
"ES6",
"GIT",
"GITHUB",
];
const options = {
radius: 300,
maxSpeed: "normal",
initSpeed: "normal",
keep: true,
};
TagCloud(container, texts, options);
};
}, []);
return (
<>
<div className="text-shpere">
{/* span tag className must be "tagcloud" */}
<span className="tagcloud"></span>
</div>
</>
);
};
export default TextShpere;
/* Importing google font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;600;700;800;900&display=swap');
.text-shpere {
position: relative;
top: 0;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #1e1e1e;
}
.tagcloud {
display: inline-block;
top: 0;
left: 0;
font-family: 'Inter', sans-serif;
font-weight: 600;
letter-spacing: 0.0625em;
font-size: 1.3em;
}
/* Change color of each text in sphere on hover */
.tagcloud--item {
color: #00ffffff;
text-transform: uppercase;
}
.tagcloud--item:hover {
color: #ff6347;
}