|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html lang="en"> |
3 | 3 | <head> |
4 | | - <meta name="environment" content="local"> |
| 4 | + <meta name="environment" content="local" /> |
5 | 5 | <meta charset="UTF-8" /> |
6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
7 | 7 | <title>Pastebin</title> |
8 | 8 | <style> |
| 9 | + :root { |
| 10 | + --bg-color: white; |
| 11 | + --text-color: black; |
| 12 | + --button-bg: #007bff; |
| 13 | + --button-hover: #0056b3; |
| 14 | + } |
| 15 | + |
| 16 | + body.dark-mode { |
| 17 | + --bg-color: #121212; |
| 18 | + --text-color: #ffffff; |
| 19 | + --button-bg: #ff9800; |
| 20 | + --button-hover: #e68900; |
| 21 | + } |
| 22 | + |
9 | 23 | body { |
10 | 24 | font-family: Arial, sans-serif; |
11 | 25 | margin: 20px; |
12 | 26 | text-align: center; |
| 27 | + background-color: var(--bg-color); |
| 28 | + color: var(--text-color); |
| 29 | + transition: background 0.3s, color 0.3s; |
13 | 30 | } |
| 31 | + |
14 | 32 | textarea { |
15 | 33 | width: 80%; |
16 | 34 | height: 200px; |
17 | 35 | margin-bottom: 10px; |
| 36 | + background: var(--bg-color); |
| 37 | + color: var(--text-color); |
| 38 | + border: 1px solid var(--text-color); |
| 39 | + padding: 10px; |
| 40 | + font-size: 16px; |
| 41 | + transition: background 0.3s, color 0.3s; |
| 42 | + } |
| 43 | + |
| 44 | + .paste-button { |
| 45 | + position: absolute; |
| 46 | + top: 5px; |
| 47 | + right: 5px; |
| 48 | + padding: 5px 10px; |
| 49 | + font-size: 14px; |
| 50 | + background-color: var(--button-bg); |
| 51 | + color: white; |
| 52 | + border: none; |
| 53 | + border-radius: 5px; |
| 54 | + cursor: pointer; |
| 55 | + opacity: 0; |
| 56 | + transition: opacity 0.3s ease-in-out, background 0.3s; |
| 57 | + } |
| 58 | + |
| 59 | + .container:hover .paste-button { |
| 60 | + opacity: 1; |
| 61 | + } |
| 62 | + |
| 63 | + .paste-button:hover { |
| 64 | + background-color: var(--button-hover); |
| 65 | + } |
| 66 | + |
| 67 | + /* Toggle Mode Button (Top-Right) */ |
| 68 | + #toggleModeButton { |
| 69 | + position: absolute; |
| 70 | + top: 10px; |
| 71 | + right: 10px; |
| 72 | + padding: 8px 15px; |
| 73 | + font-size: 14px; |
| 74 | + background-color: var(--button-bg); |
| 75 | + color: white; |
| 76 | + border: none; |
| 77 | + border-radius: 5px; |
| 78 | + cursor: pointer; |
| 79 | + transition: background 0.3s; |
| 80 | + } |
| 81 | + |
| 82 | + #toggleModeButton:hover { |
| 83 | + background-color: var(--button-hover); |
18 | 84 | } |
19 | 85 | </style> |
20 | 86 | </head> |
21 | 87 | <body> |
| 88 | + <!-- Toggle Mode Button (Top-Right) with the same id as in the initial code --> |
| 89 | + <button id="toggleModeButton" onclick="toggleMode()">☀️</button> |
| 90 | + |
22 | 91 | <h1>Pastebin</h1> |
23 | 92 | <textarea |
24 | 93 | id="pasteContent" |
25 | 94 | placeholder="Paste your text here..." |
| 95 | + onclick="paste(this)" |
26 | 96 | ></textarea> |
27 | 97 | <br /> |
28 | 98 | <button onclick="submitText()">Submit</button> |
|
0 commit comments