From f15743777b3dc8ffa8557080def46d3d7f2adca7 Mon Sep 17 00:00:00 2001 From: boxp Date: Tue, 1 Jun 2021 23:47:14 +0900 Subject: [PATCH 1/3] fix: profile to compatible for pc --- front-end/src/cljs/vr_match/lib/components/profile.cljs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front-end/src/cljs/vr_match/lib/components/profile.cljs b/front-end/src/cljs/vr_match/lib/components/profile.cljs index fc4451fb..cd6254ec 100644 --- a/front-end/src/cljs/vr_match/lib/components/profile.cljs +++ b/front-end/src/cljs/vr_match/lib/components/profile.cljs @@ -16,10 +16,11 @@ :direction "column" :style {:width "100vw"}} [:img {:style {:object-fit "cover" - :width "100vw" - :height "100vw"} + :width "100%" + :max-height "480px" + :height "60%"} :src (-> images first :url)}] - [:div {:style {:padding 16}} + [:div {:style {:padding "16px 16px 52px"}} [mui/grid {:container true :spacing 16} [mui/grid {:item true From a8ba03f503bda034d0470e28e559b7e5bfcba125 Mon Sep 17 00:00:00 2001 From: boxp Date: Wed, 2 Jun 2021 00:30:55 +0900 Subject: [PATCH 2/3] fix: profiles to compatible for pc --- front-end/package-lock.json | 4 +-- .../src/cljs/vr_match/approach/component.cljs | 4 +++ .../src/cljs/vr_match/mypage/component.cljs | 36 ++++++++++--------- .../cljs/vr_match/myprofile/component.cljs | 7 ++-- .../src/cljs/vr_match/profile/component.cljs | 8 +++-- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/front-end/package-lock.json b/front-end/package-lock.json index e61c967b..43dc8bae 100644 --- a/front-end/package-lock.json +++ b/front-end/package-lock.json @@ -1680,7 +1680,7 @@ "bundled": true, "optional": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "inflight": { @@ -1720,7 +1720,7 @@ "bundled": true, "optional": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { diff --git a/front-end/src/cljs/vr_match/approach/component.cljs b/front-end/src/cljs/vr_match/approach/component.cljs index 92235a03..2e62917e 100644 --- a/front-end/src/cljs/vr_match/approach/component.cljs +++ b/front-end/src/cljs/vr_match/approach/component.cljs @@ -40,6 +40,7 @@ (defn- onSwipeCardTouchStart [event] + (println "onSwipeCardTouchStart") (let [position-x (or (some-> event .-targetTouches (aget 0) .-pageX) (some-> event .-pageX)) position-y (or (some-> event .-targetTouches (aget 0) .-pageY) @@ -58,10 +59,12 @@ (defn- onSwipeCardTouchMoved [event] (when (-> @approach-state :isDragging) + (println "dragging") (let [position-x (or (some-> event .-targetTouches (aget 0) .-pageX) (some-> event .-pageX)) position-y (or (some-> event .-targetTouches (aget 0) .-pageY) (some-> event .-pageY))] + (println "position-x: " position-x " position-y: " position-y) (-> approach-state (swap! #(-> % @@ -71,6 +74,7 @@ (defn- onSwipeCardTouchEnd [event] + (println "onSwipeCardTouchEnd") (let [add-x (- (-> @approach-state :swipeCurrentPosition :x) (-> @approach-state :swipeStartPosition :x))] (cond (< add-x (- swipe-return-limit)) diff --git a/front-end/src/cljs/vr_match/mypage/component.cljs b/front-end/src/cljs/vr_match/mypage/component.cljs index d079b47d..37353368 100644 --- a/front-end/src/cljs/vr_match/mypage/component.cljs +++ b/front-end/src/cljs/vr_match/mypage/component.cljs @@ -64,29 +64,31 @@ handleSubmitPlatforms] :as props}] [navigation-bar-layout {:title "プロフィールを編集"} - [:div {:style {:position "relative"}} + [:div (when isLoading [linear-progress]) [mui/button-base {:on-click #(handle-click-reset-image image-ref) :style {:width "100vw" - :height "100vw"}} - [:div {:style {:width "100vw" - :height "100vw" + :max-height "480px" + :height "60%"}} + [:div {:style {:width "100%" + :height "100%" :background-image (str "url(" (some-> props :me :images first :url) ")") :background-size "cover" - :background-position "center"}}]] - [mui/icon-button {:on-click #(handle-click-reset-image image-ref) - :style - {:position "absolute" - :width "64px" - :height "64px" - :top "calc(100vw - 40px)" - :right "16px" - :background-color mui/primary-color}} - [mui/icon {:font-size "inherit" - :style {:color "white" - :font-size "32px"}} - "edit"]] + :background-position "center" + :position "relative"}} + [mui/icon-button {:on-click #(handle-click-reset-image image-ref) + :style + {:position "absolute" + :width "64px" + :height "64px" + :bottom "-16px" + :right "16px" + :background-color mui/primary-color}} + [mui/icon {:font-size "inherit" + :style {:color "white" + :font-size "32px"}} + "edit"]]]] [mui/list {:subheader (r/as-element [mui/list-subheader "ユーザー名"])} [mui/list-item {:key "user-name" :on-click handle-click-user-name} diff --git a/front-end/src/cljs/vr_match/myprofile/component.cljs b/front-end/src/cljs/vr_match/myprofile/component.cljs index e816f5b9..15e489a2 100644 --- a/front-end/src/cljs/vr_match/myprofile/component.cljs +++ b/front-end/src/cljs/vr_match/myprofile/component.cljs @@ -25,10 +25,13 @@ :right 0 :left 0 :bottom "16px" - :padding "0 16px"}} + :padding "0 16px" + :display "flex"}} [mui/button {:variant "contained" :color "primary" - :style {:width "100%"} + :style {:width "100%" + :max-width "640px" + :margin "0 auto"} :on-click handleClickEditMyProfile} [mui/icon {:style {:margin-right "8px"}} "edit"] diff --git a/front-end/src/cljs/vr_match/profile/component.cljs b/front-end/src/cljs/vr_match/profile/component.cljs index 1d2adb5c..447a830b 100644 --- a/front-end/src/cljs/vr_match/profile/component.cljs +++ b/front-end/src/cljs/vr_match/profile/component.cljs @@ -36,10 +36,14 @@ :right 0 :left 0 :bottom "16px" - :padding "0 16px"}} + :padding "0 16px" + :display "flex" + :justify-content "center"}} [mui/button {:variant "contained" :color "primary" - :style {:width "100%"} + :style {:width "100%" + :max-width "640px" + :margin "0 auto"} :disabled favorited? :on-click handleClickFavorite} [mui/icon {:style {:margin-right "8px"}} "favorite"] From 1a69f0ecbd5b4f39c509c37586f2245d31865ee0 Mon Sep 17 00:00:00 2001 From: boxp Date: Wed, 2 Jun 2021 00:47:15 +0900 Subject: [PATCH 3/3] remove: debug prints --- front-end/src/cljs/vr_match/approach/component.cljs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/front-end/src/cljs/vr_match/approach/component.cljs b/front-end/src/cljs/vr_match/approach/component.cljs index 2e62917e..92235a03 100644 --- a/front-end/src/cljs/vr_match/approach/component.cljs +++ b/front-end/src/cljs/vr_match/approach/component.cljs @@ -40,7 +40,6 @@ (defn- onSwipeCardTouchStart [event] - (println "onSwipeCardTouchStart") (let [position-x (or (some-> event .-targetTouches (aget 0) .-pageX) (some-> event .-pageX)) position-y (or (some-> event .-targetTouches (aget 0) .-pageY) @@ -59,12 +58,10 @@ (defn- onSwipeCardTouchMoved [event] (when (-> @approach-state :isDragging) - (println "dragging") (let [position-x (or (some-> event .-targetTouches (aget 0) .-pageX) (some-> event .-pageX)) position-y (or (some-> event .-targetTouches (aget 0) .-pageY) (some-> event .-pageY))] - (println "position-x: " position-x " position-y: " position-y) (-> approach-state (swap! #(-> % @@ -74,7 +71,6 @@ (defn- onSwipeCardTouchEnd [event] - (println "onSwipeCardTouchEnd") (let [add-x (- (-> @approach-state :swipeCurrentPosition :x) (-> @approach-state :swipeStartPosition :x))] (cond (< add-x (- swipe-return-limit))