Last active
September 15, 2024 16:24
-
-
Save orgcontrib/422513068dcce9e40ae4f632e4a05edf to your computer and use it in GitHub Desktop.
Mozilla's new typeface @mozilla\Fira
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> | |
<title>Rename.me</title> | |
<link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css"> | |
<style> | |
body { | |
font-family: 'Fira Sans'; | |
font-weight: 100; | |
overflow-x: hidden; | |
} | |
article { | |
margin: 0 auto; | |
max-width: 800px; | |
padding: 1em; | |
} | |
h1, | |
.glyph { | |
font-family: 'Fira Sans'; | |
font-size: 40px; | |
} | |
p { | |
font-family: 'Fira Sans'; | |
font-size: 32px; | |
padding: 0 1em; | |
} | |
.mono { | |
font-family: 'Fira Mono'; | |
} | |
.ribbon { | |
background: none repeat scroll 0% 0% rgb(34, 34, 34); | |
color: white; | |
display: block; | |
font: 400 13px 'Fira Sans'; | |
padding: 8px 150px; | |
position: absolute; | |
right: 0px; | |
text-decoration: none; | |
top: 0px; | |
-webkit-transform: translate(50%, -50%) rotate(45deg) translateY(72px); | |
-moz-transform: translate(50%, -50%) rotate(45deg) translateY(72px); | |
-ms-transform: translate(50%, -50%) rotate(45deg) translateY(72px); | |
-o-transform: translate(50%, -50%) rotate(45deg) translateY(72px); | |
transform: translate(50%, -50%) rotate(45deg) translateY(72px); | |
white-space: nowrap; | |
} | |
.glyph { | |
margin: 1em auto; | |
text-align: center; | |
font-size: 72px; | |
} | |
@media (max-width: 640px) { | |
p { | |
padding: 0; | |
font-size: 18px; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<main> | |
<article> | |
<h2 class="mono">Mono</h2> | |
<p class="mono"> | |
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quam, quas possimus. Reiciendis labore deleniti ad | |
mollitia laudantium similique in reprehenderit illum repudiandae placeat, necessitatibus tenetur aliquid | |
possimus dolor qui quae? | |
</p> | |
</article> | |
<script> | |
var elems = document.querySelectorAll("p"); | |
elems = Array.prototype.slice.call(elems); | |
function propagate(changedElem) { | |
var str = changedElem.innerHTML; | |
elems.forEach(function (x) { | |
if (x !== changedElem) { | |
x.innerHTML = str; | |
} | |
}); | |
} | |
elems.forEach(function (x) { | |
x.oninput = function () { | |
propagate(x); | |
}; | |
}); | |
var orig = document.querySelector("#orig"); | |
propagate(orig); | |
</script> | |
</main> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment