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

Bug Fixes patch #186

Merged
merged 7 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Central ACC Hymnal for many song books used across the ACC
| Android | iOS | Web |
|:-:|:-:|:-:|
| [<img src="/public/assets/en_badge_web_generic.png" height="75"/>](https://play.google.com/store/apps/details?id=com.ChristopherW.acchmns) | [<img src="/public/assets/Appstore_badge.svg" height="50"/>](https://apps.apple.com/us/app/acc-hymns/id1634426405) | [acchymns.app](https://www.acchymns.app) |

## Hymnal Progress
A table showing the development and implemented features for each hymnal:
[Spreadsheet](https://docs.google.com/spreadsheets/d/1Wwl8wrOgCiCpcy21894W961yvckVhz6XwVcfSmaGW_E/edit?usp=sharing)

## Project Setup

```sh
Expand Down Expand Up @@ -49,18 +54,7 @@ npx cap run android

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
[VSCode](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar)

## Customize configuration

Expand Down
2 changes: 1 addition & 1 deletion add-on-books-handler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from "node:path";
import process from "node:process";

// These are where the json files end up after `npx cap sync`
const bundled_books = ["ZH", "GH", "HG", "JH"];
const bundled_books = ["ZH", "GH", "JH"];
const mappings = {
ios: "ios/App/App/public/books",
android: "android/app/src/main/assets/public/books",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "acchymnal",
"version": "3.0.1",
"version": "3.0.2",
"private": true,
"scripts": {
"postinstall": "patch-package",
Expand Down
8 changes: 4 additions & 4 deletions public/book_signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -8482,10 +8482,10 @@
},
{
"name": "summary.json",
"hash": "oNR6Pfu7FudBmOGWgcDot9TCRbQ="
"hash": "CkHKt//LZYNL1Ek1f4Z+gUCA8yY="
}
],
"hash": "qHYMSQ+PqMYavc3ju8JU6Mgejzs="
"hash": "JturkrpUDYI7/RIMJ/s5jdHAYdg="
},
{
"name": "HS",
Expand Down Expand Up @@ -19814,14 +19814,14 @@
},
{
"name": "songs.json",
"hash": "VwaO666t1ogq19YVEN1sMGwRmqA="
"hash": "O1Hm2w5yxfDhbKP0FbF+9t3Dt+U="
},
{
"name": "summary.json",
"hash": "oU2jsgT3sEzR3EbwIWbd7V5mIp8="
}
],
"hash": "kHOG6p5he7KW5NknXT+IVe2n+H8="
"hash": "MUEW4pMK0mMOBYoQVP80+J+Nk3Q="
},
{
"name": "ZHG",
Expand Down
4 changes: 2 additions & 2 deletions public/books/HG/.signature
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@
},
{
"name": "summary.json",
"hash": "oNR6Pfu7FudBmOGWgcDot9TCRbQ="
"hash": "CkHKt//LZYNL1Ek1f4Z+gUCA8yY="
}
],
"hash": "qHYMSQ+PqMYavc3ju8JU6Mgejzs="
"hash": "JturkrpUDYI7/RIMJ/s5jdHAYdg="
}
4 changes: 2 additions & 2 deletions public/books/HG/summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"medium": "Camp Book",
"long": "Camp Book"
},
"primaryColor": "#FFD35D",
"secondaryColor": "#DB8223",
"primaryColor": "#FBBC13",
"secondaryColor": "#BD772A",
"fileExtension": "pdf",
"addOn": true,
"indexAvailable": true
Expand Down
4 changes: 2 additions & 2 deletions public/books/ZH/.signature
Original file line number Diff line number Diff line change
Expand Up @@ -1397,12 +1397,12 @@
},
{
"name": "songs.json",
"hash": "VwaO666t1ogq19YVEN1sMGwRmqA="
"hash": "O1Hm2w5yxfDhbKP0FbF+9t3Dt+U="
},
{
"name": "summary.json",
"hash": "oU2jsgT3sEzR3EbwIWbd7V5mIp8="
}
],
"hash": "kHOG6p5he7KW5NknXT+IVe2n+H8="
"hash": "MUEW4pMK0mMOBYoQVP80+J+Nk3Q="
}
2 changes: 1 addition & 1 deletion public/books/ZH/songs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@
},
"322": {
"title": "Thee Alone, Beloved Savior",
"notes": ["Bb4", "D4", "F3", "B2"]
"notes": ["Bb4", "D4", "F3", "Bb2"]
},
"323": {
"title": "Glorious and Loveliest Zion",
Expand Down
3 changes: 3 additions & 0 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import BaseBookBox from "@/components/BaseBookBox.vue";
import draggable from 'vuedraggable'
import { Preferences } from "@capacitor/preferences";
import { restoreScrollPosition, saveScrollPosition } from "@/router/scroll";
import { clearCache } from "@/composables/cached_fetch";

var hasConnection = ref<boolean>(false);
let import_books_tooltip_status = useLocalStorage<boolean>("import_books_tooltip_complete", false);
Expand Down Expand Up @@ -141,6 +142,8 @@ async function startUpdate() {
update_packages.value = [];
})
}

clearCache();
}

function filter_book(book: BookDataSummary, hasConnection: boolean) {
Expand Down
92 changes: 49 additions & 43 deletions src/views/SongDisplayView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,42 +163,42 @@ let left_indicator_opacity = ref<number>(0);
let right_indicator_opacity = ref<number>(0);
const song_container = ref<HTMLElement | null>(null);
const desired_magnitude = window_width()/4;
const swipe_handler = useSwipe(song_container, {
onSwipeStart(e: TouchEvent) {
swipe_origin = e.changedTouches[0];
},
onSwipe(e: TouchEvent) {
let zoom = (song_container.value as any).getZoom();
if(zoom > 1)
return;
let x = e.changedTouches[0].clientX;
let startX = swipe_origin.clientX;
let magnitude = Math.abs(x - startX);
let direction = (x - startX) > 0 ? 1 : -1;
left_indicator_opacity.value = (direction == 1) ? Math.max((magnitude) / desired_magnitude, 0) : 0;
right_indicator_opacity.value = (direction == -1) ? Math.max((magnitude) / desired_magnitude, 0) : 0;
},
onSwipeEnd(e: TouchEvent) {
left_indicator_opacity.value = 0;
right_indicator_opacity.value = 0;
let zoom = (song_container.value as any).getZoom();
if(zoom > 1)
return;
let x = e.changedTouches[0].clientX;
let startX = swipe_origin.clientX;
let magnitude = Math.abs(x - startX);

if(magnitude < desired_magnitude)
return;

let direction = (x - startX) > 0 ? -1 : 1;
if(direction == 1) {
traverse_song(1);
} else {
traverse_song(-1);
}
}
});
// const swipe_handler = useSwipe(song_container, {
// onSwipeStart(e: TouchEvent) {
// swipe_origin = e.changedTouches[0];
// },
// onSwipe(e: TouchEvent) {
// let zoom = (song_container.value as any).getZoom();
// if(zoom > 1)
// return;
// let x = e.changedTouches[0].clientX;
// let startX = swipe_origin.clientX;
// let magnitude = Math.abs(x - startX);
// let direction = (x - startX) > 0 ? 1 : -1;
// left_indicator_opacity.value = (direction == 1) ? Math.max((magnitude) / desired_magnitude, 0) : 0;
// right_indicator_opacity.value = (direction == -1) ? Math.max((magnitude) / desired_magnitude, 0) : 0;
// },
// onSwipeEnd(e: TouchEvent) {
// left_indicator_opacity.value = 0;
// right_indicator_opacity.value = 0;
// let zoom = (song_container.value as any).getZoom();
// if(zoom > 1)
// return;
// let x = e.changedTouches[0].clientX;
// let startX = swipe_origin.clientX;
// let magnitude = Math.abs(x - startX);

// if(magnitude < desired_magnitude)
// return;

// let direction = (x - startX) > 0 ? -1 : 1;
// if(direction == 1) {
// traverse_song(1);
// } else {
// traverse_song(-1);
// }
// }
// });

onMounted(async () => {
const SONG_METADATA = await getSongMetaData(props.book);
Expand Down Expand Up @@ -289,7 +289,6 @@ let elapsed_timer: number = -1;
let media_is_scrubbing = ref<boolean>(false);
let large_timeline = ref();
let mini_timeline = ref();
let page_buttons = ref();
let broadcast_button = ref();

function open_broadcast() {
Expand Down Expand Up @@ -502,14 +501,18 @@ function get_note_icon(note: string) {
</div>
</div>
</div>
<div ref="page_buttons" v-if="panel.height < 0.7 || !panel.visible" class="page-buttons" :style="{transform: 'translateY(' + (panel.visible ? (-panel.height * window_height() + 'px') : '0') + ')'}">
<div class="page-button-container left" v-if="panel.height < 0.7 || !panel.visible" :style="{transform: 'translateY(' + (panel.visible ? (-panel.height * window_height() + 'px') : '0') + ')'}">
<div class="page-button" :class="{ 'arrow-hidden-left': (!menu_bar_visible || Number(props.number) == 1)}">
<img @click="traverse_song(-1)" class="ionicon" src="/assets/chevron-back-outline.svg" />
</div>
</div>
<div class="page-button-container right" v-if="panel.height < 0.7 || !panel.visible" :style="{transform: 'translateY(' + (panel.visible ? (-panel.height * window_height() + 'px') : '0') + ')'}">
<div class="page-button" :class="{ 'arrow-hidden-right': (!menu_bar_visible || Number(props.number) == song_count)}">
<img @click="traverse_song(1)" class="ionicon" src="/assets/chevron-forward-outline.svg" />
</div>
</div>


<div v-if="left_indicator_opacity > 0 && Number(props.number) > 1" class="flip-indicator flip-indicator-left" :style="{opacity: left_indicator_opacity}">
<img class="ionicon" src="/assets/chevron-back-outline.svg" />
</div>
Expand Down Expand Up @@ -916,13 +919,10 @@ function get_note_icon(note: string) {
margin: 0 auto;
cursor: pointer;
}
.page-buttons {
.page-button-container {
position: fixed;
bottom: 5vh;
z-index: 1;
width: 100%;
display: flex;
justify-content: space-between;
}
.page-button {
height: 10vw;
Expand All @@ -932,14 +932,20 @@ function get_note_icon(note: string) {
background-color: var(--button-color);
border-radius: 50px;
box-shadow: 0 0 8px rgb(0, 0, 0, 0.15);
margin: 0 15px;
transition: transform 0.3s;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}

.left {
left: 15px;
}
.right {
right: 15px;
}

.media-type-title {
margin: 0px 0px;
color: var(--color);
Expand Down
Loading