|
59 | 59 | display: block !important; |
60 | 60 | } |
61 | 61 |
|
| 62 | +.above-tabs { |
| 63 | + display: flex; |
| 64 | + justify-content: center; |
| 65 | + align-items: center; |
| 66 | + background: #f7f7f7; |
| 67 | + border: 1px solid #bbb; |
| 68 | + border-radius: 8px 8px 0 0; |
| 69 | + box-shadow: 0 4px 12px 0 rgba(0,0,0,0.06); |
| 70 | + padding: 10px 24px 10px 24px; |
| 71 | + margin: 32px auto 0 auto; |
| 72 | + max-width: 480px; |
| 73 | + gap: 14px; |
| 74 | + position: relative; |
| 75 | + top: 24px; |
| 76 | +} |
| 77 | + |
| 78 | +.above-tabs input[type="text"], |
| 79 | +.above-tabs input[type="number"] { |
| 80 | + width: 180px; |
| 81 | + padding: 7px 12px; |
| 82 | + font-size: 15px; |
| 83 | + margin: 0; |
| 84 | + border: 1px solid #b0b0b0; |
| 85 | + border-radius: 5px; |
| 86 | + background-color: #f9f9f9; |
| 87 | + transition: border-color 0.2s; |
| 88 | +} |
| 89 | + |
| 90 | +.above-tabs input[type="text"]:focus, |
| 91 | +.above-tabs input[type="number"]:focus { |
| 92 | + outline: none; |
| 93 | + border-color: #0078d7; |
| 94 | +} |
| 95 | + |
| 96 | +.above-tabs button { |
| 97 | + background: #f7f7f7; |
| 98 | + color: #555; |
| 99 | + border: 1px solid #bbb; |
| 100 | + border-radius: 6px; |
| 101 | + font-size: 15px; |
| 102 | + padding: 8px 18px; |
| 103 | + cursor: pointer; |
| 104 | + box-shadow: 0 4px 12px 0 rgba(0,0,0,0.06); |
| 105 | + transition: background 0.2s, color 0.2s, border 0.2s; |
| 106 | +} |
| 107 | + |
| 108 | +.above-tabs button:hover, .above-tabs button:focus { |
| 109 | + background: #ececec; |
| 110 | + color: #222; |
| 111 | + border-color: #888; |
| 112 | +} |
| 113 | + |
62 | 114 | input[type="text"], input[type="number"] { |
63 | 115 | width: 220px; |
64 | 116 | padding: 7px 12px; |
|
109 | 161 | padding: 16px 4vw; |
110 | 162 | max-width: 98vw; |
111 | 163 | } |
| 164 | + .above-tabs { |
| 165 | + flex-direction: column; |
| 166 | + align-items: stretch; |
| 167 | + padding: 10px 2vw; |
| 168 | + max-width: 98vw; |
| 169 | + gap: 10px; |
| 170 | + } |
| 171 | + .above-tabs input[type="text"], .above-tabs input[type="number"] { |
| 172 | + width: 96vw; |
| 173 | + max-width: 98vw; |
| 174 | + } |
112 | 175 | input[type="text"], input[type="number"] { |
113 | 176 | width: 96vw; |
114 | 177 | max-width: 98vw; |
|
117 | 180 | </style> |
118 | 181 | </head> |
119 | 182 | <body> |
120 | | - <input type="text" placeholder="encryption key" id="key"> |
121 | | - <input type="number" placeholder="message number" id="num"> |
122 | | - <button id="newMessageBtn">New message</button> |
| 183 | + <div class="above-tabs"> |
| 184 | + <input type="text" placeholder="encryption key" id="key"> |
| 185 | + <input type="number" placeholder="message number" id="num"> |
| 186 | + <button type="button" id="newMessageBtn">New Message</button> |
| 187 | + </div> |
123 | 188 | <div id="tabs"> |
124 | 189 | <div class="tab" onclick="showTabContent('tab1')">Encrypt</div> |
125 | 190 | <div class="tab" onclick="showTabContent('tab2')">Decrypt</div> |
|
139 | 204 | </div> |
140 | 205 | </body> |
141 | 206 | <script> |
142 | | - document.getElementById('newMessageBtn').addEventListener('click', function() { |
143 | | - document.getElementById('message').value = ''; |
144 | | - let fileInput = document.getElementById('fileInput'); |
145 | | - if(fileInput) fileInput.value = ''; |
146 | | - let msgNum = Math.floor(Math.random() * 900000) + 100000; |
147 | | - document.getElementById('messageNum').value = msgNum; |
148 | | -}); |
149 | 207 | showTabContent('tab1') |
150 | 208 | function strToBuf(str) { |
151 | 209 | return new TextEncoder().encode(str); |
|
0 commit comments