File tree 8 files changed +36
-12
lines changed
8 files changed +36
-12
lines changed Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
- < head >
4
- < meta charset ="UTF-8 ">
5
- <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
6
- < meta http-equiv ="Content-Security-Policy " content ="default-src 'self'; script-src 'self' ">
7
- < meta http-equiv ="X-Content-Security-Policy " content ="default-src 'self'; script-src 'self' ">
8
- < title > keys</ title >
9
- < link rel ="stylesheet " href ="./style.css ">
10
- </ head >
11
- < body >
12
- < img src ='../images/1.png '/>
13
- </ body >
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 ">
6
+ <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
7
+ < meta http-equiv ="Content-Security-Policy " content ="default-src 'self'; script-src 'self' ">
8
+ < meta http-equiv ="X-Content-Security-Policy " content ="default-src 'self'; script-src 'self' ">
9
+ < title > keys</ title >
10
+ < link rel ="stylesheet " href ="./style.css ">
11
+ </ head >
12
+
13
+ < body >
14
+ < img src ='../images/all.png ' />
15
+ </ body >
16
+
14
17
</ html >
Original file line number Diff line number Diff line change 7
7
8
8
img {
9
9
width : 100% ;
10
+ }
11
+
12
+ .class1 {
13
+ margin-top : 0 ;
14
+ }
15
+
16
+ .class2 {
17
+ margin-top : -192px ;
18
+ }
19
+
20
+ .class3 {
21
+ margin-top : -384px ;
22
+ }
23
+
24
+ .class4 {
25
+ margin-top : -576px ;
10
26
}
Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ function createWindow() {
66
66
}
67
67
} )
68
68
69
+ globalShortcut . register ( 'Command+4' , ( ) => {
70
+ if ( mainWindow . isVisible ( ) ) {
71
+ changeImg ( '4' , mainWindow )
72
+ }
73
+ } )
69
74
ioHook . start ( )
70
75
71
76
mainWindow . setAlwaysOnTop ( true , 'floating' )
Original file line number Diff line number Diff line change 1
1
const changeImg = ( img , mainWindow ) => {
2
2
mainWindow . webContents . executeJavaScript (
3
- `document.querySelector("img").src="../images/ ${ img } .png ";`
3
+ `document.querySelector("img").classList = "class ${ img } ";`
4
4
)
5
5
}
6
6
You can’t perform that action at this time.
0 commit comments