w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
Home CSS Code Demos
Variable font “gravity” scroll using Chee’s font

Variable font “gravity” scroll using Chee’s font

W3TWEAKS by W3TWEAKS
September 20, 2019
in CSS Code Demos
0

Variable font experiment modifying the gravity variation axis of Chee font. Hooking the variation axis for Chee’s gravity into the scroll event and matching the scales of scroll and variable axis. Developed using CSS, html, javascript and chee’s font. Demo and Download options available.

You might also like

CSS Shapes Forest Collection Spring Summer 2020

CSS Shapes Forest Collection Spring Summer 2020

October 11, 2020
3.2k
CSS Button Concept for Remove and Success

CSS Button Concept for Remove and Success

August 21, 2019
3.3k

Demo Download

Author Mandy Michael
Created SEPTEMBER 09, 2018
License Open
Compatible browsers Chrome, Firefox, Safari

HTML Snippet

<h1 id="text" contenteditable> 	bloop </h1>  <span id="down">scroll ðߑ�</span>  <p class="terms"><a href="https://www.futurefonts.xyz/ohno/cheee">Chee</a> font by James T. Edmondson, <a href="https://www.futurefonts.xyz/ohno">OH no Type Co</a>. <p>

CSS Code

@font-face {   src: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/209981/Cheee_Variable.woff2");   font-family: 'Cheee Variable';   font-style: normal; } body {   height: 2500px;   background: linear-gradient(to top, #1a2980, #26d0ce); }  h1 {   --yeast: 500;   --gravity: 0;   --pos: 0;   font-family: 'Cheee Variable', arial;   font-variation-settings: "yest" var(--gravity), "gvty" var(--gravity);   font-size: 16vw;   color: white;   position: fixed;   top: var(--pos);   margin: 0;   width: 100%;   text-align: center;   -webkit-transform: translateY(-100%);           transform: translateY(-100%);   line-height: 0.6; }  #down {   position: absolute;   top: 0;   text-align: center;   display: block;   width: 100%;   font-size: 50px;   -webkit-animation: bounce 1.25s infinite ease-in-out;           animation: bounce 1.25s infinite ease-in-out;   color: #fff; }  @-webkit-keyframes bounce {   0% {     top: 10%;   }   50% {     top: 15%;   }   100% {     top: 10%;   } }  @keyframes bounce {   0% {     top: 10%;   }   50% {     top: 15%;   }   100% {     top: 10%;   } } .terms {   position: absolute;   font-family: arial, sans-serif;   top: 0;   text-align: center;   color: black;   width: 100%; } .terms a {   color: black; }

JavaScript Snippet

var text = document.querySelector("h1");   window.addEventListener("scroll", function(e) { 	const maxGravity = 1000; 	const minGravity = 0; 	const posTop = 0; 	const posBottom = 100; 	 	var scrollPosition = (document.documentElement.scrollTop + document.body.scrollTop) / (document.documentElement.scrollHeight - document.documentElement.clientHeight); 	 	const percent = scrollPosition / 0.99; 	const gravityScale = percent * (maxGravity + minGravity) - minGravity; 	const positionScale = percent * (posBottom - posTop) + posTop; 	 	const newGravityValue = 		scrollPosition >  0.99 			? maxGravity 			: gravityScale; 	 		 	if (scrollPosition >= 0.99) { 		text.style.setProperty("--gravity", maxGravity);     		text.style.setProperty("--pos", posBottom + '%'); 	} else { 		text.style.setProperty("--gravity", newGravityValue); 		text.style.setProperty("--pos", positionScale +'%'); 	}    });

Preview

Variable font 'gravity' scroll using Chee preview

Tags: animationCheeCSScss effectsCSS TEXT EFFECTSeffecteffectsfontgravityhtmlJavascriptscrolltexttext effectsVariable
Previous Post

403 Forbidden Page: SVG eye illustration and CSS animation

Next Post

Weird input animation and useful for visually impaired users

W3TWEAKS

W3TWEAKS

Since I've had a strong background in front-end development, I took the initiative to start my own website (w3tweaks.com) to share my knowledge with the world.

Related Stories

CSS Shapes Forest Collection Spring Summer 2020

CSS Shapes Forest Collection Spring Summer 2020

by W3TWEAKS
October 11, 2020
0
3.2k

Paulina Hetman crafts a forest full of one-div CSS shapes. Click the button to assemble them into a scene! See...

CSS Button Concept for Remove and Success

CSS Button Concept for Remove and Success

by W3TWEAKS
August 21, 2019
0
3.3k

A cool little css Button concept for delete success with hover animation with close/delete icon and developed using CSS, HTML...

Three Pure different CSS Button effects

Three Pure different CSS Button effects

by W3TWEAKS
September 25, 2019
0
3.2k

Three Pure CSS Button effects like tap, hover and click effects developed using CSS and HTML. Demo and Download available....

Easy customizable simple CSS buttons

Easy customizable simple CSS buttons

by W3TWEAKS
September 8, 2019
0
3.2k

A series of simple CSS buttons. They are easy to customize and use. Can easily be integrated with Font-Awesome or...

Next Post
Weird input animation and useful for visually impaired users

Weird input animation and useful for visually impaired users

Discussion about this post

We bring you the best frontend collections that will fix perfect for news, magazine, personal blog, etc. Check our landing page for details.

  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube

Welcome Back!

Sign In with Google
Sign In with Linked In
OR

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In