initial commit

This commit is contained in:
Sascha Kuehl 2025-02-13 20:34:17 +01:00
commit 666cb60eaa
96 changed files with 11994 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea/
node_modules/

6
app/.browserslistrc Normal file
View File

@ -0,0 +1,6 @@
Chrome >=79
ChromeAndroid >=79
Firefox >=70
Edge >=79
Safari >=14
iOS >=14

27
app/.eslintignore Normal file
View File

@ -0,0 +1,27 @@
.DS_Store
node_modules
/coverage
/dist
/ios
/android
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

20
app/.eslintrc.cjs Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-deprecated-slot-attribute': 'off',
'@typescript-eslint/no-explicit-any': 'off',
}
}

32
app/.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
.tmp
*.tmp
*.tmp.*
*.sublime-project
*.sublime-workspace
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
$RECYCLE.BIN/
*.log
log.txt
npm-debug.log*
/.idea
/.ionic
/.sass-cache
/.sourcemaps
/.versions
/.vscode/*
!/.vscode/extensions.json
/coverage
/dist
/node_modules
/platforms
/plugins
/www

5
app/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"ionic.ionic"
]
}

101
app/android/.gitignore vendored Normal file
View File

@ -0,0 +1,101 @@
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
# Android Profiling
*.hprof
# Cordova plugins for Capacitor
capacitor-cordova-android-plugins
# Copied web assets
app/src/main/assets/public
# Generated Config files
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml

8
app/android/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
<file type="web" url="file://$PROJECT_DIR$/../node_modules/@capacitor/android/capacitor" />
<file type="web" url="file://$PROJECT_DIR$/../node_modules/@capacitor/app/android" />
<file type="web" url="file://$PROJECT_DIR$/../node_modules/@capacitor/haptics/android" />
<file type="web" url="file://$PROJECT_DIR$/../node_modules/@capacitor/keyboard/android" />
<file type="web" url="file://$PROJECT_DIR$/../node_modules/@capacitor/status-bar/android" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
</set>
</option>
</component>
</project>

2
app/android/app/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build/*
!/build/.npmkeep

View File

@ -0,0 +1,54 @@
apply plugin: 'com.android.application'
android {
namespace "io.ionic.starter"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "io.ionic.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}

View File

@ -0,0 +1,22 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-status-bar')
}
if (hasProperty('postBuildExtras')) {
postBuildExtras()
}

21
app/android/app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,26 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.getcapacitor.app", appContext.getPackageName());
}
}

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

View File

@ -0,0 +1,5 @@
package io.ionic.starter;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">app</string>
<string name="title_activity_main">app</string>
<string name="package_name">io.ionic.starter</string>
<string name="custom_url_scheme">io.ionic.starter</string>
</resources>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="." />
<cache-path name="my_cache_images" path="." />
</paths>

View File

@ -0,0 +1,18 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}

29
app/android/build.gradle Normal file
View File

@ -0,0 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.google.gms:google-services:4.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

View File

@ -0,0 +1,15 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

View File

@ -0,0 +1,22 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

Binary file not shown.

View File

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

248
app/android/gradlew vendored Executable file
View File

@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
app/android/gradlew.bat vendored Normal file
View File

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,5 @@
include ':app'
include ':capacitor-cordova-android-plugins'
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
apply from: 'capacitor.settings.gradle'

View File

@ -0,0 +1,16 @@
ext {
minSdkVersion = 22
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.6.2'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.9.0'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
}

9
app/capacitor.config.ts Normal file
View File

@ -0,0 +1,9 @@
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'app',
webDir: 'dist'
};
export default config;

15
app/cypress.config.ts Normal file
View File

@ -0,0 +1,15 @@
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
supportFile: 'tests/e2e/support/e2e.{js,jsx,ts,tsx}',
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
videosFolder: 'tests/e2e/videos',
screenshotsFolder: 'tests/e2e/screenshots',
baseUrl: 'http://localhost:5173',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

31
app/index.html Normal file
View File

@ -0,0 +1,31 @@
<!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="shortcut icon" type="image/png" href="/favicon.png" />
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Ionic App" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

7
app/ionic.config.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "app",
"integrations": {
"capacitor": {}
},
"type": "vue-vite"
}

9649
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

44
app/package.json Normal file
View File

@ -0,0 +1,44 @@
{
"name": "app",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"test:e2e": "cypress run",
"test:unit": "vitest",
"lint": "eslint ."
},
"dependencies": {
"@capacitor/android": "6.1.2",
"@capacitor/app": "6.0.1",
"@capacitor/core": "6.1.2",
"@capacitor/haptics": "6.0.1",
"@capacitor/keyboard": "6.0.2",
"@capacitor/status-bar": "6.0.1",
"@ionic/vue": "^8.0.0",
"@ionic/vue-router": "^8.0.0",
"ionicons": "^7.0.0",
"vue": "^3.3.0",
"vue-router": "^4.2.0"
},
"devDependencies": {
"@capacitor/cli": "6.1.2",
"@vitejs/plugin-legacy": "^5.0.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/test-utils": "^2.3.0",
"cypress": "^13.5.0",
"eslint": "^8.35.0",
"eslint-plugin-vue": "^9.9.0",
"jsdom": "^22.1.0",
"terser": "^5.4.0",
"typescript": "^5.1.6",
"vite": "~5.2.0",
"vitest": "^0.34.6",
"vue-tsc": "^2.0.22"
},
"description": "An Ionic project"
}

BIN
app/public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

9
app/src/App.vue Normal file
View File

@ -0,0 +1,9 @@
<template>
<ion-app>
<ion-router-outlet />
</ion-app>
</template>
<script setup lang="ts">
import { IonApp, IonRouterOutlet } from '@ionic/vue';
</script>

View File

@ -0,0 +1,59 @@
import PitchType from "@/types/PitchType";
export const pitchTypes: Map<number, PitchType> = new Map([
[
1,
{
id: 1,
name: 'Fastball',
abbreviation: 'FB'
}
],
[
2,
{
id: 2,
name: 'Curveball',
abbreviation: 'CB'
}
],
[
3,
{
id: 3,
name: 'Slider',
abbreviation: 'SL'
}
],
[
4,
{
id: 4,
name: 'Changeup',
abbreviation: 'CH'
}
],
[
5,
{
id: 5,
name: 'Cutter',
abbreviation: 'CUT'
}
],
[
6,
{
id: 6,
name: 'Sweeper',
abbreviation: 'SW'
}
],
[
7,
{
id: 7,
name: 'Slurve',
abbreviation: 'SLV'
}
]]);

93
app/src/data/pitchers.ts Normal file
View File

@ -0,0 +1,93 @@
import Pitcher from "@/types/Pitcher";
export const pitchers: Map<number, Pitcher> = new Map([
[
1,
{
id: 1,
first_name: "Nolan",
last_name: "Ryan",
date_of_birth: new Date("1947-01-31")
}
],
[
2,
{
id: 2,
first_name: "Sandy",
last_name: "Koufax",
date_of_birth: new Date("1935-12-30")
}
],
[
3,
{
id: 3,
first_name: "Pedro",
last_name: "Martinez",
date_of_birth: new Date("1971-10-25")
}
],
[
4,
{
id: 4,
first_name: "Randy",
last_name: "Johnson",
date_of_birth: new Date("1963-09-10")
}
],
[
5,
{
id: 5,
first_name: "Greg",
last_name: "Maddux",
date_of_birth: new Date("1966-04-14")
}
],
[
6,
{
id: 6,
first_name: "Bob",
last_name: "Gibson",
date_of_birth: new Date("1935-11-09")
}
],
[
7,
{
id: 7,
first_name: "Tom",
last_name: "Seaver",
date_of_birth: new Date("1944-11-17")
}
],
[
8,
{
id: 8,
first_name: "Roger",
last_name: "Clemens",
date_of_birth: new Date("1962-08-04")
}
],
[
9,
{
id: 9,
first_name: "Walter",
last_name: "Johnson",
date_of_birth: new Date("1887-11-06")
}
],
[
10,
{
id: 10,
first_name: "Clayton",
last_name: "Kershaw",
date_of_birth: new Date("1988-03-19")
}
]]);

43
app/src/main.ts Normal file
View File

@ -0,0 +1,43 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router';
import { IonicVue } from '@ionic/vue';
/* Core CSS required for Ionic components to work properly */
import '@ionic/vue/css/core.css';
/* Basic CSS for apps built with Ionic */
import '@ionic/vue/css/normalize.css';
import '@ionic/vue/css/structure.css';
import '@ionic/vue/css/typography.css';
/* Optional CSS utils that can be commented out */
import '@ionic/vue/css/padding.css';
import '@ionic/vue/css/float-elements.css';
import '@ionic/vue/css/text-alignment.css';
import '@ionic/vue/css/text-transformation.css';
import '@ionic/vue/css/flex-utils.css';
import '@ionic/vue/css/display.css';
/**
* Ionic Dark Mode
* -----------------------------------------------------
* For more info, please see:
* https://ionicframework.com/docs/theming/dark-mode
*/
/* @import '@ionic/vue/css/palettes/dark.always.css'; */
/* @import '@ionic/vue/css/palettes/dark.class.css'; */
import '@ionic/vue/css/palettes/dark.system.css';
/* Theme variables */
import './theme/variables.css';
const app = createApp(App)
.use(IonicVue)
.use(router);
router.isReady().then(() => {
app.mount('#app');
});

