Skip to content

Instantly share code, notes, and snippets.

@ahmadrosid
Created January 20, 2025 08:46
Show Gist options
  • Save ahmadrosid/671f8c4c6957608ee0d74d45ab37aeb9 to your computer and use it in GitHub Desktop.
Save ahmadrosid/671f8c4c6957608ee0d74d45ab37aeb9 to your computer and use it in GitHub Desktop.
Globe animation - Vanta JS
<div id="vantajs">
<h1>Animated Globe - Vanta JS</h1>
</div>
VANTA.GLOBE({
el: "#vantajs",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x65c7f7
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://yandex.st/highlightjs/8.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r123/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vanta/0.5.21/vanta.globe.min.js"></script>
#vantajs {
width: 100%;
height: 100vh;
}
h1 {
color: #fff !important;
}
@media screen and (max-width: 1024px) {
#vantajs {
max-height: 100vh;
}
h1 {
font-size: 1.5rem;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://yandex.st/highlightjs/8.0/styles/vs.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment