From 30fd2f5e0523d82b3140320592dcb3d838d56a82 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 23 Dec 2024 07:52:03 -0300 Subject: [PATCH] feat: update AdMob integration and project files - Modified `capacitor.config.ts` to update plugin configuration. --- .husky/pre-commit | 3 +- android/app/.gitignore | 1 + biome.json | 2 +- capacitor.config.ts | 3 +- package.json | 2 +- tsconfig.json | 19 ++++++++++++ www/index.html | 37 +++++++++++------------ www/res/{js/AdMob.js => plugins/AdMob.ts} | 2 +- www/res/styles/ui.css | 23 ++++++++++++++ www/vite-env.d.ts | 1 + 10 files changed, 67 insertions(+), 26 deletions(-) create mode 100644 tsconfig.json rename www/res/{js/AdMob.js => plugins/AdMob.ts} (98%) create mode 100644 www/vite-env.d.ts diff --git a/.husky/pre-commit b/.husky/pre-commit index 5d95df1..9377b05 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ +git status +git add . npm run lint npm run format - echo "Done!" \ No newline at end of file diff --git a/android/app/.gitignore b/android/app/.gitignore index 043df80..7eb8d62 100644 --- a/android/app/.gitignore +++ b/android/app/.gitignore @@ -1,2 +1,3 @@ /build/* !/build/.npmkeep +assets/ \ No newline at end of file diff --git a/biome.json b/biome.json index 9c7d747..a7a6784 100644 --- a/biome.json +++ b/biome.json @@ -26,6 +26,6 @@ } }, "files": { - "ignore": ["node_modules", "android"] + "ignore": ["node_modules", "build", "android"] } } diff --git a/capacitor.config.ts b/capacitor.config.ts index 969e18f..6ece014 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -4,8 +4,7 @@ import { CapacitorConfig } from "@capacitor/cli"; const config: CapacitorConfig = { appId: "uwu.cookie.app", appName: "Cookie", - webDir: "www", - bundledWebRuntime: false, + webDir: "build", plugins: { AdMob: { androidAppId: "ca-app-pub-6690516270288705~6535066913", diff --git a/package.json b/package.json index 1be9e79..7e0142c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "pre-commit": "cz" }, "hooks": { - "prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true" + "prepare-commit-msg": "npx --no -- commitlint --edit $1; exec < /dev/tty && npx cz --hook || true" }, "dependencies": { "@capacitor-community/admob": "^6.1.0", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..82f0fdd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ESNext", + "outDir": "build", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ESNext", "DOM"], + "moduleResolution": "Node", + "strict": true, + "resolveJsonModule": true, + "isolatedModules": true, + "esModuleInterop": true, + "noEmit": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "skipLibCheck": true + } +} diff --git a/www/index.html b/www/index.html index 6dc3bce..77c2375 100644 --- a/www/index.html +++ b/www/index.html @@ -9,9 +9,10 @@ + - + @@ -21,29 +22,25 @@ +
+ + + - + +
+ diff --git a/www/res/js/AdMob.js b/www/res/plugins/AdMob.ts similarity index 98% rename from www/res/js/AdMob.js rename to www/res/plugins/AdMob.ts index 7669ca8..4164b12 100644 --- a/www/res/js/AdMob.js +++ b/www/res/plugins/AdMob.ts @@ -1,4 +1,4 @@ -const { AdMob } = window.Capacitor.Plugins; +import { AdMob } from "@capacitor-community/admob"; $(document).ready(() => { // Initialize AdMob plugin diff --git a/www/res/styles/ui.css b/www/res/styles/ui.css index d6e84f3..fc1562c 100644 --- a/www/res/styles/ui.css +++ b/www/res/styles/ui.css @@ -59,3 +59,26 @@ opacity: 0.8; } } + +.btn-custom { + background-color: transparent; + color: #333; + border: 2px solid #333; + border-radius: 50px; + width: 200px; + height: 50px; + font-size: 16px; + display: flex; + align-items: center; + justify-content: center; + margin: 10px; + transition: all 0.3s ease; +} + +.btn-custom:hover { + border-color: #555; +} + +.btn-custom i { + margin-right: 10px; +} diff --git a/www/vite-env.d.ts b/www/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/www/vite-env.d.ts @@ -0,0 +1 @@ +///