Update 07.12.2022
This commit is contained in:
15
Mobile/game-app/.browserslistrc
Normal file
15
Mobile/game-app/.browserslistrc
Normal file
@@ -0,0 +1,15 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# For the full list of supported browsers by the Angular framework, please see:
|
||||
# https://angular.io/guide/browser-support
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
Chrome >=60
|
||||
Firefox >=63
|
||||
Edge >=79
|
||||
Safari >=13
|
||||
iOS >=13
|
||||
16
Mobile/game-app/.editorconfig
Normal file
16
Mobile/game-app/.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
# Editor configuration, see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
46
Mobile/game-app/.eslintrc.json
Normal file
46
Mobile/game-app/.eslintrc.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["projects/**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"parserOptions": {
|
||||
"project": ["tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/component-class-suffix": [
|
||||
"error",
|
||||
{
|
||||
"suffixes": ["Page", "Component"]
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@angular-eslint/template/recommended"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
68
Mobile/game-app/.gitignore
vendored
Normal file
68
Mobile/game-app/.gitignore
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# Specifies intentionally untracked files to ignore when using Git
|
||||
# http://git-scm.com/docs/gitignore
|
||||
|
||||
*~
|
||||
*.sw[mnpcod]
|
||||
.tmp
|
||||
*.tmp
|
||||
*.tmp.*
|
||||
UserInterfaceState.xcuserstate
|
||||
$RECYCLE.BIN/
|
||||
|
||||
*.log
|
||||
log.txt
|
||||
|
||||
|
||||
/.sourcemaps
|
||||
/.versions
|
||||
/coverage
|
||||
|
||||
# Ionic
|
||||
/.ionic
|
||||
/www
|
||||
/platforms
|
||||
/plugins
|
||||
|
||||
# Compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
/bazel-out
|
||||
|
||||
# Node
|
||||
/node_modules
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
|
||||
# IDEs and editors
|
||||
.idea/
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
|
||||
# Miscellaneous
|
||||
/.angular
|
||||
/.angular/cache
|
||||
.sass-cache/
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# System files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
5
Mobile/game-app/.vscode/extensions.json
vendored
Normal file
5
Mobile/game-app/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ionic.ionic"
|
||||
]
|
||||
}
|
||||
150
Mobile/game-app/angular.json
Normal file
150
Mobile/game-app/angular.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"app": {
|
||||
"projectType": "application",
|
||||
"schematics": {},
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"prefix": "app",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "www",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "assets"
|
||||
},
|
||||
{
|
||||
"glob": "**/*.svg",
|
||||
"input": "node_modules/ionicons/dist/ionicons/svg",
|
||||
"output": "./svg"
|
||||
}
|
||||
],
|
||||
"styles": ["src/theme/variables.scss", "src/global.scss"],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "2kb",
|
||||
"maximumError": "4kb"
|
||||
}
|
||||
],
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"buildOptimizer": false,
|
||||
"optimization": false,
|
||||
"vendorChunk": true,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true,
|
||||
"namedChunks": true
|
||||
},
|
||||
"ci": {
|
||||
"progress": false
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "app:build:production"
|
||||
},
|
||||
"development": {
|
||||
"browserTarget": "app:build:development"
|
||||
},
|
||||
"ci": {
|
||||
"progress": false
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "app:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.spec.json",
|
||||
"karmaConfig": "karma.conf.js",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "assets"
|
||||
},
|
||||
{
|
||||
"glob": "**/*.svg",
|
||||
"input": "node_modules/ionicons/dist/ionicons/svg",
|
||||
"output": "./svg"
|
||||
}
|
||||
],
|
||||
"styles": ["src/theme/variables.scss", "src/global.scss"],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"progress": false,
|
||||
"watch": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"schematicCollections": [
|
||||
"@ionic/angular-toolkit"
|
||||
],
|
||||
"analytics": false
|
||||
},
|
||||
"schematics": {
|
||||
"@ionic/angular-toolkit:component": {
|
||||
"styleext": "scss"
|
||||
},
|
||||
"@ionic/angular-toolkit:page": {
|
||||
"styleext": "scss"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Mobile/game-app/capacitor.config.ts
Normal file
10
Mobile/game-app/capacitor.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CapacitorConfig } from '@capacitor/cli';
|
||||
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'de.leonhoppe.game',
|
||||
appName: 'GameApp',
|
||||
webDir: 'www',
|
||||
bundledWebRuntime: false
|
||||
};
|
||||
|
||||
export default config;
|
||||
7
Mobile/game-app/ionic.config.json
Normal file
7
Mobile/game-app/ionic.config.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "GameApp",
|
||||
"integrations": {
|
||||
"capacitor": {}
|
||||
},
|
||||
"type": "angular"
|
||||
}
|
||||
44
Mobile/game-app/karma.conf.js
Normal file
44
Mobile/game-app/karma.conf.js
Normal file
@@ -0,0 +1,44 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client: {
|
||||
jasmine: {
|
||||
// you can add configuration options for Jasmine here
|
||||
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
||||
// for example, you can disable the random execution with `random: false`
|
||||
// or set a specific seed with `seed: 4321`
|
||||
},
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
jasmineHtmlReporter: {
|
||||
suppressAll: true // removes the duplicated traces
|
||||
},
|
||||
coverageReporter: {
|
||||
dir: require('path').join(__dirname, './coverage/app'),
|
||||
subdir: '.',
|
||||
reporters: [
|
||||
{ type: 'html' },
|
||||
{ type: 'text-summary' }
|
||||
]
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false,
|
||||
restartOnFileChange: true
|
||||
});
|
||||
};
|
||||
24531
Mobile/game-app/package-lock.json
generated
Normal file
24531
Mobile/game-app/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
67
Mobile/game-app/package.json
Normal file
67
Mobile/game-app/package.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "game-app",
|
||||
"version": "0.0.1",
|
||||
"author": "Ionic Framework",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"prod": "ionic capacitor copy android"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/common": "^15.0.0",
|
||||
"@angular/core": "^15.0.0",
|
||||
"@angular/forms": "^15.0.0",
|
||||
"@angular/platform-browser": "^15.0.0",
|
||||
"@angular/platform-browser-dynamic": "^15.0.0",
|
||||
"@angular/router": "^15.0.0",
|
||||
"@capacitor/android": "4.6.0",
|
||||
"@capacitor/app": "4.1.1",
|
||||
"@capacitor/core": "4.6.0",
|
||||
"@capacitor/haptics": "4.1.0",
|
||||
"@capacitor/keyboard": "4.1.0",
|
||||
"@capacitor/status-bar": "4.1.1",
|
||||
"@ionic/angular": "^6.1.9",
|
||||
"ionicons": "^6.0.3",
|
||||
"rxjs": "~7.5.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.11.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^15.0.0",
|
||||
"@angular-eslint/builder": "^14.0.0",
|
||||
"@angular-eslint/eslint-plugin": "^14.0.0",
|
||||
"@angular-eslint/eslint-plugin-template": "^14.0.0",
|
||||
"@angular-eslint/template-parser": "^14.0.0",
|
||||
"@angular/cli": "^15.0.0",
|
||||
"@angular/compiler": "^15.0.0",
|
||||
"@angular/compiler-cli": "^15.0.0",
|
||||
"@angular/language-service": "^15.0.0",
|
||||
"@capacitor/cli": "4.6.0",
|
||||
"@ionic/angular-toolkit": "^6.0.0",
|
||||
"@types/jasmine": "~4.0.0",
|
||||
"@types/node": "^12.11.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.3.0",
|
||||
"@typescript-eslint/parser": "5.3.0",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-plugin-import": "2.22.1",
|
||||
"eslint-plugin-jsdoc": "30.7.6",
|
||||
"eslint-plugin-prefer-arrow": "1.2.2",
|
||||
"jasmine-core": "~4.3.0",
|
||||
"jasmine-spec-reporter": "~5.0.0",
|
||||
"karma": "~6.4.0",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.0.0",
|
||||
"ts-node": "~8.3.0",
|
||||
"typescript": "~4.8.4"
|
||||
},
|
||||
"description": "An Ionic project"
|
||||
}
|
||||
BIN
Mobile/game-app/resources/icon.png
Normal file
BIN
Mobile/game-app/resources/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
BIN
Mobile/game-app/resources/splash.png
Normal file
BIN
Mobile/game-app/resources/splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
16
Mobile/game-app/src/app/app-routing.module.ts
Normal file
16
Mobile/game-app/src/app/app-routing.module.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||
}
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
3
Mobile/game-app/src/app/app.component.html
Normal file
3
Mobile/game-app/src/app/app.component.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<ion-app>
|
||||
<ion-router-outlet></ion-router-outlet>
|
||||
</ion-app>
|
||||
0
Mobile/game-app/src/app/app.component.scss
Normal file
0
Mobile/game-app/src/app/app.component.scss
Normal file
10
Mobile/game-app/src/app/app.component.ts
Normal file
10
Mobile/game-app/src/app/app.component.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: 'app.component.html',
|
||||
styleUrls: ['app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor() {}
|
||||
}
|
||||
16
Mobile/game-app/src/app/app.module.ts
Normal file
16
Mobile/game-app/src/app/app.module.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
|
||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
|
||||
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
16
Mobile/game-app/src/app/tab1/tab1-routing.module.ts
Normal file
16
Mobile/game-app/src/app/tab1/tab1-routing.module.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Tab1Page } from './tab1.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: Tab1Page,
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class Tab1PageRoutingModule {}
|
||||
18
Mobile/game-app/src/app/tab1/tab1.module.ts
Normal file
18
Mobile/game-app/src/app/tab1/tab1.module.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Tab1Page } from './tab1.page';
|
||||
|
||||
import { Tab1PageRoutingModule } from './tab1-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
Tab1PageRoutingModule
|
||||
],
|
||||
declarations: [Tab1Page]
|
||||
})
|
||||
export class Tab1PageModule {}
|
||||
38
Mobile/game-app/src/app/tab1/tab1.page.html
Normal file
38
Mobile/game-app/src/app/tab1/tab1.page.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<ion-header [translucent]="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
TicTacToe
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true" scroll-y="false">
|
||||
|
||||
<section class="container">
|
||||
<div class="info">
|
||||
<span id="difficulty">Schwierigkeitsgrad: {{difficulty}}</span>
|
||||
<span id="current_player">{{current}} ist am Zug</span>
|
||||
<span id="game_result">{{gameResult}}</span>
|
||||
</div>
|
||||
|
||||
<div class="playground">
|
||||
<ion-button fill="outline" (click)="click(0)">{{fields[0]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(1)">{{fields[1]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(2)">{{fields[2]}}</ion-button>
|
||||
|
||||
<ion-button fill="outline" (click)="click(3)">{{fields[3]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(4)">{{fields[4]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(5)">{{fields[5]}}</ion-button>
|
||||
|
||||
<ion-button fill="outline" (click)="click(6)">{{fields[6]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(7)">{{fields[7]}}</ion-button>
|
||||
<ion-button fill="outline" (click)="click(8)">{{fields[8]}}</ion-button>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<ion-button (click)="reset()">Neues Spiel</ion-button>
|
||||
<ion-button (click)="changeDifficulty()">Schwierigkeit ändern</ion-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</ion-content>
|
||||
0
Mobile/game-app/src/app/tab1/tab1.page.scss
Normal file
0
Mobile/game-app/src/app/tab1/tab1.page.scss
Normal file
132
Mobile/game-app/src/app/tab1/tab1.page.ts
Normal file
132
Mobile/game-app/src/app/tab1/tab1.page.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tab1',
|
||||
templateUrl: 'tab1.page.html',
|
||||
styleUrls: ['tab1.page.scss']
|
||||
})
|
||||
export class Tab1Page {
|
||||
public fields: string[] = [];
|
||||
public current: string = "X";
|
||||
public gameResult: string = "";
|
||||
public difficulty: string = "normal";
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
this.fields = [];
|
||||
this.current = "X";
|
||||
this.gameResult = "";
|
||||
|
||||
for (let i = 0; i < 9; i++) this.fields[i] = "";
|
||||
}
|
||||
|
||||
public changeDifficulty(): void {
|
||||
switch (this.difficulty) {
|
||||
case "einfach":
|
||||
this.difficulty = "normal";
|
||||
break;
|
||||
|
||||
case "normal":
|
||||
this.difficulty = "schwer";
|
||||
break;
|
||||
|
||||
case "schwer":
|
||||
default:
|
||||
this.difficulty = "einfach";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public click(index: number): void {
|
||||
if (this.gameResult != "") return;
|
||||
if (this.current != "X") return;
|
||||
if (this.fields[index] != "") return;
|
||||
this.fields[index] = "X";
|
||||
this.current = "O";
|
||||
this.checkWinner();
|
||||
this.ai();
|
||||
this.current = "X";
|
||||
this.checkWinner();
|
||||
}
|
||||
|
||||
private ai(): void {
|
||||
let diff = this.difficulty;
|
||||
if (diff == "normal") {
|
||||
const num = Math.random();
|
||||
if (num > 0.6) diff = "schwer";
|
||||
else diff = "einfach";
|
||||
}
|
||||
|
||||
const freeFields: {index: number, isFree: boolean}[] = []
|
||||
for (let i = 0; i < 9; i++) {
|
||||
freeFields[i] = {index: i, isFree: this.fields[i] == ""};
|
||||
}
|
||||
|
||||
if (diff == "einfach") {
|
||||
const onlyFrees = freeFields.filter(field => field.isFree);
|
||||
if (onlyFrees.length == 0) return;
|
||||
const num = Math.floor(Math.random() * onlyFrees.length);
|
||||
this.fields[onlyFrees[num].index] = "O";
|
||||
}
|
||||
|
||||
if (diff == "schwer") {
|
||||
if (this.completeRows("O")) return;
|
||||
if (this.completeRows("X")) return;
|
||||
|
||||
const onlyFrees = freeFields.filter(field => field.isFree);
|
||||
if (onlyFrees.length == 0) return;
|
||||
const num = Math.floor(Math.random() * onlyFrees.length);
|
||||
this.fields[onlyFrees[num].index] = "O";
|
||||
}
|
||||
}
|
||||
|
||||
private completeRows(key: string): boolean {
|
||||
if (this.placeInFreeRowSpace(0, 1, 2, key)) return true;
|
||||
if (this.placeInFreeRowSpace(3, 4, 5, key)) return true;
|
||||
if (this.placeInFreeRowSpace(6, 7, 8, key)) return true;
|
||||
|
||||
if (this.placeInFreeRowSpace(0, 3, 6, key)) return true;
|
||||
if (this.placeInFreeRowSpace(1, 4, 7, key)) return true;
|
||||
if (this.placeInFreeRowSpace(2, 5, 8, key)) return true;
|
||||
|
||||
if (this.placeInFreeRowSpace(0, 4, 8, key)) return true;
|
||||
if (this.placeInFreeRowSpace(2, 4, 6, key)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private placeInFreeRowSpace(i1: number, i2: number, i3: number, key: string): boolean {
|
||||
if (this.fields[i1] != key && this.fields[i2] != key && this.fields[i3] != key) return false;
|
||||
if (this.fields[i1] == this.fields[i2] && this.fields[i1] != this.fields[i3] && this.fields[i3] == "") {
|
||||
this.fields[i3] = "O";
|
||||
return true;
|
||||
}
|
||||
if (this.fields[i1] == this.fields[i3] && this.fields[i1] != this.fields[i2] && this.fields[i2] == "") {
|
||||
this.fields[i2] = "O";
|
||||
return true;
|
||||
}
|
||||
if (this.fields[i2] == this.fields[i3] && this.fields[i2] != this.fields[i1] && this.fields[i1] == "") {
|
||||
this.fields[i1] = "O";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private checkWinner(): void {
|
||||
if (this.fields[0] == this.fields[1] && this.fields[0] == this.fields[2] && this.fields[0] != "") this.gameResult = this.fields[0] + " hat gewonnen";
|
||||
else if (this.fields[3] == this.fields[4] && this.fields[3] == this.fields[5] && this.fields[3] != "") this.gameResult = this.fields[3] + " hat gewonnen";
|
||||
else if (this.fields[6] == this.fields[7] && this.fields[6] == this.fields[8] && this.fields[6] != "") this.gameResult = this.fields[6] + " hat gewonnen";
|
||||
|
||||
else if (this.fields[0] == this.fields[3] && this.fields[0] == this.fields[6] && this.fields[0] != "") this.gameResult = this.fields[0] + " hat gewonnen";
|
||||
else if (this.fields[1] == this.fields[4] && this.fields[1] == this.fields[7] && this.fields[1] != "") this.gameResult = this.fields[1] + " hat gewonnen";
|
||||
else if (this.fields[2] == this.fields[5] && this.fields[2] == this.fields[8] && this.fields[2] != "") this.gameResult = this.fields[2] + " hat gewonnen";
|
||||
|
||||
else if (this.fields[0] == this.fields[4] && this.fields[0] == this.fields[8] && this.fields[0] != "") this.gameResult = this.fields[0] + " hat gewonnen";
|
||||
else if (this.fields[2] == this.fields[4] && this.fields[2] == this.fields[6] && this.fields[2] != "") this.gameResult = this.fields[2] + " hat gewonnen";
|
||||
|
||||
else if (this.fields.filter(field => field == "").length == 0) this.gameResult = "unentschieden";
|
||||
}
|
||||
|
||||
}
|
||||
16
Mobile/game-app/src/app/tab2/tab2-routing.module.ts
Normal file
16
Mobile/game-app/src/app/tab2/tab2-routing.module.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Tab2Page } from './tab2.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: Tab2Page,
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class Tab2PageRoutingModule {}
|
||||
18
Mobile/game-app/src/app/tab2/tab2.module.ts
Normal file
18
Mobile/game-app/src/app/tab2/tab2.module.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Tab2Page } from './tab2.page';
|
||||
|
||||
import { Tab2PageRoutingModule } from './tab2-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
Tab2PageRoutingModule
|
||||
],
|
||||
declarations: [Tab2Page]
|
||||
})
|
||||
export class Tab2PageModule {}
|
||||
35
Mobile/game-app/src/app/tab2/tab2.page.html
Normal file
35
Mobile/game-app/src/app/tab2/tab2.page.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<ion-header [translucent]="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
Snake
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true">
|
||||
<ion-header collapse="condense">
|
||||
<ion-toolbar>
|
||||
<ion-title size="large">Snake</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<section class="container">
|
||||
<div class="info">
|
||||
<span id="game_result">{{gameResult}}</span>
|
||||
</div>
|
||||
|
||||
<div class="playground" #playground>
|
||||
<div *ngFor="let row of grid" class="row">
|
||||
<div *ngFor="let item of row" class="item" [ngStyle]="{backgroundColor: item}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<ion-button (click)="changeDirection({x: 0, y: -1})" id="up">↑</ion-button>
|
||||
<ion-button (click)="changeDirection({x: -1, y: 0})" id="left">←</ion-button>
|
||||
<ion-button (click)="changeDirection({x: 1, y: 0})" id="right">→</ion-button>
|
||||
<ion-button (click)="changeDirection({x: 0, y: 1})" id="down">↓</ion-button>
|
||||
<ion-button (click)="reset()" id="center">↺</ion-button>
|
||||
</div>
|
||||
</section>
|
||||
</ion-content>
|
||||
56
Mobile/game-app/src/app/tab2/tab2.page.scss
Normal file
56
Mobile/game-app/src/app/tab2/tab2.page.scss
Normal file
@@ -0,0 +1,56 @@
|
||||
.container .playground {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(19, 1fr);
|
||||
gap: 1px;
|
||||
border: 1px solid var(--ion-color-primary);
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
|
||||
.row {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(19, 1fr);
|
||||
gap: 1px;
|
||||
|
||||
.item {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container .buttons {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(3, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
|
||||
ion-button {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
#up {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
#left {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
#right {
|
||||
grid-column: 3;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
#down {
|
||||
grid-column: 2;
|
||||
grid-row: 3;
|
||||
}
|
||||
|
||||
#center {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
||||
148
Mobile/game-app/src/app/tab2/tab2.page.ts
Normal file
148
Mobile/game-app/src/app/tab2/tab2.page.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
const gridSize = 19;
|
||||
|
||||
interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
interface Snake {
|
||||
direction: Point;
|
||||
head: Point;
|
||||
tail: Point[];
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-tab2',
|
||||
templateUrl: 'tab2.page.html',
|
||||
styleUrls: ['tab2.page.scss']
|
||||
})
|
||||
export class Tab2Page {
|
||||
public gameResult: string = "";
|
||||
public grid: string[][] = [];
|
||||
public snake: Snake = {direction: {x: 0, y: 0}, head: {x: 0, y: 0}, tail: []};
|
||||
public fruit: Point = {x: 0, y: 0};
|
||||
public timer: number = 0;
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
this.gameResult = "";
|
||||
this.grid = [];
|
||||
|
||||
for (let i = 0; i < gridSize; i++) {
|
||||
this.grid[i] = [];
|
||||
for (let j = 0; j < gridSize; j++) {
|
||||
this.grid[i][j] = 'unset';
|
||||
}
|
||||
}
|
||||
|
||||
this.snake = {direction: {x: 0, y: 0}, head: {x: Math.floor(gridSize / 2), y: Math.floor(gridSize / 2)}, tail: []};
|
||||
this.generateTailTile(3);
|
||||
this.fruit = this.generateFruitPos();
|
||||
|
||||
clearInterval(this.timer);
|
||||
this.timer = 0;
|
||||
|
||||
this.grid[this.snake.head.x][this.snake.head.y] = 'darkgreen';
|
||||
this.grid[this.fruit.x][this.fruit.y] = 'red';
|
||||
}
|
||||
|
||||
public generateFruitPos(): Point {
|
||||
let x = Math.floor(Math.random() * gridSize);
|
||||
let y = Math.floor(Math.random() * gridSize);
|
||||
|
||||
while (this.isInTail({x, y}) || (this.snake.head.x == x && this.snake.head.y == y)) {
|
||||
x = Math.floor(Math.random() * gridSize);
|
||||
y = Math.floor(Math.random() * gridSize);
|
||||
}
|
||||
|
||||
return {x, y};
|
||||
}
|
||||
|
||||
public generateTailTile(i: number): void {
|
||||
for (let j = 0; j < i; j++) {
|
||||
let pos = {...this.snake.head};
|
||||
if (this.snake.tail.length != 0)
|
||||
pos = {...this.snake.tail[this.snake.tail.length - 1]};
|
||||
|
||||
this.snake.tail.push(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public clearBoard(): void {
|
||||
for (let i = 0; i < gridSize; i++) {
|
||||
for (let j = 0; j < gridSize; j++) {
|
||||
this.grid[i][j] = 'unset';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public isInTail(point: Point): boolean {
|
||||
for (let i = 0; i < this.snake.tail.length; i++) {
|
||||
if (this.snake.tail[i].x == point.x && this.snake.tail[i].y == point.y)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public startGame(): void {
|
||||
if (this.timer != 0) return;
|
||||
this.timer = setInterval(this.update(), 200);
|
||||
}
|
||||
|
||||
public changeDirection(dir: Point): void {
|
||||
this.snake.direction = dir;
|
||||
if (this.timer == 0) this.startGame();
|
||||
}
|
||||
|
||||
public stopGame(): void {
|
||||
clearInterval(this.timer);
|
||||
this.timer = 0;
|
||||
this.gameResult = "Verloren";
|
||||
}
|
||||
|
||||
public update(): TimerHandler {
|
||||
return () => {
|
||||
// Snake movement
|
||||
for (let i = this.snake.tail.length - 1; i >= 0; i--) {
|
||||
if (i == 0) this.snake.tail[i] = {x: this.snake.head.x, y: this.snake.head.y};
|
||||
else this.snake.tail[i] = {x: this.snake.tail[i - 1].x, y: this.snake.tail[i - 1].y};
|
||||
}
|
||||
this.snake.head = {x: this.snake.head.x + this.snake.direction.x, y: this.snake.head.y + this.snake.direction.y};
|
||||
|
||||
// Fruit detection
|
||||
if (this.snake.head.x == this.fruit.x && this.snake.head.y == this.fruit.y) {
|
||||
this.generateTailTile(2);
|
||||
this.fruit = this.generateFruitPos();
|
||||
}
|
||||
|
||||
// Death detection
|
||||
if (this.isInTail(this.snake.head)) {
|
||||
this.stopGame();
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this.snake.head.x > this.grid.length - 1 ||
|
||||
this.snake.head.x < 0 ||
|
||||
this.snake.head.y > this.grid[0].length - 1 ||
|
||||
this.snake.head.y < 0
|
||||
) {
|
||||
this.stopGame();
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw
|
||||
this.clearBoard();
|
||||
this.grid[this.fruit.x][this.fruit.y] = 'red';
|
||||
this.grid[this.snake.head.x][this.snake.head.y] = 'darkgreen';
|
||||
for (let tile of this.snake.tail) {
|
||||
this.grid[tile.x][tile.y] = 'green';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
16
Mobile/game-app/src/app/tab3/tab3-routing.module.ts
Normal file
16
Mobile/game-app/src/app/tab3/tab3-routing.module.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Tab3Page } from './tab3.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: Tab3Page,
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class Tab3PageRoutingModule {}
|
||||
18
Mobile/game-app/src/app/tab3/tab3.module.ts
Normal file
18
Mobile/game-app/src/app/tab3/tab3.module.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Tab3Page } from './tab3.page';
|
||||
|
||||
import { Tab3PageRoutingModule } from './tab3-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
Tab3PageRoutingModule
|
||||
],
|
||||
declarations: [Tab3Page]
|
||||
})
|
||||
export class Tab3PageModule {}
|
||||
40
Mobile/game-app/src/app/tab3/tab3.page.html
Normal file
40
Mobile/game-app/src/app/tab3/tab3.page.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<ion-header [translucent]="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
Minesweeper
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true" scroll-y="false">
|
||||
<ion-header collapse="condense">
|
||||
<ion-toolbar>
|
||||
<ion-title size="large">Minesweeper</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<section class="container">
|
||||
<div class="info">
|
||||
<span id="difficulty">Schwierigkeitsgrad: {{difficulty}}</span>
|
||||
<span id="game_result">{{gameResult}}</span>
|
||||
</div>
|
||||
|
||||
<div class="playground">
|
||||
<div class="row" *ngFor="let row of fields; let x = index;">
|
||||
<ion-button
|
||||
*ngFor="let field of row; let y = index;"
|
||||
[fill]="field.isRevealed ? 'outline' : 'solid'"
|
||||
(click)="click(x, y)">
|
||||
<span *ngIf="field.isFlag && !field.isRevealed">🚩</span>
|
||||
<span *ngIf="field.isRevealed">{{field.isBomb ? '💣' : field.bombCount}}</span>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<ion-button (click)="reset()">Neues Spiel</ion-button>
|
||||
<ion-button (click)="changeDifficulty()">Schwierigkeit ändern</ion-button>
|
||||
<ion-button (click)="changeMode()">Modus: {{mode}}</ion-button>
|
||||
</div>
|
||||
</section>
|
||||
</ion-content>
|
||||
17
Mobile/game-app/src/app/tab3/tab3.page.scss
Normal file
17
Mobile/game-app/src/app/tab3/tab3.page.scss
Normal file
@@ -0,0 +1,17 @@
|
||||
.container .playground {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(10, 1fr);
|
||||
gap: 1px;
|
||||
|
||||
.row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(10, 1fr);
|
||||
gap: 1px;
|
||||
|
||||
ion-button {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
147
Mobile/game-app/src/app/tab3/tab3.page.ts
Normal file
147
Mobile/game-app/src/app/tab3/tab3.page.ts
Normal file
@@ -0,0 +1,147 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
const rows: number = 10;
|
||||
const cols: number = 10;
|
||||
|
||||
@Component({
|
||||
selector: 'app-tab3',
|
||||
templateUrl: 'tab3.page.html',
|
||||
styleUrls: ['tab3.page.scss']
|
||||
})
|
||||
export class Tab3Page {
|
||||
public fields: {isBomb: boolean, isRevealed: boolean, bombCount: number, isFlag: boolean}[][] = [];
|
||||
public difficulty: string = "normal";
|
||||
public gameResult: string = "";
|
||||
public mode: string = "aufdecken"
|
||||
private firstMove: boolean = true;
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
this.fields = [];
|
||||
this.gameResult = "";
|
||||
this.firstMove = true;
|
||||
|
||||
for (let i = 0; i < cols; i++) {
|
||||
this.fields[i] = [];
|
||||
for (let j = 0; j < rows; j++) {
|
||||
const num = Math.random();
|
||||
|
||||
let isBomb: boolean = false;
|
||||
if (this.difficulty == "einfach") isBomb = num > 0.9;
|
||||
if (this.difficulty == "normal") isBomb = num > 0.8;
|
||||
if (this.difficulty == "schwer") isBomb = num > 0.7;
|
||||
|
||||
this.fields[i][j] = {isBomb, isRevealed: false, bombCount: 0, isFlag: false};
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < cols; i++) {
|
||||
for (let j = 0; j < rows; j++) {
|
||||
let bombCount = 0;
|
||||
|
||||
if (this.checkBomb(i - 1, j)) bombCount++;
|
||||
if (this.checkBomb(i + 1, j)) bombCount++;
|
||||
if (this.checkBomb(i, j + 1)) bombCount++;
|
||||
if (this.checkBomb(i, j - 1)) bombCount++;
|
||||
if (this.checkBomb(i - 1, j - 1)) bombCount++;
|
||||
if (this.checkBomb(i + 1, j + 1)) bombCount++;
|
||||
if (this.checkBomb(i - 1, j + 1)) bombCount++;
|
||||
if (this.checkBomb(i + 1, j - 1)) bombCount++;
|
||||
|
||||
this.fields[i][j].bombCount = bombCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private checkBomb(x: number, y: number): boolean {
|
||||
if (x < 0 || x >= rows) return false;
|
||||
if (y < 0 || y >= cols) return false;
|
||||
return this.fields[x][y].isBomb;
|
||||
}
|
||||
|
||||
public click(x: number, y: number): void {
|
||||
if (this.gameResult != "") return;
|
||||
|
||||
if (this.mode == "flagge") {
|
||||
if (this.fields[x][y].isRevealed) return;
|
||||
this.fields[x][y].isFlag = !this.fields[x][y].isFlag;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.firstMove) {
|
||||
while (this.fields[x][y].isBomb || this.fields[x][y].bombCount != 0) this.reset();
|
||||
this.firstMove = false;
|
||||
}
|
||||
|
||||
if (this.fields[x][y].isBomb) {
|
||||
this.gameResult = "Verloren";
|
||||
this.fields.forEach(field => field.forEach(f => f.isRevealed = true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fields[x][y].bombCount == 0) this.revealZeros(x, y);
|
||||
|
||||
this.fields[x][y].isRevealed = true;
|
||||
|
||||
for (let i = 0; i < cols; i++) {
|
||||
for (let j = 0; j < rows; j++) {
|
||||
if (!(this.fields[i][j].isBomb || this.fields[i][j].isRevealed)) return;
|
||||
}
|
||||
}
|
||||
this.gameResult = "Gewonnen";
|
||||
}
|
||||
|
||||
public revealZeros(x: number, y: number): void {
|
||||
if (x < 0 || x >= rows) return;
|
||||
if (y < 0 || y >= cols) return;
|
||||
if (this.fields[x][y].isRevealed || this.fields[x][y].isBomb) return;
|
||||
if (this.fields[x][y].bombCount > 1) return;
|
||||
|
||||
this.fields[x][y].isRevealed = true;
|
||||
|
||||
if (this.fields[x][y].bombCount != 0) return;
|
||||
this.revealZeros(x - 1, y);
|
||||
this.revealZeros(x + 1, y);
|
||||
this.revealZeros(x, y + 1);
|
||||
this.revealZeros(x, y - 1);
|
||||
this.revealZeros(x - 1, y - 1);
|
||||
this.revealZeros(x + 1, y + 1);
|
||||
this.revealZeros(x - 1, y + 1);
|
||||
this.revealZeros(x + 1, y - 1);
|
||||
}
|
||||
|
||||
public changeDifficulty(): void {
|
||||
switch (this.difficulty) {
|
||||
case "einfach":
|
||||
this.difficulty = "normal";
|
||||
break;
|
||||
|
||||
case "normal":
|
||||
this.difficulty = "schwer";
|
||||
break;
|
||||
|
||||
case "schwer":
|
||||
default:
|
||||
this.difficulty = "einfach";
|
||||
break;
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public changeMode(): void {
|
||||
switch (this.mode) {
|
||||
case "flagge":
|
||||
this.mode = "aufdecken";
|
||||
break;
|
||||
|
||||
case "aufdecken":
|
||||
default:
|
||||
this.mode = "flagge";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
39
Mobile/game-app/src/app/tabs/tabs-routing.module.ts
Normal file
39
Mobile/game-app/src/app/tabs/tabs-routing.module.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { TabsPage } from './tabs.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'tabs',
|
||||
component: TabsPage,
|
||||
children: [
|
||||
{
|
||||
path: 'tab1',
|
||||
loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
|
||||
},
|
||||
{
|
||||
path: 'tab2',
|
||||
loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
|
||||
},
|
||||
{
|
||||
path: 'tab3',
|
||||
loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/tabs/tab1',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/tabs/tab1',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
})
|
||||
export class TabsPageRoutingModule {}
|
||||
19
Mobile/game-app/src/app/tabs/tabs.module.ts
Normal file
19
Mobile/game-app/src/app/tabs/tabs.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { TabsPageRoutingModule } from './tabs-routing.module';
|
||||
|
||||
import { TabsPage } from './tabs.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
TabsPageRoutingModule
|
||||
],
|
||||
declarations: [TabsPage]
|
||||
})
|
||||
export class TabsPageModule {}
|
||||
20
Mobile/game-app/src/app/tabs/tabs.page.html
Normal file
20
Mobile/game-app/src/app/tabs/tabs.page.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<ion-tabs>
|
||||
|
||||
<ion-tab-bar slot="bottom">
|
||||
<ion-tab-button tab="tab1">
|
||||
<ion-icon name="triangle"></ion-icon>
|
||||
<ion-label>TicTacToe</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="tab2">
|
||||
<ion-icon name="ellipse"></ion-icon>
|
||||
<ion-label>Snake</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="tab3">
|
||||
<ion-icon name="square"></ion-icon>
|
||||
<ion-label>Minesweeper</ion-label>
|
||||
</ion-tab-button>
|
||||
</ion-tab-bar>
|
||||
|
||||
</ion-tabs>
|
||||
1
Mobile/game-app/src/app/tabs/tabs.page.scss
Normal file
1
Mobile/game-app/src/app/tabs/tabs.page.scss
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
12
Mobile/game-app/src/app/tabs/tabs.page.ts
Normal file
12
Mobile/game-app/src/app/tabs/tabs.page.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tabs',
|
||||
templateUrl: 'tabs.page.html',
|
||||
styleUrls: ['tabs.page.scss']
|
||||
})
|
||||
export class TabsPage {
|
||||
|
||||
constructor() {}
|
||||
|
||||
}
|
||||
BIN
Mobile/game-app/src/assets/icon/favicon.png
Normal file
BIN
Mobile/game-app/src/assets/icon/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 930 B |
1
Mobile/game-app/src/assets/shapes.svg
Normal file
1
Mobile/game-app/src/assets/shapes.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
3
Mobile/game-app/src/environments/environment.prod.ts
Normal file
3
Mobile/game-app/src/environments/environment.prod.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const environment = {
|
||||
production: true
|
||||
};
|
||||
16
Mobile/game-app/src/environments/environment.ts
Normal file
16
Mobile/game-app/src/environments/environment.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file can be replaced during build by using the `fileReplacements` array.
|
||||
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
||||
// The list of file replacements can be found in `angular.json`.
|
||||
|
||||
export const environment = {
|
||||
production: false
|
||||
};
|
||||
|
||||
/*
|
||||
* For easier debugging in development mode, you can import the following file
|
||||
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||
*
|
||||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
*/
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||
64
Mobile/game-app/src/global.scss
Normal file
64
Mobile/game-app/src/global.scss
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* App Global CSS
|
||||
* ----------------------------------------------------------------------------
|
||||
* Put style rules here that you want to apply globally. These styles are for
|
||||
* the entire app and not just one component. Additionally, this file can be
|
||||
* used as an entry point to import other CSS/Sass files to be included in the
|
||||
* output CSS.
|
||||
* For more information on global stylesheets, visit the documentation:
|
||||
* https://ionicframework.com/docs/layout/global-stylesheets
|
||||
*/
|
||||
|
||||
/* Core CSS required for Ionic components to work properly */
|
||||
@import "~@ionic/angular/css/core.css";
|
||||
|
||||
/* Basic CSS for apps built with Ionic */
|
||||
@import "~@ionic/angular/css/normalize.css";
|
||||
@import "~@ionic/angular/css/structure.css";
|
||||
@import "~@ionic/angular/css/typography.css";
|
||||
@import '~@ionic/angular/css/display.css';
|
||||
|
||||
/* Optional CSS utils that can be commented out */
|
||||
@import "~@ionic/angular/css/padding.css";
|
||||
@import "~@ionic/angular/css/float-elements.css";
|
||||
@import "~@ionic/angular/css/text-alignment.css";
|
||||
@import "~@ionic/angular/css/text-transformation.css";
|
||||
@import "~@ionic/angular/css/flex-utils.css";
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
|
||||
#game_result {
|
||||
font-weight: bold;
|
||||
height: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
.playground {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
|
||||
ion-button {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
26
Mobile/game-app/src/index.html
Normal file
26
Mobile/game-app/src/index.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Ionic App</title>
|
||||
|
||||
<base href="/" />
|
||||
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
|
||||
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
|
||||
|
||||
<!-- add to homescreen for ios -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
12
Mobile/game-app/src/main.ts
Normal file
12
Mobile/game-app/src/main.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.log(err));
|
||||
53
Mobile/game-app/src/polyfills.ts
Normal file
53
Mobile/game-app/src/polyfills.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||
* You can add your own extra polyfills to this file.
|
||||
*
|
||||
* This file is divided into 2 sections:
|
||||
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||
* file.
|
||||
*
|
||||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||
* automatically update themselves. This includes recent versions of Safari, Chrome (including
|
||||
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
|
||||
*
|
||||
* Learn more in https://angular.io/guide/browser-support
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||
* will put import in the top of bundle, so user need to create a separate file
|
||||
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||
* into that file, and then add the following code before importing zone.js.
|
||||
* import './zone-flags';
|
||||
*
|
||||
* The flags allowed in zone-flags.ts are listed here.
|
||||
*
|
||||
* The following flags will work for all browsers.
|
||||
*
|
||||
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||
*
|
||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||
*
|
||||
* (window as any).__Zone_enable_cross_context_check = true;
|
||||
*
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js'; // Included with Angular CLI.
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
||||
14
Mobile/game-app/src/test.ts
Normal file
14
Mobile/game-app/src/test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting(),
|
||||
);
|
||||
236
Mobile/game-app/src/theme/variables.scss
Normal file
236
Mobile/game-app/src/theme/variables.scss
Normal file
@@ -0,0 +1,236 @@
|
||||
// Ionic Variables and Theming. For more info, please see:
|
||||
// http://ionicframework.com/docs/theming/
|
||||
|
||||
/** Ionic CSS Variables **/
|
||||
:root {
|
||||
/** primary **/
|
||||
--ion-color-primary: #3880FF;
|
||||
--ion-color-primary-rgb: 56, 128, 255;
|
||||
--ion-color-primary-contrast: #ffffff;
|
||||
--ion-color-primary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-primary-shade: #3171e0;
|
||||
--ion-color-primary-tint: #4c8dff;
|
||||
|
||||
/** secondary **/
|
||||
--ion-color-secondary: #3dc2ff;
|
||||
--ion-color-secondary-rgb: 61, 194, 255;
|
||||
--ion-color-secondary-contrast: #ffffff;
|
||||
--ion-color-secondary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-secondary-shade: #36abe0;
|
||||
--ion-color-secondary-tint: #50c8ff;
|
||||
|
||||
/** tertiary **/
|
||||
--ion-color-tertiary: #5260ff;
|
||||
--ion-color-tertiary-rgb: 82, 96, 255;
|
||||
--ion-color-tertiary-contrast: #ffffff;
|
||||
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-tertiary-shade: #4854e0;
|
||||
--ion-color-tertiary-tint: #6370ff;
|
||||
|
||||
/** success **/
|
||||
--ion-color-success: #2dd36f;
|
||||
--ion-color-success-rgb: 45, 211, 111;
|
||||
--ion-color-success-contrast: #ffffff;
|
||||
--ion-color-success-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-success-shade: #28ba62;
|
||||
--ion-color-success-tint: #42d77d;
|
||||
|
||||
/** warning **/
|
||||
--ion-color-warning: #ffc409;
|
||||
--ion-color-warning-rgb: 255, 196, 9;
|
||||
--ion-color-warning-contrast: #000000;
|
||||
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
||||
--ion-color-warning-shade: #e0ac08;
|
||||
--ion-color-warning-tint: #ffca22;
|
||||
|
||||
/** danger **/
|
||||
--ion-color-danger: #eb445a;
|
||||
--ion-color-danger-rgb: 235, 68, 90;
|
||||
--ion-color-danger-contrast: #ffffff;
|
||||
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-danger-shade: #cf3c4f;
|
||||
--ion-color-danger-tint: #ed576b;
|
||||
|
||||
/** dark **/
|
||||
--ion-color-dark: #222428;
|
||||
--ion-color-dark-rgb: 34, 36, 40;
|
||||
--ion-color-dark-contrast: #ffffff;
|
||||
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-dark-shade: #1e2023;
|
||||
--ion-color-dark-tint: #383a3e;
|
||||
|
||||
/** medium **/
|
||||
--ion-color-medium: #92949c;
|
||||
--ion-color-medium-rgb: 146, 148, 156;
|
||||
--ion-color-medium-contrast: #ffffff;
|
||||
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-medium-shade: #808289;
|
||||
--ion-color-medium-tint: #9d9fa6;
|
||||
|
||||
/** light **/
|
||||
--ion-color-light: #f4f5f8;
|
||||
--ion-color-light-rgb: 244, 245, 248;
|
||||
--ion-color-light-contrast: #000000;
|
||||
--ion-color-light-contrast-rgb: 0, 0, 0;
|
||||
--ion-color-light-shade: #d7d8da;
|
||||
--ion-color-light-tint: #f5f6f9;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
/*
|
||||
* Dark Colors
|
||||
* -------------------------------------------
|
||||
*/
|
||||
|
||||
body {
|
||||
--ion-color-primary: #afccff;
|
||||
--ion-color-primary-rgb: 175, 204, 255;
|
||||
--ion-color-primary-contrast: #000000;
|
||||
--ion-color-primary-contrast-rgb: 0, 0, 0;
|
||||
--ion-color-primary-shade: #9ab4e0;
|
||||
--ion-color-primary-tint: #b7d1ff;
|
||||
|
||||
--ion-color-secondary: #50c8ff;
|
||||
--ion-color-secondary-rgb: 80,200,255;
|
||||
--ion-color-secondary-contrast: #ffffff;
|
||||
--ion-color-secondary-contrast-rgb: 255,255,255;
|
||||
--ion-color-secondary-shade: #46b0e0;
|
||||
--ion-color-secondary-tint: #62ceff;
|
||||
|
||||
--ion-color-tertiary: #6a64ff;
|
||||
--ion-color-tertiary-rgb: 106,100,255;
|
||||
--ion-color-tertiary-contrast: #ffffff;
|
||||
--ion-color-tertiary-contrast-rgb: 255,255,255;
|
||||
--ion-color-tertiary-shade: #5d58e0;
|
||||
--ion-color-tertiary-tint: #7974ff;
|
||||
|
||||
--ion-color-success: #2fdf75;
|
||||
--ion-color-success-rgb: 47,223,117;
|
||||
--ion-color-success-contrast: #000000;
|
||||
--ion-color-success-contrast-rgb: 0,0,0;
|
||||
--ion-color-success-shade: #29c467;
|
||||
--ion-color-success-tint: #44e283;
|
||||
|
||||
--ion-color-warning: #ffd534;
|
||||
--ion-color-warning-rgb: 255,213,52;
|
||||
--ion-color-warning-contrast: #000000;
|
||||
--ion-color-warning-contrast-rgb: 0,0,0;
|
||||
--ion-color-warning-shade: #e0bb2e;
|
||||
--ion-color-warning-tint: #ffd948;
|
||||
|
||||
--ion-color-danger: #ff4961;
|
||||
--ion-color-danger-rgb: 255,73,97;
|
||||
--ion-color-danger-contrast: #ffffff;
|
||||
--ion-color-danger-contrast-rgb: 255,255,255;
|
||||
--ion-color-danger-shade: #e04055;
|
||||
--ion-color-danger-tint: #ff5b71;
|
||||
|
||||
--ion-color-dark: #f4f5f8;
|
||||
--ion-color-dark-rgb: 244,245,248;
|
||||
--ion-color-dark-contrast: #000000;
|
||||
--ion-color-dark-contrast-rgb: 0,0,0;
|
||||
--ion-color-dark-shade: #d7d8da;
|
||||
--ion-color-dark-tint: #f5f6f9;
|
||||
|
||||
--ion-color-medium: #989aa2;
|
||||
--ion-color-medium-rgb: 152,154,162;
|
||||
--ion-color-medium-contrast: #000000;
|
||||
--ion-color-medium-contrast-rgb: 0,0,0;
|
||||
--ion-color-medium-shade: #86888f;
|
||||
--ion-color-medium-tint: #a2a4ab;
|
||||
|
||||
--ion-color-light: #222428;
|
||||
--ion-color-light-rgb: 34,36,40;
|
||||
--ion-color-light-contrast: #ffffff;
|
||||
--ion-color-light-contrast-rgb: 255,255,255;
|
||||
--ion-color-light-shade: #1e2023;
|
||||
--ion-color-light-tint: #383a3e;
|
||||
}
|
||||
|
||||
/*
|
||||
* iOS Dark Theme
|
||||
* -------------------------------------------
|
||||
*/
|
||||
|
||||
.ios body {
|
||||
--ion-background-color: #000000;
|
||||
--ion-background-color-rgb: 0,0,0;
|
||||
|
||||
--ion-text-color: #ffffff;
|
||||
--ion-text-color-rgb: 255,255,255;
|
||||
|
||||
--ion-color-step-50: #0d0d0d;
|
||||
--ion-color-step-100: #1a1a1a;
|
||||
--ion-color-step-150: #262626;
|
||||
--ion-color-step-200: #333333;
|
||||
--ion-color-step-250: #404040;
|
||||
--ion-color-step-300: #4d4d4d;
|
||||
--ion-color-step-350: #595959;
|
||||
--ion-color-step-400: #666666;
|
||||
--ion-color-step-450: #737373;
|
||||
--ion-color-step-500: #808080;
|
||||
--ion-color-step-550: #8c8c8c;
|
||||
--ion-color-step-600: #999999;
|
||||
--ion-color-step-650: #a6a6a6;
|
||||
--ion-color-step-700: #b3b3b3;
|
||||
--ion-color-step-750: #bfbfbf;
|
||||
--ion-color-step-800: #cccccc;
|
||||
--ion-color-step-850: #d9d9d9;
|
||||
--ion-color-step-900: #e6e6e6;
|
||||
--ion-color-step-950: #f2f2f2;
|
||||
|
||||
--ion-item-background: #000000;
|
||||
|
||||
--ion-card-background: #1c1c1d;
|
||||
}
|
||||
|
||||
.ios ion-modal {
|
||||
--ion-background-color: var(--ion-color-step-100);
|
||||
--ion-toolbar-background: var(--ion-color-step-150);
|
||||
--ion-toolbar-border-color: var(--ion-color-step-250);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Material Design Dark Theme
|
||||
* -------------------------------------------
|
||||
*/
|
||||
|
||||
.md body {
|
||||
--ion-background-color: #121212;
|
||||
--ion-background-color-rgb: 18,18,18;
|
||||
|
||||
--ion-text-color: #ffffff;
|
||||
--ion-text-color-rgb: 255,255,255;
|
||||
|
||||
--ion-border-color: #222222;
|
||||
|
||||
--ion-color-step-50: #1e1e1e;
|
||||
--ion-color-step-100: #2a2a2a;
|
||||
--ion-color-step-150: #363636;
|
||||
--ion-color-step-200: #414141;
|
||||
--ion-color-step-250: #4d4d4d;
|
||||
--ion-color-step-300: #595959;
|
||||
--ion-color-step-350: #656565;
|
||||
--ion-color-step-400: #717171;
|
||||
--ion-color-step-450: #7d7d7d;
|
||||
--ion-color-step-500: #898989;
|
||||
--ion-color-step-550: #949494;
|
||||
--ion-color-step-600: #a0a0a0;
|
||||
--ion-color-step-650: #acacac;
|
||||
--ion-color-step-700: #b8b8b8;
|
||||
--ion-color-step-750: #c4c4c4;
|
||||
--ion-color-step-800: #d0d0d0;
|
||||
--ion-color-step-850: #dbdbdb;
|
||||
--ion-color-step-900: #e7e7e7;
|
||||
--ion-color-step-950: #f3f3f3;
|
||||
|
||||
--ion-item-background: #1e1e1e;
|
||||
|
||||
--ion-toolbar-background: #1f1f1f;
|
||||
|
||||
--ion-tab-bar-background: #1f1f1f;
|
||||
|
||||
--ion-card-background: #1e1e1e;
|
||||
}
|
||||
}
|
||||
6
Mobile/game-app/src/zone-flags.ts
Normal file
6
Mobile/game-app/src/zone-flags.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Prevents Angular change detection from
|
||||
* running with certain Web Component callbacks
|
||||
*/
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
(window as any).__Zone_disable_customElements = true;
|
||||
15
Mobile/game-app/tsconfig.app.json
Normal file
15
Mobile/game-app/tsconfig.app.json
Normal file
@@ -0,0 +1,15 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/app",
|
||||
"types": []
|
||||
},
|
||||
"files": [
|
||||
"src/main.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
33
Mobile/game-app/tsconfig.json
Normal file
33
Mobile/game-app/tsconfig.json
Normal file
@@ -0,0 +1,33 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"outDir": "./dist/out-tsc",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"downlevelIteration": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"importHelpers": true,
|
||||
"target": "es2015",
|
||||
"module": "es2020",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"dom"
|
||||
],
|
||||
"useDefineForClassFields": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
"strictInjectionParameters": true,
|
||||
"strictInputAccessModifiers": true,
|
||||
"strictTemplates": true
|
||||
}
|
||||
}
|
||||
18
Mobile/game-app/tsconfig.spec.json
Normal file
18
Mobile/game-app/tsconfig.spec.json
Normal file
@@ -0,0 +1,18 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/test.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user