-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
239 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<template v-for="(album, idx) in props.albums"> | ||
<AlbumThumb | ||
@click="maySelect(idx + props.iter + props.idxShift, $event)" | ||
@contextmenu.prevent="menuOpen(idx + props.iter + props.idxShift, $event)" | ||
:album="album" | ||
:cover_id="null" | ||
:config="props.config" | ||
v-if="!album.is_nsfw || are_nsfw_visible" | ||
:is-selected="props.selectedAlbums.includes(album.id)" | ||
/> | ||
</template> | ||
</template> | ||
<script setup lang="ts"> | ||
import AlbumThumb, { AlbumThumbConfig } from "@/components/gallery/thumbs/AlbumThumb.vue"; | ||
import { useLycheeStateStore } from "@/stores/LycheeState"; | ||
import { storeToRefs } from "pinia"; | ||
const lycheeStore = useLycheeStateStore(); | ||
const { are_nsfw_visible } = storeToRefs(lycheeStore); | ||
const props = defineProps<{ | ||
album: App.Http.Resources.Models.AlbumResource | undefined | null; | ||
albums: { [key: number]: App.Http.Resources.Models.ThumbAlbumResource }; | ||
config: AlbumThumbConfig; | ||
iter: number; | ||
idxShift: number; | ||
selectedAlbums: string[]; | ||
}>(); | ||
// bubble up. | ||
const emits = defineEmits<{ | ||
clicked: [idx: number, event: MouseEvent]; | ||
contexted: [idx: number, event: MouseEvent]; | ||
}>(); | ||
const maySelect = (idx: number, e: MouseEvent) => { | ||
if (props.idxShift < 0) { | ||
return; | ||
} | ||
emits("clicked", idx, e); | ||
}; | ||
const menuOpen = (idx: number, e: MouseEvent) => { | ||
if (props.idxShift < 0) { | ||
return; | ||
} | ||
emits("contexted", idx, e); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
resources/js/components/gallery/PhotoThumbPanelControl.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<a class="px-1 cursor-pointer group inline-block h-8" @click="layout = 'square'" :title="$t('lychee.LAYOUT_SQUARES')"> | ||
<MiniIcon icon="squares" fill="fill-transparent" :class="squareClass" /> | ||
</a> | ||
<a class="px-1 cursor-pointer group inline-block h-8" @click="layout = 'justified'" :title="$t('lychee.LAYOUT_JUSTIFIED')"> | ||
<MiniIcon icon="justified" fill="" :class="justifiedClass" /> | ||
</a> | ||
<a class="px-1 cursor-pointer group inline-block h-8" @click="layout = 'masonry'" :title="$t('lychee.LAYOUT_MASONRY')"> | ||
<MiniIcon icon="masonry" fill="fill-transparent" :class="masonryClass" /> | ||
</a> | ||
<a class="px-1 cursor-pointer group inline-block h-8" @click="layout = 'grid'" :title="$t('lychee.LAYOUT_GRID')"> | ||
<MiniIcon icon="grid" fill="fill-transparent" :class="gridClass" /> | ||
</a> | ||
</template> | ||
<script setup lang="ts"> | ||
import { Ref } from "vue"; | ||
import MiniIcon from "@/components/icons/MiniIcon.vue"; | ||
import { useLayoutClass } from "@/layouts/PhotoLayout"; | ||
const layout = defineModel("layout") as Ref<App.Enum.PhotoLayoutType>; | ||
// Layouts stuff | ||
const { squareClass, justifiedClass, masonryClass, gridClass } = useLayoutClass(layout); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<div class="relative flex flex-wrap flex-row flex-shrink w-full justify-start align-top" :id="'photoListing' + props.iter"> | ||
<template v-for="(photo, idx) in props.photos"> | ||
<PhotoThumb | ||
@click="maySelect(idx + iter, $event)" | ||
@contextmenu.prevent="menuOpen(idx + iter, $event)" | ||
:is-selected="props.selectedPhotos.includes(photo.id)" | ||
:photo="photo" | ||
:album="props.album" | ||
:is-lazy="idx + iter > 10" | ||
/> | ||
</template> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { useLayouts } from "@/layouts/PhotoLayout"; | ||
import { onMounted, onUpdated, Ref } from "vue"; | ||
import PhotoThumb from "./thumbs/PhotoThumb.vue"; | ||
const props = defineProps<{ | ||
photos: { [key: number]: App.Http.Resources.Models.PhotoResource }; | ||
album: | ||
| App.Http.Resources.Models.AlbumResource | ||
| App.Http.Resources.Models.TagAlbumResource | ||
| App.Http.Resources.Models.SmartAlbumResource | ||
| undefined; | ||
galleryConfig: App.Http.Resources.GalleryConfigs.PhotoLayoutConfig; | ||
selectedPhotos: string[]; | ||
iter: number; | ||
}>(); | ||
const layout = defineModel("layout") as Ref<App.Enum.PhotoLayoutType>; | ||
const isTimeline = defineModel("isTimeline") as Ref<boolean>; | ||
const emits = defineEmits<{ | ||
clicked: [idx: number, event: MouseEvent]; | ||
contexted: [idx: number, event: MouseEvent]; | ||
}>(); | ||
const maySelect = (idx: number, e: MouseEvent) => emits("clicked", idx, e); | ||
const menuOpen = (idx: number, e: MouseEvent) => emits("contexted", idx, e); | ||
// Layouts stuff | ||
const { activateLayout } = useLayouts(props.galleryConfig, layout, "photoListing" + props.iter); | ||
onMounted(() => activateLayout()); | ||
onUpdated(() => activateLayout()); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.