-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
20 lines (20 loc) · 887 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<html>
<head>
<meta name="charset" content="utf-8">
<title>prefers-reduced-transparency</title>
<style>
body { font: menu; font-size: 100%; text-align: center; max-width: 720px; margin: 2rem auto; padding: 2rem; }
body.light { background-color: #ecf0f1; color: #000 }
body.dark { background-color: #2c3e50; color: #fff; }
</style>
</head>
<body>
<h1>Your motion preference is <strong id="transparencyPreference">loading...</strong>.</h1>
<script type="module">
import prefersReducedTransparency from "https://unpkg.com/prefers-reduced-transparency";
document.querySelector("#transparencyPreference").innerHTML = prefersReducedTransparency();
document.body.classList.add(prefersReducedTransparency());
</script>
</body>
</html>