36
app/src/router/index.ts Normal file
View File

@ -0,0 +1,36 @@
import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import PitcherList from '../views/PitcherList.vue'
import PreparePitch from "@/views/PreparePitch.vue";
import FinalizePitch from "@/views/FinalizePitch.vue";
import BullpenStats from "@/views/BullpenStats.vue";
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/pitchers'
}, {
path: '/pitchers',
name: 'Pitchers',
component: PitcherList
}, {
path: '/prepare',
name: 'PreparePitch',
component: PreparePitch
}, {
path: '/finalize',
name: 'FinalizePitch',
component: FinalizePitch
}, {
path: '/stats',
name: 'BullpenStats',
component: BullpenStats
}
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes
})
export default router

View File

@ -0,0 +1,90 @@
import BullpenPitch from "@/types/BullpenPitch";
import Pitcher from "@/types/Pitcher";
import PitchType from "@/types/PitchType";
export class BullpenSessionService {
private static instance: BullpenSessionService;
private static nullPitcher: Pitcher = {
id: 0,
first_name: "",
last_name: "",
date_of_birth: new Date(0)
};
private static nullPitchType: PitchType = {
id: 0,
name: "",
abbreviation: ""
}
private constructor() {
this.currentPitch = this.createPitch();
}
// Static method to get the instance of the service
public static getInstance(): BullpenSessionService {
if (!BullpenSessionService.instance) {
BullpenSessionService.instance = new BullpenSessionService();
}
return BullpenSessionService.instance;
}
public startSession(pitcher: Pitcher): void {
this.pitcher = pitcher;
this.pitches = [];
this.currentPitch = this.createPitch();
}
public clear(): void {
this.pitcher = BullpenSessionService.nullPitcher;
this.pitches = [];
}
public finishSession(): void {
// Todo: save to backend
}
public cancelSession(): void {
this.pitches = [];
this.pitcher = BullpenSessionService.nullPitcher;
}
public addBullpenPitch( bullpenPitch: BullpenPitch ): void {
this.pitches.push( bullpenPitch );
}
public getBullpenPitches(): BullpenPitch[] {
return this.pitches;
}
public currentBullpenPitch(): BullpenPitch {
return this.currentPitch;
}
public nextPitch(): void {
this.pitches.push(this.currentBullpenPitch());
this.currentPitch = this.createPitch();
}
public getPitcher(): Pitcher {
return this.pitcher;
}
public isSessionStarted(): boolean {
return this.pitcher.id === 0;
}
private createPitch(): BullpenPitch {
return {
id: 0,
date: new Date(),
pitchType: BullpenSessionService.nullPitchType,
plannedPitchArea: 0,
realPitchArea: 0,
realPitchSubArea: 0
}
}
private pitches: BullpenPitch[] = [];
private pitcher: Pitcher = BullpenSessionService.nullPitcher;
private currentPitch: BullpenPitch;
}
export const bullpenSessionService = BullpenSessionService.getInstance();

