Animating Scale with text featuring blurry raster DPI issues

Developer
Size
2,983 Kb
Views
14,168

How do I make an animating scale with text featuring blurry raster dpi issues?

When animating text above 1x scale in chrome it currently creates a raster graphic. The work around to keep it sharp is that you have to double the size and downscale it. What is a animating scale with text featuring blurry raster dpi issues? How do you make a animating scale with text featuring blurry raster dpi issues? This script and codes were developed by James Nowland on 31 October 2022, Monday.

Animating Scale with text featuring blurry raster DPI issues Previews

Animating Scale with text featuring blurry raster DPI issues - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animating Scale with text featuring blurry raster DPI issues</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2>Blurry</h2>
<h2 class="not-blurry">Sharp</h2> <script src="js/index.js"></script>
</body>
</html>

Animating Scale with text featuring blurry raster DPI issues - Script Codes CSS Codes

h2 { font-size: 60px; text-align: center; -webkit-transform: translate(-50%, -50%) scale(1); transform: translate(-50%, -50%) scale(1); will-change: transform; position: absolute; left: 50%; top: 20%; margin: 0; line-height: 1; -webkit-transition: all .2s ease-in-out; transition: all .2s ease-in-out; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-text-stroke: 2px #41c2ef; background: -webkit-linear-gradient(top, gray 0%, #3b3232 58%, #3b3232 100%); -webkit-background-clip: text; webkit-text-fill-color: transparent; -webkit-animation: 2s toggleSize linear infinite; animation: 2s toggleSize linear infinite;
}
h2 + h2 { top: inherit; bottom: 0;
}
.not-blurry { font-size: 240px; -webkit-text-stroke: 8px #41c2ef; -webkit-transform: scale(0.25); transform: scale(0.25); -webkit-animation: 2s toggleSize-downsize linear infinite; animation: 2s toggleSize-downsize linear infinite;
}
@-webkit-keyframes toggleSize { 0%, 100% { -webkit-transform: translate(-50%, -50%) scale(1); transform: translate(-50%, -50%) scale(1); } 50%, 70% { -webkit-transform: translate(-50%, -20%) scale(4); transform: translate(-50%, -20%) scale(4); }
}
@keyframes toggleSize { 0%, 100% { -webkit-transform: translate(-50%, -50%) scale(1); transform: translate(-50%, -50%) scale(1); } 50%, 70% { -webkit-transform: translate(-50%, -20%) scale(4); transform: translate(-50%, -20%) scale(4); }
}
@-webkit-keyframes toggleSize-downsize { 0%, 100% { -webkit-transform: translate(-50%, -50%) scale(0.25); transform: translate(-50%, -50%) scale(0.25); } 50%, 70% { -webkit-transform: translate(-50%, -20%) scale(1); transform: translate(-50%, -20%) scale(1); }
}
@keyframes toggleSize-downsize { 0%, 100% { -webkit-transform: translate(-50%, -50%) scale(0.25); transform: translate(-50%, -50%) scale(0.25); } 50%, 70% { -webkit-transform: translate(-50%, -20%) scale(1); transform: translate(-50%, -20%) scale(1); }
}
body { height: 100%; background-color: rebeccaPurple;
}

Animating Scale with text featuring blurry raster DPI issues - Script Codes JS Codes

// When animating text above 1x scale in chrome it currently creates a raster graphic.
// The work around to keep it sharp is that you have to double the size and downscale it
// Yes even for vectors.
// This might be fixed later: https://github.com/w3c/csswg-drafts/issues/236
Animating Scale with text featuring blurry raster DPI issues - Script Codes
Animating Scale with text featuring blurry raster DPI issues - Script Codes
Home Page Home
Developer James Nowland
Username jnowland
Uploaded October 31, 2022
Rating 3
Size 2,983 Kb
Views 14,168
Do you need developer help for Animating Scale with text featuring blurry raster DPI issues?

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!

James Nowland (jnowland) Script Codes
Create amazing marketing copy 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!