kroenen vor 6 Jahren
Ursprung
Commit
95a18d544d

+ 1
- 1
angular.json Datei anzeigen

@@ -7,9 +7,9 @@
7 7
       "root": "",
8 8
       "sourceRoot": "src",
9 9
       "projectType": "application",
10
-      "prefix": "app",
11 10
       "schematics": {
12 11
         "@schematics/angular:component": {
12
+          "viewEncapsulation":"Native",
13 13
           "styleext": "scss",
14 14
           "spec": false
15 15
         },

+ 48
- 0
electron.main.js Datei anzeigen

@@ -0,0 +1,48 @@
1
+const { app, BrowserWindow, session, globalShortcut } = require("electron");
2
+const path = require("path");
3
+class Main {
4
+  constructor() {
5
+    const {
6
+      width,
7
+      height
8
+    } = require("electron").screen.getPrimaryDisplay().workAreaSize;
9
+
10
+    this.win = new BrowserWindow({
11
+      title: "Control",
12
+      backgroundColor: "#520000",
13
+      x: width / 2,
14
+      y: 0,
15
+      width: width / 2,
16
+      height: height,
17
+      resizable: true,
18
+      frame: false,
19
+      show: false,
20
+      webPreferences: {
21
+        webSecurity: false
22
+      }
23
+    });
24
+    if (process.env.NODE_ENV == "production")
25
+      this.win.loadURL(`file://${__dirname}/dist/index.html`);
26
+    else if (process.env.NODE_ENV == "development"){
27
+      this.win.loadURL("http://localhost:4200");
28
+      this.win.webContents.openDevTools();
29
+    }
30
+
31
+    this.win.once("ready-to-show", () => {
32
+      this.win.show();
33
+    });
34
+
35
+    // Open the DevTools.
36
+    globalShortcut.register("commandOrControl+shift+c", () => {
37
+      this.win.webContents.openDevTools();
38
+    });
39
+
40
+    globalShortcut.register("commandOrControl+shift+r", () => {
41
+      this.win.webContents.reload();
42
+    });
43
+  }
44
+}
45
+
46
+app.on("ready", () => {
47
+  new Main();
48
+});

+ 11312
- 0
package-lock.json
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 6
- 0
package.json Datei anzeigen

@@ -7,6 +7,8 @@
7 7
     "build": "ng build",
8 8
     "test": "ng test",
9 9
     "lint": "ng lint",
10
+    "cli-prod": "cross-env NODE_ENV=production nodemon --watch electron.main.js --exec electron electron.main.js",
11
+    "cli": "cross-env NODE_ENV=development nodemon --watch electron.main.js --exec electron electron.main.js",
10 12
     "e2e": "ng e2e"
11 13
   },
12 14
   "private": true,
@@ -21,6 +23,7 @@
21 23
     "@angular/platform-browser-dynamic": "^6.1.0",
22 24
     "@angular/router": "^6.1.0",
23 25
     "core-js": "^2.5.4",
26
+    "ngx-electron": "^1.0.4",
24 27
     "rxjs": "~6.2.0",
25 28
     "zone.js": "~0.8.26"
26 29
   },
@@ -33,6 +36,8 @@
33 36
     "@types/jasminewd2": "~2.0.3",
34 37
     "@types/node": "~8.9.4",
35 38
     "codelyzer": "~4.3.0",
39
+    "cross-env": "^5.2.0",
40
+    "electron": "^3.0.0",
36 41
     "jasmine-core": "~2.99.1",
37 42
     "jasmine-spec-reporter": "~4.2.1",
38 43
     "karma": "~3.0.0",
@@ -40,6 +45,7 @@
40 45
     "karma-coverage-istanbul-reporter": "~2.0.1",
41 46
     "karma-jasmine": "~1.1.2",
42 47
     "karma-jasmine-html-reporter": "^0.2.2",
48
+    "nodemon": "^1.18.4",
43 49
     "protractor": "~5.4.0",
44 50
     "ts-node": "~7.0.0",
45 51
     "tslint": "~5.11.0",

+ 3
- 0
src/app/about/about.component.html Datei anzeigen

@@ -0,0 +1,3 @@
1
+<p>
2
+  about works!
3
+</p>

+ 0
- 0
src/app/about/about.component.scss Datei anzeigen


+ 16
- 0
src/app/about/about.component.ts Datei anzeigen

@@ -0,0 +1,16 @@
1
+import { Component, OnInit, ViewEncapsulation } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'about',
5
+  templateUrl: './about.component.html',
6
+  styleUrls: ['./about.component.scss'],
7
+  encapsulation: ViewEncapsulation.Native
8
+})
9
+export class AboutComponent implements OnInit {
10
+
11
+  constructor() { }
12
+
13
+  ngOnInit() {
14
+  }
15
+
16
+}

+ 28
- 0
src/app/app-menu/app-menu.component.html Datei anzeigen

@@ -0,0 +1,28 @@
1
+<div class="menu" [class.reducted]="reducted">
2
+  <div style="height: 48px; background-color: rgba(0,0,0,0.3);"></div>
3
+  <svg (click)="reducted = !reducted" x="0px" y="0px" viewBox="0 0 20 12.5" style="position: absolute; padding: 8px 10px; top: 7px; left: 4px; width: 20px; height: 20px;">
4
+    <path fill="#ffffff" fill-rule="evenodd" clip-rule="evenodd" d="M0,12.5h20V11H0V12.5z M0,7h20V5.5H0V7z M0,0v1.5h20V0H0z"></path>
5
+  </svg>
6
+  <a [routerLink]="['/home']" [queryParams]="{ title : 'Welcome' }" routerLinkActive="selected">
7
+    <span>
8
+      <i>
9
+        <svg x="0px" y="0px" width="10px" height="16px" viewBox="0 0 10 16">
10
+          <path fill="#ffffff" d="M5,0C2.3,0,0,2.3,0,5c0,2,2,5.9,3.7,8.8c0.6,1.1,1.1,1.8,1.1,1.8L5,16l0.2-0.4c0,0,0.5-0.7,1.1-1.8 C8,10.9,10,7.1,10,5C10,2.3,7.8,0,5,0z M5.8,13.5c-0.3,0.5-0.6,1-0.8,1.3c-0.2-0.3-0.5-0.8-0.8-1.3C2.9,11.1,0.6,7.1,0.6,5 c0-2.4,2-4.4,4.4-4.4s4.4,2,4.4,4.4C9.4,7.1,7.1,11.1,5.8,13.5z"></path>
11
+          <path fill="#ffffff" d="M5,1.9C3.3,1.9,1.9,3.3,1.9,5S3.3,8.2,5,8.2S8.2,6.7,8.2,5S6.7,1.9,5,1.9z M5,7.5C3.6,7.5,2.5,6.4,2.5,5 S3.6,2.5,5,2.5S7.5,3.6,7.5,5S6.4,7.5,5,7.5z"></path>
12
+        </svg>
13
+      </i>
14
+      <span *ngIf="!reducted">Welcome</span>
15
+    </span>
16
+  </a>
17
+  <a [routerLink]="['/about']" [queryParams]="{ title: 'About' }" routerLinkActive="selected">
18
+    <span>
19
+      <i>
20
+        <svg x="0px" y="0px" width="10px" height="16px" viewBox="0 0 10 16">
21
+          <path fill="#ffffff" d="M5,0C2.3,0,0,2.3,0,5c0,2,2,5.9,3.7,8.8c0.6,1.1,1.1,1.8,1.1,1.8L5,16l0.2-0.4c0,0,0.5-0.7,1.1-1.8 C8,10.9,10,7.1,10,5C10,2.3,7.8,0,5,0z M5.8,13.5c-0.3,0.5-0.6,1-0.8,1.3c-0.2-0.3-0.5-0.8-0.8-1.3C2.9,11.1,0.6,7.1,0.6,5 c0-2.4,2-4.4,4.4-4.4s4.4,2,4.4,4.4C9.4,7.1,7.1,11.1,5.8,13.5z"></path>
22
+          <path fill="#ffffff" d="M5,1.9C3.3,1.9,1.9,3.3,1.9,5S3.3,8.2,5,8.2S8.2,6.7,8.2,5S6.7,1.9,5,1.9z M5,7.5C3.6,7.5,2.5,6.4,2.5,5 S3.6,2.5,5,2.5S7.5,3.6,7.5,5S6.4,7.5,5,7.5z"></path>
23
+        </svg>
24
+      </i>
25
+    <span *ngIf="!reducted">About</span>
26
+    </span>
27
+  </a>
28
+</div>

