Skip to content

Commit ac5df29

Browse files
committed
disabled service worker
1 parent 13654ec commit ac5df29

12 files changed

Lines changed: 53 additions & 64 deletions

File tree

File renamed without changes.

ui/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"maximumError": "5mb"
6464
}
6565
],
66-
"serviceWorker": true
66+
"serviceWorker": false
6767
}
6868
}
6969
},

ui/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "eqmac",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"scripts": {
55
"start": "ng serve",
6-
"build": "rm -rf dist/ && ng build --prod",
7-
"package": "npm run build && cd dist/ && zip -r -D ../ui.zip * -x '*.DS_Store'",
6+
"build": "rm -rf dist/ && ng build --prod && cd dist/ && zip -r -D ui.zip * -x '*.DS_Store'",
87
"deploy": "export $(egrep -v '^#' .env | xargs) && ./scripts/deploy.sh",
98
"purge-cache": "./node_modules/.bin/ts-node -O '{\"module\":\"commonjs\"}' ./scripts/purge-cache.ts"
109
},

ui/scripts/deploy.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/sh
22
set -e
33

4-
VERSION=$(node -e "const [ major, minor ] = require('./package.json').version.split('.');console.log([major, minor, 0].join(''))")
5-
DOMAIN=ui-v$VERSION.eqmac.app
4+
UI_VERSION=$(node -e "console.log(require('./package.json').version)")
5+
SUBDOMAIN_VERSION=$(node -e "const [ major, minor ] = require('./package.json').version.split('.');console.log([major, minor, 0].join(''))")
6+
DOMAIN=ui-v$SUBDOMAIN_VERSION.eqmac.app
7+
8+
echo $UI_VERSION
9+
echo $SUBDOMAIN_VERSION
610

711
npm run build
812

@@ -11,6 +15,7 @@ gcloud config set project $GCLOUD_PROJECT_ID
1115

1216
gsutil -m cp -z js,css,html -r dist/* gs://$DOMAIN
1317
gsutil -m setmeta -h "Content-Type:text/html;charset=utf-8" gs://$DOMAIN/**/*.html
18+
1419
gsutil iam ch allUsers:objectViewer gs://$DOMAIN
1520

1621
./node_modules/.bin/ts-node -O '{"module":"commonjs"}' ./scripts/purge-cache.ts || echo "❌ Failed to purge Cloudflare cache"

ui/src/app/app.module.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
} from './modules/eqmac-components/eqmac-components.module'
2323

2424
import { PipesModule } from './modules/pipes/pipes.module'
25-
import { ServiceWorkerModule } from '@angular/service-worker'
2625

