Skip to content

Commit cbfacc5

Browse files
committed
架構變更
1 parent 6eb40ef commit cbfacc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1407
-808
lines changed

.angular-cli.json

-63
This file was deleted.

.vscode/settings.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"git.ignoreLimitWarning": true
3-
}
2+
"git.ignoreLimitWarning": true,
3+
"angular.enable-strict-mode-prompt": false
4+
}

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@angular/core": "^12.2.0",
2121
"@angular/fire": "^6.1.5",
2222
"@angular/forms": "^12.2.0",
23-
"@angular/material": "^12.2.0",
23+
"@angular/material": "^12.2.5",
2424
"@angular/material-moment-adapter": "^12.2.0",
2525
"@angular/platform-browser": "^12.2.0",
2626
"@angular/platform-browser-dynamic": "^12.2.0",
@@ -36,13 +36,13 @@
3636
"angular-tag-cloud-module": "^5.3.0",
3737
"bootstrap": "^5.0.1",
3838
"d3": "^6.7.0",
39+
"firebase": "^7.0 || ^8.0",
3940
"moment": "^2.29.1",
4041
"ngx-material-timepicker": "^5.5.3",
4142
"ngx-pinch-zoom": "^2.5.5",
4243
"rxjs": "^6.6.7",
4344
"tslib": "^2.2.0",
44-
"zone.js": "~0.11.4",
45-
"firebase": "^7.0 || ^8.0"
45+
"zone.js": "~0.11.4"
4646
},
4747
"devDependencies": {
4848
"@angular-devkit/build-angular": "^12.1.1",

src/app/app-routing.module.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { RouterModule, Routes } from '@angular/router';
33
import { NotFoundPageComponent } from './core/containers';
44

55
const routes: Routes = [
6-
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
6+
{ path: '', redirectTo: '/zoo', pathMatch: 'full' },
77
{
8-
path: 'dashboard',
8+
path: 'zoo',
99
loadChildren: () =>
10-
import('./dashboard/dashboard.module').then((m) => m.DashboardModule)
10+
import('./zoo/zoo.module').then((m) => m.ZooModule)
1111
},
1212
{
1313
path: '**',

src/app/app.component.html

-4
This file was deleted.

src/app/app.component.ts

-11
This file was deleted.

src/app/app.module.ts

+15-47
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,26 @@
1-
import { AnimalService } from './share/animal.service';
2-
import { MusicService } from './share/music.service';
3-
import { ShareService } from './share/share.service';
4-
import { StageComponent } from './stage/stage.component';
5-
import { StageService } from './stage/stage.service';
1+
import { ZooModule } from './zoo/zoo.module';
2+
import { NgModule } from '@angular/core';
63
import { BrowserModule } from '@angular/platform-browser';
74
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8-
import { NgModule } from '@angular/core';
9-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
105
import { HttpClientModule } from '@angular/common/http';
11-
import { AppComponent } from './app.component';
12-
import { HeaderComponent } from './header/header.component';
13-
import { ScoreBoardComponent } from './score-board/score-board.component';
14-
import { AppRoutingModule } from './app-routing.module';
15-
import { AngularFireModule } from 'angularfire2';
16-
import { AngularFireDatabaseModule } from 'angularfire2/database';
17-
import { DatetimeService } from './share/datetime.service';
18-
import { Routes, RouterModule } from '@angular/router';
196

20-
export const firebaseConfig = {
21-
apiKey: 'AIzaSyD-xG9a85R_NdQlP0sAw8Tp6PMWAEqAw38',
22-
authDomain: 'typinghero-1c004.firebaseapp.com',
23-
databaseURL: 'https://typinghero-1c004.firebaseio.com',
24-
projectId: 'typinghero-1c004',
25-
storageBucket: 'typinghero-1c004.appspot.com',
26-
messagingSenderId: '990600809976'
27-
};
7+
import { ROOT_REDUCERS, metaReducers } from './reducers';
8+
import { StoreModule } from '@ngrx/store';
9+
import { EffectsModule } from '@ngrx/effects';
10+
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
11+
import { StoreRouterConnectingModule } from '@ngrx/router-store';
12+
import { environment } from '../environments/environment';
2813

29-
export const appRoutes: Routes = [
30-
{path: '', component: StageComponent},
31-
{path: 'scoreBoard', component: ScoreBoardComponent}
32-
];
14+
import { AppComponent } from './core/containers/app.component';
15+
import { AppRoutingModule } from './app-routing.module';
16+
import { CoreModule } from './core/core.module';
3317

3418
@NgModule({
35-
declarations: [
36-
AppComponent,
37-
HeaderComponent,
38-
StageComponent,
39-
ScoreBoardComponent,
40-
],
4119
imports: [
4220
BrowserModule,
43-
AppRoutingModule,
44-
HttpClientModule,
4521
BrowserAnimationsModule,
22+
HttpClientModule,
23+
AppRoutingModule,
4624
CoreModule,
4725
EffectsModule.forRoot([]),
4826
StoreModule.forRoot(ROOT_REDUCERS, {
@@ -56,19 +34,9 @@ export const appRoutes: Routes = [
5634
},
5735
}),
5836
StoreDevtoolsModule.instrument({ maxAge: 25, logOnly: environment.production }),
59-
StoreRouterConnectingModule.forRoot()
60-
BrowserAnimationsModule,
61-
ReactiveFormsModule,
62-
AngularFireModule.initializeApp(firebaseConfig),
63-
AngularFireDatabaseModule
64-
],
65-
providers: [
66-
StageService,
67-
ShareService,
68-
DatetimeService,
69-
MusicService,
70-
AnimalService,
37+
StoreRouterConnectingModule.forRoot(),
7138
],
39+
providers: [],
7240
bootstrap: [AppComponent]
7341
})
7442
export class AppModule { }

src/app/config.ts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
const zooConfiguration = {
2+
animalName: ['frog', 'giraffe', 'lion', 'panda', 'pig', 'sheep', 'tiger'],
3+
animalNumber: 10,
4+
scalelist: [1, 1.4, 1.2, 1.6, 0.6, 0.8, 0.4],
5+
keyCodeMap: [
6+
{ underText: 'a', upperText: 'A', tsText: 'ㄇ', code: '65' },
7+
{ underText: 'b', upperText: 'B', tsText: 'ㄖ', code: '66' },
8+
{ underText: 'c', upperText: 'C', tsText: 'ㄏ', code: '67' },
9+
{ underText: 'd', upperText: 'D', tsText: 'ㄎ', code: '68' },
10+
{ underText: 'e', upperText: 'E', tsText: 'ㄍ', code: '69' },
11+
{ underText: 'f', upperText: 'F', tsText: 'ㄑ', code: '70' },
12+
{ underText: 'g', upperText: 'G', tsText: 'ㄕ', code: '71' },
13+
{ underText: 'h', upperText: 'H', tsText: 'ㄘ', code: '72' },
14+
{ underText: 'i', upperText: 'I', tsText: 'ㄛ', code: '73' },
15+
{ underText: 'j', upperText: 'J', tsText: 'ㄨ', code: '74' },
16+
{ underText: 'k', upperText: 'K', tsText: 'ㄜ', code: '75' },
17+
{ underText: 'l', upperText: 'L', tsText: 'ㄠ', code: '76' },
18+
{ underText: 'm', upperText: 'M', tsText: 'ㄩ', code: '77' },
19+
{ underText: 'n', upperText: 'N', tsText: 'ㄙ', code: '78' },
20+
{ underText: 'o', upperText: 'O', tsText: 'ㄟ', code: '79' },
21+
{ underText: 'p', upperText: 'P', tsText: 'ㄣ', code: '80' },
22+
{ underText: 'q', upperText: 'Q', tsText: 'ㄆ', code: '81' },
23+
{ underText: 'r', upperText: 'R', tsText: 'ㄐ', code: '82' },
24+
{ underText: 's', upperText: 'S', tsText: 'ㄋ', code: '83' },
25+
{ underText: 't', upperText: 'T', tsText: 'ㄔ', code: '84' },
26+
{ underText: 'u', upperText: 'U', tsText: 'ㄧ', code: '85' },
27+
{ underText: 'v', upperText: 'V', tsText: 'ㄒ', code: '86' },
28+
{ underText: 'w', upperText: 'W', tsText: 'ㄊ', code: '87' },
29+
{ underText: 'x', upperText: 'X', tsText: 'ㄌ', code: '88' },
30+
{ underText: 'y', upperText: 'Y', tsText: 'ㄗ', code: '89' },
31+
{ underText: 'z', upperText: 'Z', tsText: 'ㄈ', code: '90' },
32+
{ underText: '', upperText: '', tsText: 'ㄅ', code: '49' },
33+
{ underText: '', upperText: '', tsText: 'ㄉ', code: '50' },
34+
{ underText: '', upperText: '', tsText: 'ㄝ', code: '188' },
35+
{ underText: '', upperText: '', tsText: 'ㄡ', code: '190' },
36+
{ underText: '', upperText: '', tsText: 'ㄥ', code: '191' },
37+
{ underText: '', upperText: '', tsText: 'ㄤ', code: '186' },
38+
{ underText: '', upperText: '', tsText: 'ㄦ', code: '189' },
39+
{ underText: '', upperText: '', tsText: 'ㄓ', code: '53' },
40+
{ underText: '', upperText: '', tsText: 'ㄚ', code: '56' },
41+
{ underText: '', upperText: '', tsText: 'ㄞ', code: '57' },
42+
{ underText: '', upperText: '', tsText: 'ㄢ', code: '48' }
43+
]
44+
};
45+
46+
export { zooConfiguration };
47+
48+

src/app/core/actions/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as LayoutActions from './layout.actions';
2+
3+
export { LayoutActions };
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { createAction, props } from '@ngrx/store';
2+
import { musicStateEnum } from '../../zoo/models';
3+
4+
export const setMode = createAction('[Layout] Set Mode',
5+
props<{ mode: string }>()
6+
);
7+
export const setProgressBar = createAction('[Layout] Set Progress Bar State',
8+
props<{ progressBarState: boolean }>()
9+
);
10+
export const setAlertType = createAction('[Layout] Set Alert Type',
11+
props<{ alertType: string }>()
12+
);
13+
export const setMuteState = createAction('[Layout] Set Mute State',
14+
props<{ isMute: boolean }>()
15+
);
16+
export const setUsernameState = createAction('[Layout] Set Username State',
17+
props<{ username: string }>()
18+
);
19+
export const setBgMusicState = createAction('[Layout] Set BgMusic State',
20+
props<{ bgMusicState: musicStateEnum }>()
21+
);
22+
export const setDieMusicState = createAction('[Layout] Set DieMusic State',
23+
props<{ dieMusicState: musicStateEnum }>()
24+
);
25+
export const setFailMusicState = createAction('[Layout] Set FailMusic State',
26+
props<{ failMusicState: musicStateEnum }>()
27+
);

src/app/core/components/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './toolbar.component';

0 commit comments

Comments
 (0)