From 55ec4e5053848bc8b8434bb57fdddbb16f687e8a Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 18 Jun 2019 01:27:14 +0200 Subject: [PATCH] Frontend: Add experimental "pull to refresh" component --- frontend/src/component/components.js | 2 + frontend/src/component/p-pull-refresh.vue | 207 ++++++++++++++++++++++ frontend/src/css/app.css | 33 ++++ frontend/src/pages/photos.vue | 28 +-- 4 files changed, 257 insertions(+), 13 deletions(-) create mode 100644 frontend/src/component/p-pull-refresh.vue diff --git a/frontend/src/component/components.js b/frontend/src/component/components.js index 34b384bc0..3673d870e 100644 --- a/frontend/src/component/components.js +++ b/frontend/src/component/components.js @@ -9,6 +9,7 @@ import PPhotoViewer from "./p-photo-viewer.vue"; import PPhotoSearch from "./p-photo-search.vue"; import PPhotoClipboard from "./p-photo-clipboard.vue"; import PScrollTop from "./p-scroll-top.vue"; +import PPullRefresh from "./p-pull-refresh.vue"; const components = {}; @@ -24,6 +25,7 @@ components.install = (Vue) => { Vue.component("p-photo-search", PPhotoSearch); Vue.component("p-photo-clipboard", PPhotoClipboard); Vue.component("p-scroll-top", PScrollTop); + Vue.component("p-pull-refresh", PPullRefresh); }; export default components; diff --git a/frontend/src/component/p-pull-refresh.vue b/frontend/src/component/p-pull-refresh.vue new file mode 100644 index 000000000..a7ae219af --- /dev/null +++ b/frontend/src/component/p-pull-refresh.vue @@ -0,0 +1,207 @@ + + + diff --git a/frontend/src/css/app.css b/frontend/src/css/app.css index eb434d03c..838a1f517 100644 --- a/frontend/src/css/app.css +++ b/frontend/src/css/app.css @@ -66,3 +66,36 @@ main { #photoprism .p-pointer { cursor: pointer; } + +.p-pull-refresh { + height: 100%; + max-height: 100%; + overflow-y: auto; +} + +.p-pull-refresh .pull-down-header { + width: 100%; + height: 0px; + overflow: hidden; + position: relative; + background-color: #757575; +} + +.p-pull-refresh .pull-down-content { + position: absolute; + max-width: 90%; + bottom: 10px; + left: 50%; + transform: translateX(-50%); + height: 40px; + color: #ffffff; + text-align: center; + border-left: 20px solid transparent; + font-size: 14px; +} + +.p-pull-refresh .pull-down-icon { + height: 20px; + width: 20px; + margin: 10px; +} diff --git a/frontend/src/pages/photos.vue b/frontend/src/pages/photos.vue index f441b4a4a..ff85c79ee 100644 --- a/frontend/src/pages/photos.vue +++ b/frontend/src/pages/photos.vue @@ -2,22 +2,24 @@
- + + - - + + - + - - - - - + + + + + +