+ 57
- 0
src/app/app-menu/app-menu.component.scss Datei anzeigen

@@ -0,0 +1,57 @@
1
+.menu {
2
+  cursor: default;
3
+  user-select: none;
4
+  display: flex;
5
+  position: relative;
6
+  flex-grow: 0;
7
+  flex-shrink: 0;
8
+  flex-direction: column;
9
+  overflow: hidden;
10
+  width: 200px;
11
+  padding: 0;
12
+  background-color: rgba(0, 0, 0, .15);
13
+  height: 100%;
14
+  &.reducted {
15
+    width: 48px;
16
+  }
17
+  svg:hover>path {
18
+    fill: rgba(154, 19, 19, 0.8);
19
+  }
20
+  >a {
21
+    display: flex;
22
+    align-items: center;
23
+    height: 44px;
24
+    color:initial;
25
+    text-decoration: none;
26
+    &:hover {
27
+      background-color: rgba(255, 255, 255, 0.1);
28
+    }
29
+    &.selected {
30
+      background-color: rgba(154, 19, 19, 0.6);
31
+      &:hover {
32
+        background-color: rgba(154, 19, 19, 0.8);
33
+      }
34
+    }
35
+    >span {
36
+      display: flex;
37
+      align-items: center;
38
+      color: rgb(255, 255, 255);
39
+      font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
40
+      font-size: 15px;
41
+      letter-spacing: 0.4pt;
42
+      padding: 0px 16px;
43
+      transition: transform 0.1s ease-in 0s;
44
+      user-select: none;
45
+      &:active{
46
+        transition: transform 0s ease-in 0s;
47
+        transform: scale(0.97);
48
+      }
49
+      >i {
50
+        margin-right: 8px;
51
+        height: 44px;
52
+        display: flex;
53
+        align-items: center;
54
+      }
55
+    }
56
+  }
57
+}

+ 11
- 0
src/app/app-menu/app-menu.component.ts Datei anzeigen

@@ -0,0 +1,11 @@
1
+import { Component, OnInit, ViewEncapsulation } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'app-menu',
5
+  templateUrl: './app-menu.component.html',
6
+  styleUrls: ['./app-menu.component.scss'],
7
+  encapsulation: ViewEncapsulation.Native
8
+})
9
+export class AppMenuComponent{
10
+  reducted: Boolean = false
11
+}

+ 10
- 1
src/app/app-routing.module.ts Datei anzeigen

@@ -1,7 +1,16 @@
1 1
 import { NgModule } from '@angular/core';
2 2
 import { Routes, RouterModule } from '@angular/router';
3
+import { HomeComponent } from './home/home.component';
4
+import { AboutComponent } from './about/about.component';
3 5
 
4
-const routes: Routes = [];
6
+const routes: Routes = [
7
+  {
8
+    path:'home', component: HomeComponent, 
9
+  },{
10
+    path:'about', component: AboutComponent
11
+  },
12
+  { path: "**", redirectTo: "/home?title=Welcome",  }
13
+];
5 14
 
