Skip to content

Instantly share code, notes, and snippets.

@KyleMit
Created October 19, 2020 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KyleMit/e8f3c8a070e7899a6668b2c983934d28 to your computer and use it in GitHub Desktop.
Save KyleMit/e8f3c8a070e7899a6668b2c983934d28 to your computer and use it in GitHub Desktop.
Twitter - No JS
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<script>
document.documentElement.classList.remove("no-js");
document.documentElement.classList.add("yes-js");
</script>
<style>
.yes-js .yes-js-hidden { display: none; }
.no-js .no-js-hidden { display: none; }
</style>
<style>
html,body {
margin: 0;
}
body {
background: whitesmoke;
display: flex;
text-align: center;
min-height: 100vh;
align-items: center;
justify-content: center;
}
body > div {
background: white;
padding: 45px 20px;
border-radius: 3px;
box-shadow: 1px 1px 1px #8080808c;
width: 30rem;
max-width: 90%;
box-sizing: border-box;
font-size: 2rem;
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>No Script</title>
</head>
<body>
<div class="yes-js-hidden">JavaScript Not Loaded</div>
<div class="no-js-hidden">JavaScript is Loaded</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment