Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit ad53058

Browse files
committed
[WIP] mod_sysinfo
1 parent 700c7f8 commit ad53058

File tree

5 files changed

+96
-2
lines changed

5 files changed

+96
-2
lines changed

src/_renderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ initMods = () => {
122122
});
123123

124124
let clock = new Clock("mod_column_left");
125+
let sysinfo = new Sysinfo("mod_column_left");
125126
};
126127

127128
// Prevent showing menu, exiting fullscreen or app with keyboard shortcuts

src/assets/css/mod_column.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ section.mod_column {
1010
display: flex;
1111
flex-direction: column;
1212
justify-content: space-between;
13-
overflow: hidden;
1413

1514
opacity: 0;
1615
transition: opacity .5s cubic-bezier(0.4, 0, 1, 1);

src/assets/css/mod_sysinfo.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
div#mod_sysinfo {
2+
display: flex;
3+
flex-direction: row;
4+
align-items: center;
5+
justify-content: space-between;
6+
height: 60px;
7+
border-bottom: 1px solid rgba(190, 230, 193, 0.3);
8+
font-size: 12px;
9+
font-family: var(--font_main_light);
10+
letter-spacing: 1px;
11+
}
12+
13+
div#mod_sysinfo::before {
14+
content: "";
15+
border-left: 1px solid rgba(190, 230, 193, 0.3);
16+
position: relative;
17+
left: -1px;
18+
bottom: -30px;
19+
height: 9px;
20+
}
21+
22+
div#mod_sysinfo::after {
23+
content: "";
24+
border-right: 1px solid rgba(190, 230, 193, 0.3);
25+
position: relative;
26+
right: -1px;
27+
bottom: -30px;
28+
height: 9px;
29+
}
30+
31+
div#mod_sysinfo div {
32+
height: 100%;
33+
box-sizing: border-box;
34+
padding: 10px 5px;
35+
display: flex;
36+
flex-direction: column;
37+
align-items: flex-start;
38+
justify-content: space-around;
39+
}
40+
41+
div#mod_sysinfo h1 {
42+
margin: 0px;
43+
opacity: 0.5;
44+
}
45+
46+
div#mod_sysinfo h2 {
47+
margin: 0px;
48+
}

src/classes/sysinfo.class.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class Sysinfo {
2+
constructor(parentId) {
3+
if (!parentId) throw "Missing parameters";
4+
5+
// Create DOM
6+
this.parent = document.getElementById(parentId);
7+
this.parent.innerHTML += `<div id="mod_sysinfo">
8+
<div>
9+
<h1>2017</h1>
10+
<h2>DEC 12</h2>
11+
</div>
12+
<div>
13+
<h1>UPTIME</h1>
14+
<h2>0:0:47</h2>
15+
</div>
16+
<div>
17+
<h1>SYSTEM</h1>
18+
<h2>ONLINE</h2>
19+
</div>
20+
<div>
21+
<h1>V</h1>
22+
<h2>0.1db</h2>
23+
</div>
24+
</div>`;
25+
26+
this.updateDate();
27+
}
28+
updateDate() {
29+
let time = new Date();
30+
31+
let timeToNewDay = ((24 - time.getHours()) * 3600000) + ((60 - time.getMinutes()) * 60000);
32+
setTimeout(() => {
33+
this.updateDate();
34+
}, timeToNewDay);
35+
}
36+
}
37+
38+
module.exports = {
39+
Sysinfo
40+
};

src/ui.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44
<meta charset="utf-8" />
55
<title>eDEX-UI</title>
66

7+
<!-- Load main css -->
78
<link rel="stylesheet" href="assets/css/main.css" />
89
<link rel="stylesheet" href="assets/css/boot_screen.css" />
910
<link rel="stylesheet" href="assets/css/fonts.css" />
11+
<!-- Load main modules css -->
1012
<link rel="stylesheet" href="assets/css/main_shell.css" />
1113
<link rel="stylesheet" href="assets/css/keyboard.css" />
12-
14+
<!-- Load secondary modules css -->
1315
<link rel="stylesheet" href="assets/css/mod_column.css" />
1416
<link rel="stylesheet" href="assets/css/mod_clock.css" />
17+
<link rel="stylesheet" href="assets/css/mod_sysinfo.css" />
1518

19+
<!-- Load main modules classes -->
1620
<script src="classes/terminal.class.js"></script>
1721
<script src="classes/keyboard.class.js"></script>
22+
<!-- Load secondary modules classes -->
1823
<script src="classes/clock.class.js"></script>
24+
<script src="classes/sysinfo.class.js"></script>
1925
</head>
2026
<body style="background: #090b0a;">
2127
<section id="boot_screen">

0 commit comments

Comments
 (0)