diff --git a/.gitignore b/.gitignore index dca9244..27dc769 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /bin /dist /.tmp +/extensions/dnslookup/dnslookup-* #Vue builds /xradio-vue/dist @@ -17,4 +18,5 @@ tmpState.txt command.txt /extensions/dnslookup/node_modules /extensions/dnslookup/package-lock.json -TODO.md \ No newline at end of file +TODO.md +node_modules \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b66410..b157a38 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "git.ignoreLimitWarning": true + "git.ignoreLimitWarning": true, + "editor.tabSize": 2 } \ No newline at end of file diff --git a/neutralino.config.json b/neutralino.config.json index 7e73592..de8715a 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -1,6 +1,6 @@ { "applicationId": "js.neutralino.xradio", - "version": "1.0.2", + "version": "1.0.3", "defaultMode": "window", "documentRoot": "/xradio-vue/dist/", "port": 6498, diff --git a/xradio-vue/package.json b/xradio-vue/package.json index df53776..b362bbc 100644 --- a/xradio-vue/package.json +++ b/xradio-vue/package.json @@ -1,13 +1,12 @@ { "name": "xradio", - "version": "1.0.2", + "version": "1.0.3", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build" }, "dependencies": { - "axios": "^0.27.2", "howler": "^2.2.3", "vue": "^3.2.13", "vue-marquee-text-component": "^2.0.1", diff --git a/xradio-vue/src/App.vue b/xradio-vue/src/App.vue index 40a9a39..cdfbc4c 100644 --- a/xradio-vue/src/App.vue +++ b/xradio-vue/src/App.vue @@ -11,7 +11,7 @@ Switch theme -
- -
- +
+ +
+ + + - diff --git a/xradio-vue/src/components/navbar.vue b/xradio-vue/src/components/navbar.vue index 465a0af..a466ccd 100644 --- a/xradio-vue/src/components/navbar.vue +++ b/xradio-vue/src/components/navbar.vue @@ -1,15 +1,6 @@ - diff --git a/xradio-vue/src/views/home.vue b/xradio-vue/src/views/home.vue index b2c841e..fe831b9 100644 --- a/xradio-vue/src/views/home.vue +++ b/xradio-vue/src/views/home.vue @@ -7,7 +7,7 @@
-

- Popular -

+

Popular

-

- Most rated -

+

Most rated

- \ No newline at end of file +if (!store.state.initialLoad) { + initHome(); + store.dispatch("loaded"); +} + diff --git a/xradio-vue/src/views/search.vue b/xradio-vue/src/views/search.vue index 9844988..03eb05a 100644 --- a/xradio-vue/src/views/search.vue +++ b/xradio-vue/src/views/search.vue @@ -1,301 +1,289 @@ - diff --git a/xradio-vue/src/views/searchHub.vue b/xradio-vue/src/views/searchHub.vue index 1c1cd83..4cfb981 100644 --- a/xradio-vue/src/views/searchHub.vue +++ b/xradio-vue/src/views/searchHub.vue @@ -2,15 +2,7 @@

{{ country.name }}

@@ -89,93 +61,86 @@
- \ No newline at end of file + } +} + +function bottomVisible() { + const scrollY = window.scrollY; + const visible = document.documentElement.clientHeight; + const pageHeight = document.documentElement.scrollHeight - 200; + const bottomOfPage = visible + scrollY >= pageHeight; + return bottomOfPage || pageHeight < visible; +} + +function addCountries() { + countriesShow.value.push( + ...countries.slice(startIndex.value, nextIndex.value) + ); + if (last.value) { + stop.value = true; + } else { + startIndex.value = nextIndex.value; + if (nextIndex.value + 32 >= countries.length) { + nextIndex.value = countries.length; + last.value = true; + } else { + nextIndex.value += 32; + } + } +} + +onBeforeUnmount(() => { + window.removeEventListener("scroll", () => { + bottom.value = bottomVisible(); + }); +}); + +watch(bottom, (bottom) => { + if (bottom && !stop.value) { + addCountries(); + } +}); +