Awkward Zebra Text Effect

Developer
Size
2,961 Kb
Views
18,216

How do I make an awkward zebra text effect?

Horizontal striped cutout looking text.Just playing around with different css properties to create fun CSS only text effects using data-attributes and pseudo elements. What is a awkward zebra text effect? How do you make a awkward zebra text effect? This script and codes were developed by Mandy Michael on 16 December 2022, Friday.

Awkward Zebra Text Effect Previews

Awkward Zebra Text Effect - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Awkward Zebra Text Effect</title> <link href="https://fonts.googleapis.com/css?family=Oswald:700" rel="stylesheet"> <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> <h1 data-heading="XYZ"><span contenteditable data-heading="XYZ">XYZ</span></h1> <script src="js/index.js"></script>
</body>
</html>

Awkward Zebra Text Effect - Script Codes CSS Codes

html, body { background: black; background: -webkit-repeating-linear-gradient(45deg, black, black 10px, white 10px, white 20px); background: repeating-linear-gradient(45deg, black, black 10px, white 10px, white 20px); width: 100%; height: 100%;
}
h1 { font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 18vw; text-align: center; line-height: 1; margin: 0; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); position: absolute; color: white; white-space: nowrap; text-shadow: -10px 10px 0 black, 5px -5px 0 black, -5px 5px 0 black, 5px 5px 0 black;
}
h1:before, h1:after,
h1 span:before,
h1 span:after { content: attr(data-heading); position: absolute; overflow: hidden; left: 0; top: 0;
}
h1:before { color: white; height: 34%; z-index: 5;
}
h1:after { color: black; height: 50%; z-index: 4; text-shadow: -5px -5px 0 black, 5px -5px 0 black, -5px 5px 0 black, 5px 5px 0 black; -webkit-transform: translate(10px, 0); transform: translate(10px, 0);
}
h1 span:before { color: white; height: 69%; z-index: 3; text-shadow: -5px -5px 0 black, 5px -5px 0 black, -5px 5px 0 black, 5px 5px 0 black;
}
h1 span:after { color: black; height: 82%; z-index: 2; text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black; -webkit-transform: translate(-5px, 0); transform: translate(-5px, 0);
}

Awkward Zebra Text Effect - Script Codes JS Codes

// JS for content editable trick from Chris Coyier
var span = document.querySelector("span");
span.addEventListener("input", function() {	var text = this.innerText;	this.setAttribute("data-heading", text);	this.parentElement.setAttribute("data-heading", text);
});
Awkward Zebra Text Effect - Script Codes
Awkward Zebra Text Effect - Script Codes
Home Page Home
Developer Mandy Michael
Username mandymichael
Uploaded December 16, 2022
Rating 3.5
Size 2,961 Kb
Views 18,216
Do you need developer help for Awkward Zebra Text Effect?

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!

Mandy Michael (mandymichael) Script Codes
Create amazing captions 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!