View File

@ -0,0 +1,31 @@
import {pitchTypes} from "@/data/pitchTypes";
import PitchType from "@/types/PitchType";
class PitchTypeService {
private static instance: PitchTypeService;
private constructor() {}
// Static method to get the instance of the service
public static getInstance(): PitchTypeService {
if (!PitchTypeService.instance) {
PitchTypeService.instance = new PitchTypeService();
}
return PitchTypeService.instance;
}
async getAllPitchTypes(): Promise<PitchType[]> {
return pitchTypes.values().toArray();
}
async getPitchType(id: number): Promise<PitchType> {
const pitcher = pitchTypes.get(id);
if (pitcher !== undefined) {
return pitcher;
} else {
return Promise.reject();
}
}
}
export const pitchTypeService = PitchTypeService.getInstance();

View File

@ -0,0 +1,31 @@
import Pitcher from "@/types/Pitcher";
import {pitchers} from "@/data/pitchers";
class PitcherService {
private static instance: PitcherService;
private constructor() {}
// Static method to get the instance of the service
public static getInstance(): PitcherService {
if (!PitcherService.instance) {
PitcherService.instance = new PitcherService();
}
return PitcherService.instance;
}
async getAllPitchers(): Promise<Pitcher[]> {
return pitchers.values().toArray();
}
async getPitcher(id: number): Promise<Pitcher> {
const pitcher = pitchers.get(id);
if (pitcher !== undefined) {
return pitcher;
} else {
return Promise.reject();
}
}
}
export const pitcherService = PitcherService.getInstance();

View File

@ -0,0 +1,2 @@
/* For information on how to create your own theme, please see:
http://ionicframework.com/docs/theming/ */

View File

@ -0,0 +1,10 @@
import PitchType from "@/types/PitchType";
export default interface BullpenPitch {
id: number,
date: Date,
pitchType: PitchType,
plannedPitchArea: number,
realPitchArea: number,
realPitchSubArea: number
}

View File

@ -0,0 +1,5 @@
export default interface PitchType {
id: number,
name: string,
abbreviation: string
}

6
app/src/types/Pitcher.ts Normal file
View File

@ -0,0 +1,6 @@
export default interface Pitcher {
id: number,
first_name: string,
last_name: string,
date_of_birth: Date,
}

View File

@ -0,0 +1,94 @@
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Bullpen Stats for {{ bps.getPitcher().first_name }} {{ bps.getPitcher().last_name }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card v-for="(pitch, index) in bps.getBullpenPitches()" :key="index">
<ion-card-header>
<ion-card-title>Pitch {{index+1}}</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-list>
<ion-item>
<ion-label>Pitch Type</ion-label>
<ion-badge>{{pitch.pitchType.name}}</ion-badge>
</ion-item>
<ion-item>
<ion-label>Planned Pitch Area</ion-label>
<ion-badge>{{pitch.plannedPitchArea}}</ion-badge>
</ion-item>
<ion-item>
<ion-label>Real Pitch Area</ion-label>
<ion-badge>{{pitch.realPitchArea}}</ion-badge>
</ion-item>
</ion-list>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<ion-button expand="full" color="success" @click="gotoPitcherList">Goto Pitcher List</ion-button>
</ion-footer>
</ion-page>
</template>
<script lang="ts">
import {
IonButton,
IonBadge,
IonLabel,
IonList,
IonItem,
IonFooter,
IonCard,
IonCardHeader,
IonCardTitle,
IonCardContent,
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar
} from '@ionic/vue';
import {defineComponent, ref} from 'vue'
import {useRouter} from 'vue-router';
import {BullpenSessionService, bullpenSessionService} from "@/services/BullpenSessionService";
export default defineComponent({
name: 'BullpenStats',
components: {
IonButton,
IonBadge,
IonFooter,
IonLabel,
IonList,
IonItem,
IonPage,
IonCard,
IonCardHeader,
IonCardTitle,
IonCardContent,
IonContent,
IonHeader,
IonToolbar,
IonTitle,
},
setup() {
const router = useRouter();
const bps = ref<BullpenSessionService>(bullpenSessionService);
const gotoPitcherList = () => {
router.push({ name: 'Pitchers' });
}
return {bps, gotoPitcherList};
}
});
</script>
<style scoped>
</style>

View File

@ -0,0 +1,180 @@
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Finalize Pitch for {{ bps.getPitcher().first_name }} {{ bps.getPitcher().last_name }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header>
<ion-card-title>Select Real Pitch Hit Area</ion-card-title>
</ion-card-header>
<ion-card-content>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360">
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 21}" class="wasted" points="0,0 105,0 105,60 60,60 60,105 0,105" @click="setRealPitchArea(21)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 22}" class="wasted" x="105" y="0" width="150" height="60" @click="setRealPitchArea(22)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 23}" class="wasted" points="255,0 360,0 360,105 300,105 300,60, 255,60" @click="setRealPitchArea(23)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 24}" class="wasted" x="0" y="105" width="60" height="150" @click="setRealPitchArea(24)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 25}" class="wasted" x="300" y="105" width="60" height="150" @click="setRealPitchArea(25)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 26}" class="wasted" points="0,255 60,255 60,300 105,300 105,360 0,360" @click="setRealPitchArea(26)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 27}" class="wasted" x="105" y="300" width="150" height="60" @click="setRealPitchArea(27)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().realPitchArea === 28}" class="wasted" points="255,300 300,300 300,255 360,255 360,360 255,360" @click="setRealPitchArea(28)" />
<text x="30" y="40" class="number" @click="setRealPitchArea(21)" >21</text>
<text x="180" y="40" class="number" @click="setRealPitchArea(22)" >22</text>
<text x="330" y="40" class="number" @click="setRealPitchArea(23)" >23</text>
<text x="30" y="190" class="number" @click="setRealPitchArea(24)" >24</text>
<text x="330" y="190" class="number" @click="setRealPitchArea(25)" >25</text>
<text x="30" y="330" class="number" @click="setRealPitchArea(26)" >26</text>
<text x="180" y="330" class="number" @click="setRealPitchArea(27)" >27</text>
<text x="330" y="330" class="number" @click="setRealPitchArea(28)" >28</text>
<polygon :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 11}" class="edge" points="60,60 155,60 155,105 105,105 105,155, 60,155" @click="setRealPitchArea(11)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 12}" class="edge" x="155" y="60" width="50" height="45" @click="setRealPitchArea(12)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 13}" class="edge" points="205,60 300,60 300,155 255,155 255,105, 205,105" @click="setRealPitchArea(13)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 14}" class="edge" x="60" y="155" width="45" height="50" @click="setRealPitchArea(14)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 15}" class="edge" x="255" y="155" width="45" height="50" @click="setRealPitchArea(15)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 16}" class="edge" points="60,205 105,205 105,255 155,255 155,300, 60,300" @click="setRealPitchArea(16)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 17}" class="edge" x="155" y="255" width="50" height="45" @click="setRealPitchArea(17)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().realPitchArea === 18}" class="edge" points="205,255 255,255 255,205 300,205 300,300 205,300" @click="setRealPitchArea(18)" />
<text x="80" y="90" class="number" @click="setRealPitchArea(11)">11</text>
<text x="180" y="90" class="number" @click="setRealPitchArea(12)">12</text>
<text x="275" y="90" class="number" @click="setRealPitchArea(13)">13</text>
<text x="80" y="190" class="number" @click="setRealPitchArea(14)">14</text>
<text x="275" y="190" class="number" @click="setRealPitchArea(15)">15</text>
<text x="80" y="285" class="number" @click="setRealPitchArea(16)">16</text>
<text x="180" y="285" class="number" @click="setRealPitchArea(17)">17</text>
<text x="275" y="285" class="number" @click="setRealPitchArea(18)">18</text>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 1}" class="inside" x="105" y="105" width="50" height="50" @click="setRealPitchArea(1)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 2}" class="inside" x="155" y="105" width="50" height="50" @click="setRealPitchArea(2)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 3}" class="inside" x="205" y="105" width="50" height="50" @click="setRealPitchArea(3)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 4}" class="inside" x="105" y="155" width="50" height="50" @click="setRealPitchArea(4)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 5}" class="inside" x="155" y="155" width="50" height="50" @click="setRealPitchArea(5)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 6}" class="inside" x="205" y="155" width="50" height="50" @click="setRealPitchArea(6)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 7}" class="inside" x="105" y="205" width="50" height="50" @click="setRealPitchArea(7)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 8}" class="inside" x="155" y="205" width="50" height="50" @click="setRealPitchArea(8)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().realPitchArea === 9}" class="inside" x="205" y="205" width="50" height="50" @click="setRealPitchArea(9)"/>
<text x="130" y="140" class="number" @click="setRealPitchArea(1)">1</text>
<text x="180" y="140" class="number" @click="setRealPitchArea(2)">2</text>
<text x="230" y="140" class="number" @click="setRealPitchArea(3)">3</text>
<text x="130" y="190" class="number" @click="setRealPitchArea(4)">4</text>
<text x="180" y="190" class="number" @click="setRealPitchArea(5)">5</text>
<text x="230" y="190" class="number" @click="setRealPitchArea(6)">6</text>
<text x="130" y="240" class="number" @click="setRealPitchArea(7)">7</text>
<text x="180" y="240" class="number" @click="setRealPitchArea(8)">8</text>
<text x="230" y="240" class="number" @click="setRealPitchArea(9)">9</text>
</svg>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<ion-grid>
<ion-row>
<ion-col><ion-button color="success" expand="full" @click="finalizeAndNextPitch" :disabled="bps.currentBullpenPitch().realPitchArea === 0">Save Pitch<br/>&<br/>Next Pitch</ion-button></ion-col>
<ion-col><ion-button color="success" expand="full" @click="finalizeAndEndBullpen" :disabled="bps.currentBullpenPitch().realPitchArea === 0">Save Pitch<br/>&<br/>End Session</ion-button></ion-col>
</ion-row>
</ion-grid>
</ion-footer>
</ion-page>
</template>
<script lang="ts">
import {defineComponent, ref} from "vue";
import {
IonContent,
IonHeader,
IonFooter,
IonToolbar,
IonTitle,
IonPage,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle, IonButton,
IonGrid, IonRow, IonCol
} from "@ionic/vue";
import {BullpenSessionService, bullpenSessionService} from "@/services/BullpenSessionService";
import {useRouter} from "vue-router";
export default defineComponent({
name: "FinalizePitch",
components: {
IonButton,
IonPage,
IonFooter,
IonContent,
IonHeader,
IonToolbar,
IonTitle,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle,
IonGrid, IonRow, IonCol
},
setup() {
const router = useRouter();
const bps = ref<BullpenSessionService>(bullpenSessionService);
const finalizeAndNextPitch = () => {
bullpenSessionService.nextPitch();
router.push({ name: 'PreparePitch' });
}
const finalizeAndEndBullpen = () => {
bullpenSessionService.nextPitch();
bullpenSessionService.finishSession();
router.push({ name: 'BullpenStats' });
}
return {bps, finalizeAndNextPitch, finalizeAndEndBullpen};
},
methods: {
setRealPitchArea(hitArea: number) {
this.bps.currentBullpenPitch().realPitchArea = hitArea;
}
}
});
</script>
<style scoped>
.wasted {
fill: firebrick;
stroke: black;
stroke-width: 1;
}
.wasted-selected {
fill: orangered;
stroke: black;
stroke-width: 1;
}
.edge {
fill: lightgreen;
stroke: black;
stroke-width: 1;
}
.edge-selected {
fill: aquamarine;
stroke: black;
stroke-width: 1;
}
.inside {
fill: green;
stroke: black;
stroke-width: 1;
}
.inside-selected {
fill: darkolivegreen;
stroke: black;
stroke-width: 1;
}
.number {
text-anchor: middle;
fill: white;
font-size: 30px;
}
</style>

