Skip to content

Commit

Permalink
feat: update AdMob integration and project files
Browse files Browse the repository at this point in the history
- Modified `capacitor.config.ts` to update plugin configuration.
  • Loading branch information
root committed Dec 23, 2024
1 parent 40b01f5 commit 30fd2f5
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
git status
git add .
npm run lint
npm run format

echo "Done!"
1 change: 1 addition & 0 deletions android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build/*
!/build/.npmkeep
assets/
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
}
},
"files": {
"ignore": ["node_modules", "android"]
"ignore": ["node_modules", "build", "android"]
}
}
3 changes: 1 addition & 2 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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
}
}
37 changes: 17 additions & 20 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<link rel="manifest" href="manifest.json">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="./res/styles/ui.css" type="text/css" media="all" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/eruda/3.4.1/eruda.min.js" integrity="sha512-3RVqOZtMevFOLeXCp0/Wl7np/l3J3MMysaFDUhNh+hdKx+Wb0lMXuHwA6CZ/+4DfYZM01Om1as8g+mnTaQH9vA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="module" src="./res/js/AdMob.js"></script>
<script type="module" src="./res/plugins/AdMob.ts"></script>
</head>
<body class="ui-cookie">

Expand All @@ -21,29 +22,25 @@
</div>
</splash-screen>

<div class="d-flex flex-column justify-content-center align-items-center">
<button id="show_banner" class="btn btn-custom">
<i class="fas fa-image"></i> Mostrar Banner
</button>

<button id="hide_banner" class="btn btn-custom">
<i class="fas fa-eye-slash"></i> Esconder Banner
</button>

<button id="show_video" class="btn btn-custom">
<i class="fas fa-video"></i> Mostrar Video
</button>

<!---
<button id="show_banner">
Mostrar Banner
</button>
<button id="hide_banner">
Esconder Banner
</button>
<button id="show_video">
Mostrar Video
</button>
<button id="award">
Mostrar Premio
</button>
--->
<button id="award" class="btn btn-custom">
<i class="fas fa-trophy"></i> Mostrar Premio
</button>
</div>


<script>
eruda.init();
</script>
Expand Down
2 changes: 1 addition & 1 deletion www/res/js/AdMob.js → www/res/plugins/AdMob.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { AdMob } = window.Capacitor.Plugins;
import { AdMob } from "@capacitor-community/admob";

$(document).ready(() => {
// Initialize AdMob plugin
Expand Down
23 changes: 23 additions & 0 deletions www/res/styles/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions www/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />

0 comments on commit 30fd2f5

Please sign in to comment.