6 15
 @NgModule({
7 16
   imports: [RouterModule.forRoot(routes)],

+ 20
- 21
src/app/app.component.html Datei anzeigen

@@ -1,21 +1,20 @@
1
-<!--The content below is only a placeholder and can be replaced.-->
2
-<div style="text-align:center">
3
-  <h1>
4
-    Welcome to {{ title }}!
5
-  </h1>
6
-  <img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
7
-</div>
8
-<h2>Here are some links to help you start: </h2>
9
-<ul>
10
-  <li>
11
-    <h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12
-  </li>
13
-  <li>
14
-    <h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15
-  </li>
16
-  <li>
17
-    <h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18
-  </li>
19
-</ul>
20
-
21
-<router-outlet></router-outlet>
1
+<title-bar *ngIf="_electron.isElectronApp"></title-bar>
2
+<div id="container">
3
+  <div class="background-container">
4
+    <div class="preset"></div>
5
+    <div class="noise"></div>
6
+  </div>
7
+  <div>
8
+    <app-menu></app-menu>
9
+    <div class="content">
10
+      <div>
11
+        <div class="title">
12
+          <div>{{ title }}</div>
13
+        </div>
14
+        <div class="content">
15
+          <router-outlet></router-outlet>
16
+        </div>
17
+      </div>
18
+    </div>
19
+  </div>
20
+</div>

+ 73
- 0
src/app/app.component.scss Datei anzeigen

@@ -0,0 +1,73 @@
1
+#container {
2
+  display: flex;
3
+  position: relative;
4
+  flex-grow: 1;
5
+  height: 100%;
6
+  .background-container {
7
+    top: 0;
8
+    left: 0;
9
+    display: block;
10
+    width: 100%;
11
+    height: 100%;
12
+    position: fixed;
13
+    z-index: -1;
14
+    .preset {
15
+      background-image: url('/assets/preset-light.png');
16
+      background-size: cover;
17
+      background-position: center center;
18
+      background-repeat: no-repeat;
19
+      width: 100%;
20
+      height: 100%;
21
+      position: absolute;
22
+      z-index: 2;
23
+    }
24
+    .noise {
25
+      position: absolute;
26
+      width: 100%;
27
+      height: 100%;
28
+      background: url('/assets/noise.png');
29
+      z-index: 2;
30
+    }
31
+  }
32
+  >div {
33
+    display: flex;
34
+    flex-wrap: nowrap;
35
+    position: relative;
36
+    flex: 1 1 0%;
37
+    >.content {
38
+      position: relative;
39
+      flex-grow: 1;
40
+      flex-shrink: 0;
41
+      display: flex;
42
+      >div {
43
+        display: flex;
44
+        flex: 1 1 0%;
45
+        flex-direction: column;
46
+        >.title {
47
+          background-color: rgba(0, 0, 0, 0.15);
48
+          &>div {
49
+            position: relative;
50
+            color: rgb(255, 255, 255);
51
+            height: 48px;
52
+            display: flex;
53
+            align-items: center;
54
+            font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
55
+            font-size: 15px;
56
+            text-transform: uppercase;
57
+            padding: 0px 24px;
58
+            overflow: hidden;
59
+            cursor: default;
60
+            user-select: none;
61
+          }
62
+        }
63
+        >.content {
64
+          display: flex;
65
+          flex: 1 1 0%;
66
+          flex-direction: column;
67
+          height: 500px; // background-image: url("/assets/christian-holzinger-755549-unsplash.jpg");
68
+          // background-size: cover;
69
+        }
70
+      }
71
+    }
72
+  }
73
+}

+ 28
- 6
src/app/app.component.ts Datei anzeigen

@@ -1,10 +1,32 @@
1
-import { Component } from '@angular/core';
1
+import { Component, ViewEncapsulation, OnInit } from "@angular/core";
2
+import { ElectronService } from "ngx-electron";
3
+import { ActivatedRoute } from "@angular/router";
2 4
 
3 5
 @Component({
4
-  selector: 'app-root',
5
-  templateUrl: './app.component.html',
6
-  styleUrls: ['./app.component.scss']
6
+  selector: "app-root",
7
+  templateUrl: "./app.component.html",
8
+  styleUrls: ["./app.component.scss"],
9
+  encapsulation: ViewEncapsulation.Native
7 10
 })
8
-export class AppComponent {
9
-  title = 'angutron';
11
+export class AppComponent implements OnInit {
12
+  title: string = "";
13
+
14
+  constructor(
15
+    public _electron: ElectronService,
16
+    public _activatedRoute: ActivatedRoute
17
+  ) {
18
+    if (_electron.isElectronApp) {
19
+      document.body.classList.add("isElectron");
20
+      _electron.remote
21
+        .getCurrentWindow()
22
+        .on("focus", () => document.body.classList.add("hasFocus"))
23
+        .on("blur", () => document.body.classList.remove("hasFocus"));
24
+    }
25
+  }
26
+
27
+  ngOnInit() {
28
+    this._activatedRoute.queryParams.subscribe(
29
+      params => (this.title = params["title"])
30
+    );
31
+  }
10 32
 }

+ 21
- 9
src/app/app.module.ts Datei anzeigen

@@ -1,18 +1,30 @@
1
-import { BrowserModule } from '@angular/platform-browser';
2
-import { NgModule } from '@angular/core';
1
+import { BrowserModule } from "@angular/platform-browser";
2
+import { NgModule } from "@angular/core";
3 3
 
4
-import { AppRoutingModule } from './app-routing.module';
5
-import { AppComponent } from './app.component';
4
+import { AppRoutingModule } from "./app-routing.module";
5
+import { NgxElectronModule } from "ngx-electron";
6
+import { AppComponent } from "./app.component";
7
+import { TitleBarComponent } from "./title-bar/title-bar.component";
8
+import { AppMenuComponent } from "./app-menu/app-menu.component";
9
+import { HomeComponent } from './home/home.component';
10
+import { AboutComponent } from './about/about.component';
6 11
 
7 12
 @NgModule({
8 13
   declarations: [
9
-    AppComponent
14
+    AppComponent,
15
+    TitleBarComponent,
16
+    AppMenuComponent,
17
+    HomeComponent,
18
+    AboutComponent
10 19
   ],
11 20
   imports: [
12
-    BrowserModule,
13
-    AppRoutingModule
21
+    BrowserModule, 
22
+    AppRoutingModule, 
23
+    NgxElectronModule
14 24
   ],
15 25
   providers: [],
16
-  bootstrap: [AppComponent]
26
+  bootstrap: [
27
+    AppComponent
28
+  ]
17 29
 })
18
-export class AppModule { }
30
+export class AppModule {}

+ 3
- 0
src/app/home/home.component.html Datei anzeigen

@@ -0,0 +1,3 @@
1
+<p>
2
+  home works!
3
+</p>

+ 0
- 0
src/app/home/home.component.scss Datei anzeigen


+ 16
- 0
src/app/home/home.component.ts Datei anzeigen

@@ -0,0 +1,16 @@
1
+import { Component, OnInit, ViewEncapsulation } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'home',
5
+  templateUrl: './home.component.html',
6
+  styleUrls: ['./home.component.scss'],
7
+  encapsulation: ViewEncapsulation.Native
8
+})
9
+export class HomeComponent implements OnInit {
10
+
11
+  constructor() { }
12
+
13
+  ngOnInit() {
14
+  }
15
+
16
+}

