Skip to content

Commit d4d26d9

Browse files
committed
Merge remote-tracking branch 'github/gh-pages' into bug/4686
2 parents cfa15d2 + 2f3ccc0 commit d4d26d9

File tree

3 files changed

+72
-7
lines changed

3 files changed

+72
-7
lines changed

Diff for: css/main.css

+46
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,52 @@ body {
329329
pointer-events: none;
330330
}
331331

332+
#main02 .input-group {
333+
display: inline-flex;
334+
position: relative;
335+
flex-wrap: wrap;
336+
align-items: stretch;
337+
width: 77%;
338+
margin-bottom: 2rem;
339+
}
340+
341+
#main02 .input-group-input {
342+
display: block;
343+
font-size: 1.5rem;
344+
line-height: 1;
345+
width: 1%;
346+
flex: 1 1 auto;
347+
background: none;
348+
color: #ddd;
349+
margin: 0 auto;
350+
padding: 10px 1rem;
351+
box-shadow:inset #ccc 0 0 0 0, #ccc 0 0 0 3px;
352+
border-radius: 10px;
353+
border-top-right-radius: 0;
354+
border-bottom-right-radius: 0;
355+
}
356+
357+
#main02 .input-group-button {
358+
display: inline-block;
359+
font-size: 1.5rem;
360+
line-height: 1;
361+
box-shadow:inset #ccc 0 0 0 0, #ccc 0 0 0 3px;
362+
border-radius: 10px;
363+
background: rgba(255, 255, 255, .1);
364+
color: #fff;
365+
vertical-align: top;
366+
transition:.3s;
367+
padding: 10px 1rem;
368+
border-top-left-radius: 0;
369+
border-bottom-left-radius: 0;
370+
margin: 0 0 0 3px;
371+
}
372+
373+
#main02 .input-group-button.click {
374+
background: rgba(255, 255, 255, .4);
375+
box-shadow:inset #ccc 0 0 0 3px, #ccc 0 0 0 0;
376+
}
377+
332378
#main02 .btn {
333379
display: inline-block;
334380
width: 38%;

Diff for: index.html

+11-7
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@
371371
</footer>
372372
</div>
373373
<div id="main02" class="panel hide">
374+
<div class="input-group">
375+
<input type="text" class="input-group-input" id="customMessage" placeholder="輸入文字">
376+
<button class="input-group-button">傳送</button>
377+
</div>
374378
<div id="btn0n" msg="btn0" class="btn"></div>
375379
<div id="btn1n" msg="btn1" class="btn"></div>
376380
<div id="btn2n" msg="btn2" class="btn"></div>
@@ -441,27 +445,27 @@ <h3>怪獸廣播訊息</h3>
441445
<h3>按鈕廣播訊息</h3>
442446
<table>
443447
<tr>
444-
<th><input class="btn-name" m="btn0n"></th>
448+
<th><input class="btn-name" m="btn0n" placeholder="按鈕 1"></th>
445449
<td><input class="btn-msg" m="btn0"></td>
446450
</tr>
447451
<tr>
448-
<th><input class="btn-name" m="btn1n"></th>
452+
<th><input class="btn-name" m="btn1n" placeholder="按鈕 2"></th>
449453
<td><input class="btn-msg" m="btn1"></td>
450454
</tr>
451455
<tr>
452-
<th><input class="btn-name" m="btn2n"></th>
456+
<th><input class="btn-name" m="btn2n" placeholder="按鈕 3"></th>
453457
<td><input class="btn-msg" m="btn2"></td>
454458
</tr>
455459
<tr>
456-
<th><input class="btn-name" m="btn3n"></th>
460+
<th><input class="btn-name" m="btn3n" placeholder="按鈕 4"></th>
457461
<td><input class="btn-msg" m="btn3"></td>
458462
</tr>
459463
<tr>
460-
<th><input class="btn-name" m="btn4n"></th>
464+
<th><input class="btn-name" m="btn4n" placeholder="按鈕 5"></th>
461465
<td><input class="btn-msg" m="btn4"></td>
462466
</tr>
463467
<tr>
464-
<th><input class="btn-name" m="btn5n"></th>
468+
<th><input class="btn-name" m="btn5n" placeholder="按鈕 6"></th>
465469
<td><input class="btn-msg" m="btn5"></td>
466470
</tr>
467471
<tr>
@@ -477,7 +481,7 @@ <h3>按鈕廣播訊息</h3>
477481
<td><input class="btn-msg" m="btn8"></td>
478482
</tr>
479483
<tr>
480-
<th><input class="btn-name" m="btn9n" placeholder="按鈕 910"></th>
484+
<th><input class="btn-name" m="btn9n" placeholder="按鈕 10"></th>
481485
<td><input class="btn-msg" m="btn9"></td>
482486
</tr>
483487
</table>

Diff for: js/main.js

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
~async function () {
2+
3+
function handleCustomButton() {
4+
const sendButton = document.querySelector('.input-group-button');
5+
const customMessage = document.getElementById('customMessage');
6+
sendButton.addEventListener('click', () => {
7+
mqttPush(list.topic1, customMessage.value);
8+
sendButton.classList.add('click');
9+
setTimeout(() => {
10+
sendButton.classList.remove('click');
11+
}, 100);
12+
});
13+
}
14+
215
// 載入 js 之後顯示所有元件
316
const content = document.querySelector('.content');
417
content.classList.remove('loading');
@@ -229,6 +242,8 @@
229242
});
230243
});
231244

245+
handleCustomButton();
246+
232247
let send = {
233248
center: false,
234249
top: false,

0 commit comments

Comments
 (0)