diff --git a/components/navbar/navbar.sass b/components/navbar/navbar.sass index c373f185..0ccfe119 100644 --- a/components/navbar/navbar.sass +++ b/components/navbar/navbar.sass @@ -87,7 +87,7 @@ .avatar-wrap @apply bg-ps-primary relative rounded-full - @apply w-54 h-54 mr-2 + @apply w-54 h-54 mr-2 cursor-pointer @screen md @apply h-72 w-72 @@ -99,6 +99,17 @@ @screen md @apply h-66 w-66 + .change-wrap + @apply absolute w-full bg-ps-white rounded-full + @apply w-48 h-48 ps-center-absolute opacity-50 + @apply flex items-center justify-center + + @screen md + @apply h-66 w-66 + + .icon + @apply opacity-100 + .user-info @screen md @apply pl-5 @@ -119,3 +130,25 @@ .microsoft-btn border-bottom: 1px solid black + +.picture-modal-wrapper + @apply text-ps-white + + .title + @apply text-ps-green text-2xl + + .placeholder + @apply my-6 mx-auto + @apply flex items-center justify-center + + img + @apply rounded-full + @apply border-solid border-4 border-ps-green + + width: 100px + height: 100px + + object-fit: cover + + .actions + @apply flex justify-end diff --git a/components/navbar/navbar.vue b/components/navbar/navbar.vue index 0e4346b7..446c1ce3 100644 --- a/components/navbar/navbar.vue +++ b/components/navbar/navbar.vue @@ -2,8 +2,10 @@ .navbar .user .user-wrap - .avatar-wrap(v-if='mainStore.isLoggedIn') + .avatar-wrap(v-if='mainStore.isLoggedIn', @click='pictureModal = !pictureModal', @mouseover='pictureHover = true', @mouseleave='pictureHover = false') img.avatar(:src='mainStore.profilePicture')/ + .change-wrap(v-if='pictureHover') + edit-icon.icon .user-info.flex(@click='toggleSettings', v-on-clickaway='closeSettings') .user-text(v-if='mainStore.isLoggedIn') span.user-name {{ mainStore.displayName }} @@ -29,12 +31,20 @@ .menu-btn(v-if='!isDesktop', @click='toggleBurger') .burger(:class='{ active: burger }') ps-modal(v-model='loginModal') - .flex.justify-center + .flex.justify-center ps-login-form(@login-complete='toggleLoginModal') + ps-modal(v-model='pictureModal') + .picture-modal-wrapper + span.title Změna profilového obrázku + .placeholder + img(:src='placeholderImage') + ps-drag-drop(tile, :draggable='false', accept='.jpg,.jpeg,.gif,.png', v-model='selectedPicture', @input='changePlaceholder', :disabled='uploading') + .actions + ps-btn(@click='uploadPicture', :disabled='uploading', :loading='uploading') nahrát