pfp cropping #12
2 changed files with 8 additions and 12 deletions
|
@ -1,15 +1,14 @@
|
|||
<template>
|
||||
<div id="fullscreen-container">
|
||||
<div id="crop-preview">
|
||||
<img ref="image" :src="imageSrc" style="min-height: 500px;">
|
||||
<Button class="button" text="Crop" :callback="cropImage"></Button>
|
||||
<Button class="button" text="Cancel" :callback="closePopup"></Button>
|
||||
<img ref="image" :src="imageSrc" style="min-height: 35dvh;">
|
||||
|
||||
<Button text="Crop" :callback="cropImage"></Button>
|
||||
sauceyred
commented
Button component already sets class to "button" Button component already sets class to "button"
|
||||
<Button text="Cancel" :callback="closePopup"></Button>
|
||||
sauceyred
commented
Button component already sets class to "button" Button component already sets class to "button"
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import Cropper from 'cropperjs';
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -82,7 +81,7 @@ function closePopup() {
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 10;
|
||||
background: rgba(0,0,0,0.5);
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#crop-preview {
|
||||
|
|
|
@ -33,22 +33,19 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Button from '~/components/Button.vue';
|
||||
import CropPopup from '~/components/CropPopup.vue';
|
||||
import type { UserResponse } from '~/types/interfaces';
|
||||
|
||||
sauceyred
commented
Not needed Not needed
|
||||
let newPfpFile: File;
|
||||
const isCropPopupVisible = ref(false);
|
||||
const cropImageSrc = ref("")
|
||||
;
|
||||
const { fetchUser } = useAuth();
|
||||
|
||||
|
||||
const user: UserResponse | undefined = await fetchUser()
|
||||
if (!user) {
|
||||
alert("could not fetch user info, aborting :(")
|
||||
}
|
||||
|
||||
let newPfpFile: File;
|
||||
const isCropPopupVisible = ref(false);
|
||||
const cropImageSrc = ref('');
|
||||
|
||||
async function saveChanges() {
|
||||
if (!user) return;
|
||||
sauceyred
commented
Use double quotes Use double quotes
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue
Don't use px for min-height