Skip to content

Commit 99a30c2

Browse files
init app [project88]
1 parent fd29e02 commit 99a30c2

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

88-High-Contrast Mode/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="styles.css" />
7+
<link rel="stylesheet" href="styles-high-contrast.css" />
8+
<title>High-Contrast Mode Tool</title>
9+
</head>
10+
<body>
11+
<div class="container">
12+
<h1>High-Contrast Mode Tool</h1>
13+
<button id="toggleBtn">Toggle High Contrast</button>
14+
<p>This is a sample text for testing high-contrast mode.</p>
15+
</div>
16+
<script src="script.js"></script>
17+
</body>
18+
</html>

88-High-Contrast Mode/script.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
const toggleBtn = document.getElementById("toggleBtn");
3+
const body = document.body;
4+
5+
toggleBtn.addEventListener("click", toggleHighContrast);
6+
7+
function toggleHighContrast() {
8+
body.classList.toggle("high-contrast");
9+
}
10+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
body.high-contrast {
2+
background-color: #000;
3+
color: #fff;
4+
}
5+
6+
body.high-contrast button {
7+
background-color: #fff;
8+
color: #000;
9+
}
10+
11+
body.high-contrast p {
12+
border: 2px solid #fff;
13+
padding: 10px;
14+
}

88-High-Contrast Mode/styles.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
body {
2+
font-family: "Arial", sans-serif;
3+
transition: background-color 0.3s, color 0.3s;
4+
}
5+
6+
.container {
7+
text-align: center;
8+
padding: 20px;
9+
border-radius: 8px;
10+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
11+
}
12+
13+
button {
14+
padding: 10px 20px;
15+
font-size: 16px;
16+
cursor: pointer;
17+
}
18+
19+
button:hover {
20+
background-color: #ddd;
21+
}

0 commit comments

Comments
 (0)