View File

@ -0,0 +1,95 @@
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Pitchers</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">Pitchers</ion-title>
</ion-toolbar>
</ion-header>
<ion-list>
<ion-item v-for="(pitcher, index) in pitchers" :key="index" button @click="goToPreparePitch(pitcher)">
<ion-label>{{ pitcher.first_name }} {{ pitcher.last_name }}</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ion-page>
</template>
<script lang="ts">
import { defineComponent, ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonList, IonItem, IonLabel } from '@ionic/vue';
import { pitcherService } from "@/services/PitcherService";
import Pitcher from "@/types/Pitcher";
import {bullpenSessionService} from "@/services/BullpenSessionService";
export default defineComponent({
name: "PitcherList",
components: {
IonContent,
IonHeader,
IonToolbar,
IonPage,
IonTitle,
IonList,
IonItem,
IonLabel,
},
setup() {
// Define a reactive array to hold colors
const pitchers = ref<Pitcher[]>([]);
const router = useRouter();
bullpenSessionService.clear();
// Fetch colors from the service when the component is mounted
onMounted(async () => {
pitchers.value = await pitcherService.getAllPitchers();
});
const goToPreparePitch = (pitcher: Pitcher) => {
bullpenSessionService.startSession( pitcher );
router.push({ name: 'PreparePitch' });
};
return { pitchers, goToPreparePitch };
},
});
</script>
<style scoped>
#container {
text-align: center;
position: absolute;
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
}
#container strong {
font-size: 20px;
line-height: 26px;
}
#container p {
font-size: 16px;
line-height: 22px;
color: #8c8c8c;
margin: 0;
}
#container a {
text-decoration: none;
}
</style>

