Skip to content

Commit 96a6fc6

Browse files
authored
Merge pull request #5 from Jules010209/develop
fix(front): responsive design & fix pipeline
2 parents 80a6928 + 0bacc11 commit 96a6fc6

File tree

7 files changed

+68
-48
lines changed

7 files changed

+68
-48
lines changed

.github/workflows/release-win.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@ jobs:
3636
with:
3737
files: |
3838
dist/*.exe
39-
dist/*.msi
4039
env:
4140
GITHUB_TOKEN: ${{ secrets.GTH_TOKEN }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aurora-intercom",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "An Electron application with React and TypeScript",
55
"main": "./out/main/index.js",
66
"author": "Jules010209",

src/main/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export class TCPClient {
3232

3333
this.client.on('data', (data) => {
3434
this.buffer += data.toString('ascii');
35-
let index;
35+
let index: number;
36+
3637
while ((index = this.buffer.indexOf('\n')) !== -1) {
3738
const message = this.buffer.slice(0, index);
3839
this.buffer = this.buffer.slice(index + 1);
39-
console.log(message);
4040
this.onMessage(message);
4141
}
4242
});

src/main/index.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if (is.dev) {
1414

1515
let mainWindow: BrowserWindow | null = null;
1616
let tcpClient: TCPClient;
17+
let tcpErrorNotified = false;
1718

1819
const createWindow = (): void => {
1920
mainWindow = new BrowserWindow({
@@ -33,23 +34,30 @@ const createWindow = (): void => {
3334

3435
tcpClient = new TCPClient(
3536
(msg) => {
37+
tcpErrorNotified = false;
3638
if (mainWindow) {
3739
mainWindow.webContents.send('tcp_data', msg);
3840
}
3941
},
4042
(err) => {
4143
console.error(err);
42-
new Notification({
43-
title: 'INTERCOM TCP ERROR',
44-
body: 'An error occurred during tcp connection'
45-
}).show();
44+
if (!tcpErrorNotified) {
45+
new Notification({
46+
title: 'INTERCOM TCP ERROR',
47+
body: 'An error occurred during tcp connection'
48+
}).show();
49+
tcpErrorNotified = true;
50+
}
4651
},
4752
() => {
4853
console.log('Disconnected from TCP Server!');
49-
new Notification({
50-
title: 'INTERCOM TCP ERROR',
51-
body: 'Disconnected from TCP server'
52-
}).show();
54+
if (!tcpErrorNotified) {
55+
new Notification({
56+
title: 'INTERCOM TCP ERROR',
57+
body: 'Disconnected from TCP server'
58+
}).show();
59+
tcpErrorNotified = true;
60+
}
5361
}
5462
);
5563

@@ -138,7 +146,6 @@ autoUpdater.on('update-downloaded', (_) => {
138146
}, 4000);
139147
});
140148

141-
// Quit when all windows are closed, except on macOS.
142149
app.on('window-all-closed', () => {
143150
if (process.platform !== 'darwin') app.quit();
144151
});

src/renderer/src/assets/panel.css

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,39 @@
2525
width: 230px; /* Buttons width */
2626
}
2727

28-
/* .button .div {
29-
padding: 12px 22px;
30-
} */
31-
32-
33-
/* @media screen and (min-width: 1015px),
34-
screen and (min-height: 650px) {
35-
.button {
36-
padding: 20px 30px;
37-
}
38-
}*/
28+
.button {
29+
width: 100%;
30+
max-width: 230px;
31+
box-sizing: border-box;
32+
transition:
33+
width 0.2s,
34+
font-size 0.2s,
35+
padding 0.2s;
36+
}
3937

40-
/* @media screen and (max-width: 1160px) {
38+
@media (max-width: 1200px) {
4139
.button {
42-
font-size: 11px;
40+
max-width: 180px;
41+
font-size: 15px;
42+
padding: 10px 14px;
4343
}
44-
} */
44+
}
4545

46-
/* @media screen and (min-width: 1160px),
47-
screen and (min-height: 800px) {
46+
@media (max-width: 900px) {
4847
.button {
49-
padding: 30px 40px;
48+
max-width: 140px;
49+
font-size: 13px;
50+
padding: 8px 10px;
5051
}
5152
}
5253

53-
@media screen and (min-width: 1200px) {
54+
@media (max-width: 600px) {
5455
.button {
55-
padding: 25px 60px;
56+
max-width: 100px;
57+
font-size: 11px;
58+
padding: 6px 4px;
5659
}
57-
} */
60+
}
5861

5962
.vertical-menu-container {
6063
display: flex;
@@ -86,29 +89,41 @@
8689
/* INTERCOM */
8790

8891
.intercom-call {
89-
height:100px;
92+
height: 100px;
9093
-webkit-animation-name: animation;
9194
-webkit-animation-duration: 1s;
9295
-webkit-animation-timing-function: ease-in-out;
93-
-webkit-animation-iteration-count: infinite;
96+
-webkit-animation-iteration-count: infinite;
9497
-webkit-animation-play-state: running;
95-
98+
9699
animation-name: animation;
97100
animation-duration: 1s;
98101
animation-timing-function: ease-in-out;
99-
animation-iteration-count: infinite;
102+
animation-iteration-count: infinite;
100103
animation-play-state: running;
101104
background-color: #f00;
102105
}
103106

104107
@-webkit-keyframes animation {
105-
0% {background-color:red;}
106-
50.0% {background-color:#ff9999;}
107-
100.0% {background-color:red;}
108+
0% {
109+
background-color: red;
110+
}
111+
50.0% {
112+
background-color: #ff9999;
113+
}
114+
100.0% {
115+
background-color: red;
116+
}
108117
}
109118

110119
@keyframes animation {
111-
0% {background-color:red;}
112-
50.0% {background-color:#ff9999;}
113-
100.0% {background-color:red;}
114-
}
120+
0% {
121+
background-color: red;
122+
}
123+
50.0% {
124+
background-color: #ff9999;
125+
}
126+
100.0% {
127+
background-color: red;
128+
}
129+
}

src/renderer/src/components/panel.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Panel = () => {
2525
const [flashingCalls, setFlashingCalls] = useState<string[]>([]);
2626

2727
useEffect(() => {
28-
// Nettoyage des anciens listeners avant d'en ajouter un nouveau
2928
window.electron.ipcRenderer.removeAllListeners('tcp_data');
3029

3130
const fetchData = async () => {
@@ -124,8 +123,8 @@ const Panel = () => {
124123
}, [stationType]);
125124

126125
const Button = ({ position }: ButtonProps) => {
127-
// Ajout de la classe de clignotement si le callsign est dans flashingCalls
128126
const isFlashing = flashingCalls.includes(position.callsign);
127+
129128
return (
130129
<div className={`button${isFlashing ? ' intercom-call' : ''}`} style={{ backgroundColor: position.color }}>
131130
<div>{position.label}</div>

0 commit comments

Comments
 (0)