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