Skip to content

Commit de48a1a

Browse files
authored
Merge pull request #86 from we-have-TTA/fix/RoomStyle
style:room的樣式
2 parents 30eb353 + ca10ea5 commit de48a1a

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

app/javascript/controllers/editor_controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ export default class extends Controller {
3333
language: language,
3434
uuid: uuid
3535
}
36-
36+
3737
const resultText = document.getElementById("run_result")
3838
const resultBox = document.getElementById("result-box")
3939
const runText = document.getElementById("run-text")
4040
resultText.textContent = ""
4141
runText.textContent = "執行中....."
42-
resultBox.style.cssText = "width: 600px;display: block"
42+
resultBox.style.cssText = "display: block"
4343
Rails.ajax({
4444
url: `/api/v1/rooms/${roomID}/run`,
4545
type: "post",
@@ -49,7 +49,7 @@ export default class extends Controller {
4949
runText.textContent = "執行結果:"
5050
resultText.textContent = result
5151
setTimeout(() => {
52-
resultBox.style.cssText = "width: 600px;display: none"
52+
resultBox.style.cssText = "display: none"
5353

5454
}, 5000)
5555
},

app/javascript/stylesheets/rooms/room.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
}
2626
.candidate-input {
2727
@apply w-1/2 bg-black p-2;
28+
position: relative;
29+
2830
.control-panel {
2931
button {
3032
@apply border-2 bg-black text-white hover:bg-green-900 text-base rounded px-5 py-2;
@@ -37,6 +39,13 @@
3739
@apply border-gray-300;
3840
}
3941
}
42+
.result-box {
43+
@apply bg-gray-700 rounded-md p-2;
44+
width: calc(100% - 65px);
45+
position: absolute;
46+
left: 50px;
47+
bottom: 20px;
48+
}
4049
}
4150
.web-console {
4251
@apply w-1/2 bg-black p-2;
@@ -69,3 +78,14 @@
6978
margin-top: 10px;
7079
tab-size: 2;
7180
}
81+
82+
.codejar-wrap {
83+
position: relative;
84+
height: calc(100vh - 165px);
85+
.editor{
86+
height: 100%;
87+
}
88+
}
89+
90+
91+

app/views/rooms/_room.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
<button id="current_language">語言選擇</button>
1414
</div>
1515
</div>
16-
1716
<%= render "editor" %>
18-
<div id="result-box" class="absolute bottom-56 left-5 bg-gray-700 rounded-md p-2" style="width: 600px;display: none">
17+
<div id="result-box" class="result-box" style="display: none">
1918
<br>
2019
<div id = "run-text" class="text-xl text-white "></div>
2120
<br>
2221
<div class="text-base text-white " id="run_result"></div>
2322
<br>
2423
</div>
25-
2624
</div>
2725
<div
2826
class="web-console"

app/views/rooms/_webconsole.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="flex justify-between">
2-
<ul class="right-header flex">
2+
<%# <ul class="right-header flex">
33
<li class="text-xl text-white hover:underline mr-5">執行結果</li>
44
<li class="text-xl text-white hover:underline">指示</li>
55
</ul>
6-
<button class="bg-red-700 border border-red-900 hover:bg-red-800 text-white text-sm rounded px-5 py-2">重啟</button>
6+
<button class="bg-red-700 border border-red-900 hover:bg-red-800 text-white text-sm rounded px-5 py-2">重啟</button> %>
77
</div>
88
<div>
99
<% language_set = %w[Ruby JavaScript] %>

0 commit comments

Comments
 (0)