Skip to content

Commit f825577

Browse files
committed
rework: ui
1 parent 524ab55 commit f825577

File tree

16 files changed

+1019
-573
lines changed

16 files changed

+1019
-573
lines changed

game/openmod/html/css/style-nobg.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ body {
4747
height: 6vh;
4848
}
4949

50+
5051
.quit-btn {
5152
grid-column: 64 / 64;
5253
}
@@ -61,3 +62,7 @@ body {
6162
.top-btn:hover {
6263
background: rgba(255, 255, 255, 0.5);
6364
}
65+
66+
button i {
67+
font-size: 3.5vh;
68+
}

game/openmod/html/css/style.css

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ body {
3636
background: transparent;
3737
color: white;
3838
font-size: 1.6vh;
39+
cursor: pointer;
3940
border: none;
4041
transition: background 0.15s;
4142
display: flex;
4243
align-items: center;
4344
justify-content: center;
44-
cursor: default;
4545
}
4646

4747
.top-btn img {
@@ -166,7 +166,7 @@ body {
166166
}
167167

168168
.news-item p {
169-
font-size: 1.6vh;
169+
font-size: 1.2vw;
170170
}
171171

172172
.news-item:last-child {
@@ -198,4 +198,42 @@ ul {
198198

199199
button i {
200200
font-size: 3.5vh;
201-
}
201+
}
202+
203+
.play-panel {
204+
position: absolute;
205+
width: 100%;
206+
height: 93.4%;
207+
background-color: rgba(0, 0, 0, 0.4);
208+
color: white;
209+
/* box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); */
210+
overflow-y: auto;
211+
backdrop-filter: blur(50px);
212+
display: none;
213+
}
214+
215+
#items {
216+
border: 1px solid rgba(0, 0, 0, 0.2);
217+
background-color: rgba(67, 67, 67, 0.292);
218+
width: 25%;
219+
height: 80%;
220+
padding: 1.2vh;
221+
margin-bottom: 5px;
222+
margin: 2vh;
223+
font-size: 2.5vh;
224+
}
225+
226+
#items button {
227+
background: linear-gradient(#C7D3DC,#5B798E);
228+
color: white;
229+
padding: 2px 4px;
230+
border: none;
231+
border-radius: 5px;
232+
font-size: 1.8vh;
233+
cursor: default;
234+
transition: background 1s ease-out;
235+
}
236+
237+
#items button:hover {
238+
background: linear-gradient(#29ac46, #155d27);
239+
}

game/openmod/html/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="css/style.css">
7-
<script src="js/script.js" defer></script>
87
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
8+
<script src="js/script.js" defer></script>
99

1010
<title>OpenMod</title>
1111
</head>
@@ -16,7 +16,7 @@
1616
<img src="assets/logo.png" alt="logo">
1717
</button>
1818
<div class="vertical-line"></div>
19-
<button class="top-btn" onclick="alert('cmd:OpenNewGame');">
19+
<button class="top-btn" onclick="alert('cmd:opennewgame');">
2020
<i class="fa-solid fa-play"></i>
2121
</button>
2222
<button class="top-btn" onclick="alert('cmd:gamemenucommand OpenServerBrowser');">
@@ -38,11 +38,11 @@
3838
<h2>NEWS</h2>
3939
</div>
4040
<div class="news-item">
41-
<h3>0.6 CHANGELOG</h3>
41+
<h3>0.7 CHANGELOG</h3>
4242
<p>Stuff Done (2)</p>
4343
<ul>
44-
<li>updated the Panorama menu</li>
45-
<li>added the Multitool (cvars starting with ttt_)</li>
44+
<li>reworked the UI</li>
45+
<li>updated the Physics Gun</li>
4646
<li>..and much much more!</li>
4747
</ul>
4848
</div>

game/openmod/html/js/script.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,27 @@ function togglevisible(show) {
3131
function openPopup(url) {
3232
alert(`cmd:open "${url}"`);
3333
}
34+
35+
const playPanel = document.querySelector('.play-panel');
36+
const newsPanel = document.querySelector('.news-panel');
37+
const bottomButtons = document.querySelector('.bottom-buttons');
38+
39+
playPanel.style.transition = 'opacity 0.2s';
40+
newsPanel.style.transition = 'opacity 0.2s';
41+
bottomButtons.style.transition = 'opacity 0.2s';
42+
43+
function setVisible(huh) {
44+
playPanel.style.opacity = huh ? '1' : '0';
45+
newsPanel.style.opacity = huh ? '0' : '1';
46+
bottomButtons.style.opacity = huh ? '1' : '0';
47+
48+
if (huh == true) {
49+
playPanel.style.display = 'block';
50+
bottomButtons.style.display = 'none';
51+
newsPanel.style.display = 'none';
52+
} else {
53+
newsPanel.style.display = 'block';
54+
bottomButtons.style.display = 'flex';
55+
playPanel.style.display = 'none';
56+
}
57+
}

0 commit comments

Comments
 (0)