Skip to content

Instantly share code, notes, and snippets.

View yansusanto's full-sized avatar
:octocat:
Hustling

Yan Susanto yansusanto

:octocat:
Hustling
View GitHub Profile
const data = [
{
name: 'Cluster 1',
value: 210,
},
{
name: 'Cluster 2',
value: 30,
},
{
@yansusanto
yansusanto / onScroll
Last active September 10, 2023 08:52
On scroll effect based on the percentage of viewport height
const [inView, setInView] = React.useState(false);
React.useEffect(() => {
const handleScroll = () => {
const scrollThresholdVH = 30;
if (window.scrollY > (window.innerHeight * scrollThresholdVH) / 100) {
setInView(true);
} else {
setInView(false);
@yansusanto
yansusanto / bootstrap
Created September 23, 2023 06:45
Bootstrap 5.3 Variables
// Variables
//
// Variables should follow the `$component-state-property-size` formula for
// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.
// Color system
// scss-docs-start gray-color-variables
$white: #fff !default;
$gray-100: #f8f9fa !default;