+ 22
- 0
src/app/title-bar/title-bar.component.html Datei anzeigen

@@ -0,0 +1,22 @@
1
+<div id="title-bar">
2
+  <div class="title">
3
+    Window Application
4
+  </div>
5
+  <div class="controls">
6
+    <a class="minimize" title="Minimize" data-radium="true" (click)="minimize()">
7
+      <svg x="0px" y="0px" viewBox="0 0 10.2 1" data-radium="true" style="width: 10px; height: 10px;">
8
+        <rect fill="#ffffff" width="10.2" height="1"></rect>
9
+      </svg>
10
+    </a>
11
+    <a class="maximize" title="Maximize" data-radium="true" (click)="maximize()">
12
+      <svg x="0px" y="0px" viewBox="0 0 10.2 10.1" data-radium="true" style="width: 10px; height: 10px;">
13
+        <path fill="#ffffff" d="M0,0v10.1h10.2V0H0z M9.2,9.2H1.1V1h8.1V9.2z"></path>
14
+      </svg>
15
+    </a>
16
+    <a class="close" title="Close" data-radium="true" (click)="close()">
17
+      <svg x="0px" y="0px" viewBox="0 0 10.2 10.2" data-radium="true" style="width: 10px; height: 10px;">
18
+        <polygon fill="#ffffff" points="10.2,0.7 9.5,0 5.1,4.4 0.7,0 0,0.7 4.4,5.1 0,9.5 0.7,10.2 5.1,5.8 9.5,10.2 10.2,9.5 5.8,5.1 "></polygon>
19
+      </svg>
20
+    </a>
21
+  </div>
22
+</div>

+ 58
- 0
src/app/title-bar/title-bar.component.scss Datei anzeigen