View File

@ -0,0 +1,191 @@
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Prepare Pitch for {{ bps.getPitcher().first_name }} {{ bps.getPitcher().last_name }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header>
<ion-card-title>Select Pitch type</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-button v-for="(pitchType, index) in pitchTypes" :key="index" :color="pitchType.id !== bps.currentBullpenPitch().pitchType.id ? 'primary' : 'warning'" @click="setPitchType(pitchType)">
<ion-label>{{pitchType.abbreviation}}</ion-label>
</ion-button>
</ion-card-content>
</ion-card>
<ion-card>
<ion-card-header>
<ion-card-title>Select Planned Pitch Hit Area</ion-card-title>
</ion-card-header>
<ion-card-content>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360">
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 21}" class="wasted" points="0,0 105,0 105,60 60,60 60,105 0,105" @click="setPlannedPitchArea(21)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 22}" class="wasted" x="105" y="0" width="150" height="60" @click="setPlannedPitchArea(22)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 23}" class="wasted" points="255,0 360,0 360,105 300,105 300,60, 255,60" @click="setPlannedPitchArea(23)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 24}" class="wasted" x="0" y="105" width="60" height="150" @click="setPlannedPitchArea(24)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 25}" class="wasted" x="300" y="105" width="60" height="150" @click="setPlannedPitchArea(25)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 26}" class="wasted" points="0,255 60,255 60,300 105,300 105,360 0,360" @click="setPlannedPitchArea(26)" />
<rect :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 27}" class="wasted" x="105" y="300" width="150" height="60" @click="setPlannedPitchArea(27)" />
<polygon :class="{'wasted-selected': bps.currentBullpenPitch().plannedPitchArea === 28}" class="wasted" points="255,300 300,300 300,255 360,255 360,360 255,360" @click="setPlannedPitchArea(28)" />
<text x="30" y="40" class="number" @click="setPlannedPitchArea(21)" >21</text>
<text x="180" y="40" class="number" @click="setPlannedPitchArea(22)" >22</text>
<text x="330" y="40" class="number" @click="setPlannedPitchArea(23)" >23</text>
<text x="30" y="190" class="number" @click="setPlannedPitchArea(24)" >24</text>
<text x="330" y="190" class="number" @click="setPlannedPitchArea(25)" >25</text>
<text x="30" y="330" class="number" @click="setPlannedPitchArea(26)" >26</text>
<text x="180" y="330" class="number" @click="setPlannedPitchArea(27)" >27</text>
<text x="330" y="330" class="number" @click="setPlannedPitchArea(28)" >28</text>
<polygon :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 11}" class="edge" points="60,60 155,60 155,105 105,105 105,155, 60,155" @click="setPlannedPitchArea(11)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 12}" class="edge" x="155" y="60" width="50" height="45" @click="setPlannedPitchArea(12)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 13}" class="edge" points="205,60 300,60 300,155 255,155 255,105, 205,105" @click="setPlannedPitchArea(13)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 14}" class="edge" x="60" y="155" width="45" height="50" @click="setPlannedPitchArea(14)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 15}" class="edge" x="255" y="155" width="45" height="50" @click="setPlannedPitchArea(15)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 16}" class="edge" points="60,205 105,205 105,255 155,255 155,300, 60,300" @click="setPlannedPitchArea(16)" />
<rect :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 17}" class="edge" x="155" y="255" width="50" height="45" @click="setPlannedPitchArea(17)" />
<polygon :class="{'edge-selected': bps.currentBullpenPitch().plannedPitchArea === 18}" class="edge" points="205,255 255,255 255,205 300,205 300,300 205,300" @click="setPlannedPitchArea(18)" />
<text x="80" y="90" class="number" @click="setPlannedPitchArea(11)">11</text>
<text x="180" y="90" class="number" @click="setPlannedPitchArea(12)">12</text>
<text x="275" y="90" class="number" @click="setPlannedPitchArea(13)">13</text>
<text x="80" y="190" class="number" @click="setPlannedPitchArea(14)">14</text>
<text x="275" y="190" class="number" @click="setPlannedPitchArea(15)">15</text>
<text x="80" y="285" class="number" @click="setPlannedPitchArea(16)">16</text>
<text x="180" y="285" class="number" @click="setPlannedPitchArea(17)">17</text>
<text x="275" y="285" class="number" @click="setPlannedPitchArea(18)">18</text>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 1}" class="inside" x="105" y="105" width="50" height="50" @click="setPlannedPitchArea(1)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 2}" class="inside" x="155" y="105" width="50" height="50" @click="setPlannedPitchArea(2)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 3}" class="inside" x="205" y="105" width="50" height="50" @click="setPlannedPitchArea(3)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 4}" class="inside" x="105" y="155" width="50" height="50" @click="setPlannedPitchArea(4)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 5}" class="inside" x="155" y="155" width="50" height="50" @click="setPlannedPitchArea(5)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 6}" class="inside" x="205" y="155" width="50" height="50" @click="setPlannedPitchArea(6)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 7}" class="inside" x="105" y="205" width="50" height="50" @click="setPlannedPitchArea(7)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 8}" class="inside" x="155" y="205" width="50" height="50" @click="setPlannedPitchArea(8)"/>
<rect :class="{'inside-selected': bps.currentBullpenPitch().plannedPitchArea === 9}" class="inside" x="205" y="205" width="50" height="50" @click="setPlannedPitchArea(9)"/>
<text x="130" y="140" class="number" @click="setPlannedPitchArea(1)">1</text>
<text x="180" y="140" class="number" @click="setPlannedPitchArea(2)">2</text>
<text x="230" y="140" class="number" @click="setPlannedPitchArea(3)">3</text>
<text x="130" y="190" class="number" @click="setPlannedPitchArea(4)">4</text>
<text x="180" y="190" class="number" @click="setPlannedPitchArea(5)">5</text>
<text x="230" y="190" class="number" @click="setPlannedPitchArea(6)">6</text>
<text x="130" y="240" class="number" @click="setPlannedPitchArea(7)">7</text>
<text x="180" y="240" class="number" @click="setPlannedPitchArea(8)">8</text>
<text x="230" y="240" class="number" @click="setPlannedPitchArea(9)">9</text>
</svg>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<ion-button color="warning" expand="full" size="large" :disabled="bps.currentBullpenPitch().pitchType.id === 0 || bps.currentBullpenPitch().plannedPitchArea === 0" @click="gotoFinalizePitch">Pitch</ion-button>
</ion-footer>
</ion-page>
</template>
<script lang="ts">
import {defineComponent, onMounted, ref} from "vue";
import {pitchTypeService} from "@/services/PitchTypeService";
import {
IonContent,
IonHeader,
IonFooter,
IonToolbar,
IonTitle,
IonLabel,
IonButton,
IonPage,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle,
} from "@ionic/vue";
import PitchType from "@/types/PitchType";
import {BullpenSessionService, bullpenSessionService} from "@/services/BullpenSessionService";
import {useRouter} from "vue-router";
export default defineComponent({
name: "PreparePitch",
components: {
IonPage,
IonLabel,
IonFooter,
IonButton,
IonContent,
IonHeader,
IonToolbar,
IonTitle,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle
},
setup() {
const router = useRouter();
// const pitcher = ref<Pitcher>(bullpenSessionService.getPitcher());
// const pitch = ref<BullpenPitch>(bullpenSessionService.currentBullpenPitch());
const pitchTypes = ref<PitchType[]>([]);
const bps = ref<BullpenSessionService>(bullpenSessionService);
onMounted(async () => {
pitchTypes.value = await pitchTypeService.getAllPitchTypes();
bps.value.currentBullpenPitch().pitchType = await pitchTypeService.getPitchType(1);
});
const setPitchType = (pitchType: PitchType) => {
bps.value.currentBullpenPitch().pitchType = pitchType;
}
const gotoFinalizePitch = () => {
router.push({ name: 'FinalizePitch' });
}
return {bps, pitchTypes, setPitchType, gotoFinalizePitch};
},
methods: {
setPlannedPitchArea(hitArea: number) {
this.bps.currentBullpenPitch().plannedPitchArea = hitArea;
}
}
});
</script>
<style scoped>
.wasted {
fill: firebrick;
stroke: black;
stroke-width: 1;
}
.wasted-selected {
fill: orangered;
stroke: black;
stroke-width: 1;
}
.edge {
fill: lightgreen;
stroke: black;
stroke-width: 1;
}
.edge-selected {
fill: aquamarine;
stroke: black;
stroke-width: 1;
}
.inside {
fill: green;
stroke: black;
stroke-width: 1;
}
.inside-selected {
fill: darkolivegreen;
stroke: black;
stroke-width: 1;
}
.number {
text-anchor: middle;
fill: white;
font-size: 30px;
}
</style>

1
app/src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@ -0,0 +1,6 @@
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('#container', 'Ready to create an app?')
})
})

View File

@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }

View File

@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

View File

@ -0,0 +1,10 @@
import { mount } from '@vue/test-utils'
import HomePage from '../../src/views/PitcherList.vue'
import { describe, expect, test } from 'vitest'
describe('PitcherList.vue', () => {
test('renders home vue', () => {
const wrapper = mount(HomePage)
expect(wrapper.text()).toMatch('Ready to create an app?')
})
})

21
app/tsconfig.json Normal file
View File

@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}

9
app/tsconfig.node.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

23
app/vite.config.ts Normal file
View File

@ -0,0 +1,23 @@
/// <reference types="vitest" />
import legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
legacy()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
test: {
globals: true,
environment: 'jsdom'
}
})