Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composition API and Capacitor geolocation #6

Merged
merged 29 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
df5a953
WIP: Start working on Composition API versions of components and refa…
Carifio24 Apr 10, 2024
ac64465
More work on changing components to use Composition API.
Carifio24 Apr 10, 2024
8df9e27
Finish first draft of Composition + Capacitor geolocation.
Carifio24 Apr 10, 2024
f41e764
Convert gallery and HUD to use Composition API.
Carifio24 Apr 10, 2024
3acb926
Remove old component files.
Carifio24 Apr 10, 2024
7af8fc5
Add flexibility to funding acknowledgement component.
Carifio24 Apr 12, 2024
47d5fbf
Fix typing of WWT keyboard listeners.
Carifio24 Apr 16, 2024
7ac76c6
Remove scoped styling and tweak index file.
Carifio24 Apr 16, 2024
74a8646
(Finally) fix default prop issue. This took forever due to an incredi…
Carifio24 Apr 16, 2024
0c1e58f
Fill out more location selector content.
Carifio24 Apr 16, 2024
5baa094
More location selector tinkering.
Carifio24 Apr 16, 2024
cde82c0
Build working.
Carifio24 Apr 16, 2024
41a40ad
Remove build-fixing comment and add build workflow.
Carifio24 Apr 16, 2024
68fca71
Export new items from package.
Carifio24 Apr 17, 2024
0087321
Also export new utils.
Carifio24 Apr 17, 2024
cfcbe22
Export geolocation button.
Carifio24 Apr 18, 2024
0504fd3
Import missing CSS and make other minor tweaks to location selector.
Carifio24 Apr 18, 2024
63ac925
Allow omitting onMounted hook for geolocation.
Carifio24 Apr 18, 2024
6c967e3
Export composables.
Carifio24 Apr 18, 2024
ca0dcd8
Reorganize index file.
Carifio24 Apr 18, 2024
bf8ab55
Fix bad formatting in build workflow.
Carifio24 Apr 18, 2024
a37344f
Move prop type definitions into external file for export purposes.
Carifio24 Apr 22, 2024
9ab2869
Make world radii true by default.
Carifio24 Apr 22, 2024
b8f2104
Add some necessary imports and pointer-events CSS.
Carifio24 Apr 22, 2024
d371d7e
Update permission handling for geolocation.
Carifio24 Apr 22, 2024
913e900
Fix mistake in geolocation permission order determination.
Carifio24 Apr 22, 2024
80b2e7b
Rename HUD to follow PascalCase.
Carifio24 Apr 22, 2024
ffd7b14
Rename HUD for better component tag auto-detection.
Carifio24 Apr 23, 2024
34abc7d
Add pinia to build externals. Pass WWT engine store as a prop to HUD.…
Carifio24 Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
pull_request_target:
branches:
main

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Set up yarn
run: corepack enable && yarn set version 3.3.0

- name: Install
run: yarn install

- name: Lint
run: yarn lint

- name: Build
run: yarn build
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.2.0",
"browser": "dist/index.umd.js",
"dependencies": {
"@capacitor/core": "^5.7.4",
"@capacitor/geolocation": "^5.0.7",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.6",
Expand All @@ -15,7 +17,7 @@
"vuetify": "^3.3.3"
},
"devDependencies": {
"@types/leaflet": "^1.9.3",
"@types/leaflet": "^1.9.11",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@vue/cli-plugin-eslint": "^5.0.8",
Expand Down
45 changes: 18 additions & 27 deletions src/components/CreditLogos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,29 @@
</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
<script setup lang="ts">
import { computed } from "vue";

export default defineComponent({
import { CreditLogosProps } from "../types";

props: {
visible: {
type: Boolean,
default: true
},
logoSize: {
type: String,
default: "5vmin"
}
},

computed: {
isMobile() {
return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
cssVars() {
return {
"--logo-size": this.logoSize,
};
}
},
const props = withDefaults(defineProps<CreditLogosProps>(), {
visible: true,
logoSize: "5vmin"
});

const cssVars = computed(() => {
return {
"--logo-size": props.logoSize,
};
});
</script>

<style>
#logo-credits img {
height: var(--logo-size);
<style lang="less">
#icons-container {
pointer-events: auto;

img {
height: var(--logo-size);
}
}
</style>
110 changes: 0 additions & 110 deletions src/components/DefaultMiniCredits.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,50 +1,34 @@
<template>
<div id="funding-acknowledgment">
<div
id="funding-acknowledgment"
:style="cssVars"
>
The material contained in this product is based upon work supported by NASA under cooperative agreement award No. 80NSSC21M0002. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Aeronautics and Space Administration.
</div>
</template>

<script setup lang="ts">
import { computed } from "vue";

<script lang="ts">
import { defineComponent, } from "vue";
import { FundingAcknowledgementProps } from "../types";

export default defineComponent({


props: {
visible: {
type: Boolean,
default: true
},
},

data() {
return { };
},

created() {
return;
},

methods: {

},

computed: {

},
const props = withDefaults(defineProps<FundingAcknowledgementProps>(), {
color: "#E0E0E0",
backgroundColor: "#0C3D91",
});

watch: {
}
const cssVars = computed(() => {
return {
"--color": props.color,
"--background-color": props.backgroundColor,
};
});
</script>


<style lang="less">

#funding-acknowledgment {
color: #E0E0E0;
background-color: #0c3d91;
color: var(--color);
background-color: var(--background-color);
font-size: calc(0.8em + 0.1vw + 0.1vh);
line-height: calc(1em + 0.3vw + 0.3vh);
padding-inline: 1em;
Expand All @@ -55,7 +39,5 @@ export default defineComponent({
justify-content: center;
align-items: center;
border-radius: 5px;

}

</style>
</style>
Loading