@@ -0,0 +1,58 @@
1
+#title-bar {
2
+  user-select: none;
3
+  -webkit-app-region: drag;
4
+  cursor: default;
5
+  display: flex;
6
+  align-items: center;
7
+  width: 100%;
8
+  height: 31px;
9
+  background-color: #191818;
10
+  visibility: visible;
11
+  &>.title {
12
+    user-select: none;
13
+    cursor: default;
14
+    padding-left: 12px;
15
+    font-family: "Segoe UI", Arial;
16
+    font-size: 12px;
17
+    color: rgb(255, 255, 255);
18
+    flex: 1 1 0%;
19
+  }
20
+  &>.controls {
21
+    user-select: none;
22
+    cursor: default;
23
+    display: flex;
24
+    height: 32px;
25
+    &>.minimize,
26
+    &>.maximize,
27
+    &>.close {
28
+      user-select: none;
29
+      -webkit-app-region: no-drag;
30
+      cursor: default;
31
+      width: 46px;
32
+      height: 100%;
33
+      line-height: 0;
34
+      display: flex;
35
+      justify-content: center;
36
+      align-items: center;
37
+    }
38
+    &>.minimize:hover,
39
+    &>.maximize:hover {
40
+      transition: background-color 0.1s ease 0s;
41
+      background-color: rgba(255, 255, 255, 0.13);
42
+    }
43
+    &>.minimize:active,
44
+    &>.maximize:active {
45
+      background-color: rgba(255, 255, 255, 0.23);
46
+    }
47
+    &>.close:hover {
48
+      transition: background-color 0.1s ease 0s;
49
+      background-color: rgb(232, 17, 35);
50
+    }
51
+    &>.close:active {
52
+      background-color: rgb(241, 112, 122);
53
+    }
54
+    &>.close:active>svg>polygon {
55
+      fill: rgb(0, 0, 0);
56
+    }
57
+  }
58
+}

+ 41
- 0
src/app/title-bar/title-bar.component.ts Datei anzeigen

@@ -0,0 +1,41 @@
1
+import { Component, OnInit, ViewEncapsulation } from "@angular/core";
2
+import { ElectronService } from "ngx-electron";
3
+
4
+@Component({
5
+  selector: "title-bar",
6
+  templateUrl: "./title-bar.component.html",
7
+  styleUrls: ["./title-bar.component.scss"],
8
+  encapsulation: ViewEncapsulation.Native
9
+})
10
+export class TitleBarComponent implements OnInit {
11
+  old: {
12
+    position: number[];
13
+    size: number[];
14
+  };
15
+
16
+  constructor(private _electron: ElectronService) {}
17
+
18
+  ngOnInit() {}
19
+
20
+  minimize() {
21
+    this._electron.remote.getCurrentWindow().minimize();
22
+  }
23
+
24
+  maximize() {
25
+    let currentWindow = this._electron.remote.getCurrentWindow();
26
+    if (!currentWindow.isMaximized()) {
27
+      this.old = {
28
+        position : currentWindow.getPosition(), 
29
+        size : currentWindow.getSize()
30
+      };
31
+      currentWindow.maximize();
32
+    }else if(this.old !== undefined){
33
+      currentWindow.setPosition(this.old.position[0], this.old.position[1], true);
34
+      currentWindow.setSize(this.old.size[0], this.old.size[1], true);
35
+    }
36
+  }
37
+
38
+  close() {
39
+    this._electron.remote.getCurrentWindow().close();
40
+  }
41
+}

BIN
src/assets/noise.png Datei anzeigen


BIN
src/assets/preset-light.png Datei anzeigen


+ 40
- 0
src/styles.scss Datei anzeigen

@@ -1 +1,41 @@
1 1
 /* You can add global styles to this file, and also import other style files */
2
+
3
+html,
4
+body,
5
+app-root {
6
+  height: 100%;
7
+  width: 100%;
8
+  margin: 0;
9
+  padding: 0;
10
+}
11
+
12
+html {
13
+  overflow: hidden;
14
+}
15
+
16
+body {
17
+  user-select: none;
18
+  cursor: default;
19
+  background-color: rgb(23, 23, 23);
20
+  display: flex;
21
+  flex-direction: column;
22
+  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
23
+    "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
24
+    sans-serif;
25
+  color: #333;
26
+  &.isElectron {
27
+    box-sizing: border-box;
28
+    border-width: 1px;
29
+    border-style: solid;
30
+    box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 11px 3px;
31
+    border-color: #3a3939;
32
+  }
33
+  &.hasFocus{
34
+    border-color: rgb(154, 19, 19);
35
+  }
36
+}
37
+
38
+// #content {
39
+//   max-height: calc(100% - 32px);
40
+//   overflow: auto;
41
+// }