2726
import {
2827
CommonModule
@@ -98,8 +97,7 @@ import { OptionsDialogComponent } from './components/options-dialog/options-dial
9897
EqmacComponentsModule,
9998
MatDialogModule,
10099
BrowserModule,
101-
ClickOutsideModule,
102-
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
100+
ClickOutsideModule
103101
],
104102
entryComponents: [
105103
ConfirmDialogComponent,
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
<ng-content></ng-content>
1+
<!-- <ng-content></ng-content> -->
2+
<div class="container" [ngStyle]="style">
3+
<img #icon [src]="'assets/icons/' + name + '.svg'" onload="SVGInject(this)"/>
4+
</div>
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
.icon {
2-
margin: 0 auto;
3-
display: block;
4-
}
51

6-
.hidden {
7-
display: none;
2+
.container {
3+
position: relative;
4+
svg {
5+
width: 100%;
6+
height: 100%;
7+
position: absolute;
8+
top: 50%;
9+
left: 50%;
10+
transform: translate(-50%, -50%);
11+
}
812
}

ui/src/app/modules/eqmac-components/components/icon/icon.component.ts

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import {
33
OnInit,
44
Input,
55
ElementRef,
6-
Renderer
6+
ViewChild
77
} from '@angular/core'
8-
import { HttpClient } from '@angular/common/http'
98

109
@Component({
1110
selector: 'eqm-icon',
@@ -16,10 +15,11 @@ export class IconComponent implements OnInit {
1615
@Input() width = 20
1716
@Input() height = 20
1817

18+
@ViewChild('icon', { static: true }) iconRef: ElementRef
19+
1920
@Input() set size (newSize) {
2021
this.width = newSize
2122
this.height = newSize
22-
this.loadSVG()
2323
}
2424
_color = '#979aa0'
2525
@Input()
@@ -29,7 +29,6 @@ export class IconComponent implements OnInit {
2929
} else {
3030
this._color = '#979aa0'
3131
}
32-
this.loadSVG()
3332
}
3433

3534
_strokeColor = this._color
@@ -40,7 +39,6 @@ export class IconComponent implements OnInit {
4039
} else {
4140
this._strokeColor = this._color
4241
}
43-
this.loadSVG()
4442
}
4543

4644
private _rotate = 0
@@ -50,59 +48,39 @@ export class IconComponent implements OnInit {
5048
}
5149
set rotate (angle: number) {
5250
this._rotate = angle
53-
this.loadSVG()
5451
}
5552

5653
_name = null
5754
@Input()
5855
set name (iconName: string) {
5956
this._name = iconName
60-
this.loadSVG()
6157
}
6258
get name () { return this._name }
6359

6460
@Input() stroke: number = 0
65-
constructor (
66-
private elementRef: ElementRef,
67-
private renderer: Renderer,
68-
private http: HttpClient
69-
) {}
7061

7162
ngOnInit () {
72-
this.loadSVG()
7363
}
7464

75-
loadSVG () {
76-
if (!this.name) return
77-
const responseType: any = 'text'
78-
this.http.get <any>(`/assets/icons/${this.name}.svg`, {
79-
responseType
80-
}).subscribe(response => {
65+
get style () {
66+
const style: any = {}
8167

82-
const element = this.elementRef.nativeElement
83-
element.innerHTML = ''
68+
style.fill = `${this._color}`
69+
style.display = 'block'
70+
style.margin = '0 auto'
71+
if (this.height >= 0) {
72+
style.height = `${this.height}px`
73+
}
74+
if (this.height >= 0) {
75+
style.width = `${this.width}px`
76+
}
77+
style.transform = `rotate(${this.rotate}deg)`
8478

85-
const parser = new DOMParser()
86-
const svg = parser.parseFromString(response, 'image/svg+xml').documentElement
87-
svg.style.fill = `${this._color}`
88-
svg.style.display = 'block'
89-
svg.style.margin = '0 auto'
90-
if (this.height >= 0) {
91-
svg.style.height = `${this.height}px`
92-
}
93-
if (this.height >= 0) {
94-
svg.style.width = `${this.width}px`
95-
}
96-
svg.style.transform = `rotate(${this.rotate}deg)`
79+
if (this.stroke) {
80+
style['stroke-width'] = `${this.stroke}px`
81+
style.stroke = `${this._strokeColor}`
82+
}
9783

98-
if (this.stroke) {
99-
svg.style['stroke-width'] = `${this.stroke}px`
100-
svg.style.stroke = `${this._strokeColor}`
101-
}
102-
this.renderer.projectNodes(element, [svg])
103-
if (this.height >= 0) {
104-
svg.parentElement.style.height = `${this.height}px`
105-
}
106-
})
84+
return style
10785
}
10886
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@font-face {
22
font-family: 'eqMacFont';
3-
src: url('/assets/SF-Pro-Text-Regular.otf');
3+
src: url(/assets/SF-Pro-Text-Regular.otf);
44
}
55

ui/src/app/sections/volume/booster-balance/balance/balance.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<eqm-label>Balance</eqm-label>
22

33
<!-- Knob controls -->
4-
<div *ngIf="!uiSettings.replaceKnobsWithSliders" fxLayout="row" fxLayoutAlign="space-around start"
4+
<div *ngIf="!uiSettings.replaceKnobsWithSliders" fxLayout="row" fxLayoutAlign="center start"
55
[class]="'controls' + (hide ? ' hide' : '')">
6-
<div fxLayout="column" fxLayoutAlign="center center">
6+
<div fxLayout="column" fxLayoutAlign="center center" fxFlex="52px">
77
<eqm-label>Left</eqm-label>
88
<eqm-value-screen>{{(balance | mapValue:0:1:100:0 | clipValue:0:100 | fixFloat:0:false)}}%</eqm-value-screen>
99
</div>
1010
<eqm-knob size="small" [min]="-1" [max]="1" [(value)]="balance" (userChangedValue)="setBalance($event)"
1111
[stickToMiddle]="true" (stickedToMiddle)="performHapticFeedback($event)" [animationDuration]="animationDuration"
1212
[animationFps]="animationFps"></eqm-knob>
13-
<div fxLayout="column" fxLayoutAlign="center center">
13+
<div fxLayout="column" fxLayoutAlign="center center" fxFlex="52px">
1414
<eqm-label>Right</eqm-label>
1515
<eqm-value-screen>{{(balance | mapValue:0:-1:100:0 | clipValue:0:100 | fixFloat:0:false)}}%</eqm-value-screen>
1616
</div>

0 commit comments

Comments
 (0)