Skip to content

Commit

Permalink
dumili: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bperel committed Nov 4, 2024
1 parent 7b79186 commit b058823
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 38 deletions.
24 changes: 11 additions & 13 deletions apps/dumili/src/components/AiSuggestionIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@
import IBiExtraLightbulbBrokenFill from "~icons/extra-icons/brokenLightbulb";
import IBiLightbulbFill from "~icons/bi/lightbulb-fill";
const { class: className, status } = withDefaults(
defineProps<{
button?: boolean;
status: "success" | "failure" | "idle" | "loading";
id?: string;
class?: string;
}>(),
{
class: "",
id: undefined,
},
);
const {
class: className = "",
status,
id = undefined,
} = defineProps<{
button?: boolean;
status: "success" | "failure" | "idle" | "loading";
id?: string;
class?: string;
}>();
const component = computed(() =>
status === "failure" ? IBiExtraLightbulbBrokenFill : IBiLightbulbFill,
Expand Down Expand Up @@ -70,7 +68,7 @@ svg {
}
&.loading {
animation: pulse-yellow 2s infinite;
animation: pulse-yellow 1.5s infinite;
pointer-events: none;
cursor: not-allowed;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dumili/src/components/AiTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const showRepeat = ref(false);
</script>

<style lang="scss" scoped>
svg {
> svg {
width: 20px;
height: 20px;
color: black;
cursor: pointer;
}
Expand Down
25 changes: 10 additions & 15 deletions apps/dumili/src/components/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
><ai-tooltip
:id="`ai-results-entry-story-kind-${entry.id}`"
:value="storyKindAiSuggestion?.kind"
:disabled="!storyKindAiSuggestion"
:on-click-rerun="() => runKumiko(entry.id)"
@click="showAiDetectionsOn = entry.id"
>
Expand All @@ -36,13 +35,12 @@
?.label
}}</ai-tooltip
></b-col
><b-col col cols="9" class="flex-column"
><b-col col cols="4" class="flex-column"
><div class="d-flex flex-row align-items-center">
<StorySuggestionList v-model="entry" />
<ai-tooltip
:id="`ai-results-entry-story-${entry.id}`"
:value="storyAiSuggestions.map(({ storycode }) => storycode)"
:disabled="!storyAiSuggestions.length"
:on-click-rerun="() => runStorycodeOcr(entry.id)"
@click="showAiDetectionsOn = entry.id"
>
Expand All @@ -60,6 +58,8 @@
><template v-else>No OCR results</template></ai-tooltip
>
</div>
</b-col>
<b-col col cols="5" class="flex-column">
<b-form-input
placeholder="Titre de l'histoire"
type="text"
Expand All @@ -79,26 +79,21 @@
}}</b-badge
></b-col
>
<b-col cols="3">
<template v-if="entry.acceptedStory">{{
entry.acceptedStory.storycode
}}</template
<b-col cols="4">
<a
v-if="urlEncodedStorycode"
target="_blank"
:href="`https://inducks.org/story.php?c=${urlEncodedStorycode}`"
>{{ entry.acceptedStory!.storycode }}</a
><template v-else>{{ $t("Contenu inconnu") }}</template>
</b-col>
<b-col col cols="6"
<b-col col cols="5"
>{{ title || $t("Sans titre") }}
<template v-if="entry.part">
- {{ $t("partie") }} {{ entry.part }}</template
>
<br />
<small>{{ entry.entrycomment }}</small>
&nbsp;<a
v-if="urlEncodedStorycode"
target="_blank"
:href="`https://inducks.org/story.php?c=${urlEncodedStorycode}`"
>
{{ $t("Détails de l'histoire") }}
</a>
</b-col></template
>
</b-row>
Expand Down
11 changes: 4 additions & 7 deletions apps/dumili/src/components/TableOfContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
'fw-bold': shownPages.includes(pageNumber - 1),
}"
@click="currentPage = pageNumber - 1"
>Page {{ pageNumber
}}<!--<b-button disabled variant="light"
><i-bi-scissors
/></b-button
>-->
<ai-tooltip
>Page {{ pageNumber }}<br /><ai-tooltip
v-if="aiKumikoResultPanels"
:id="`ai-results-page-${pageNumber}`"
:value="aiKumikoInferredStoryKind"
Expand Down Expand Up @@ -283,10 +278,12 @@ watch(
width: 100%;
position: relative;
.col {
$background: rgba(238, 238, 238, 0.85);
align-items: start;
position: absolute;
box-shadow: 0px 35px 5px -4px;
color: rgba(238, 238, 238, 0.85);
background: #{$background};
color: #{$background};
left: 9px;
}
}
Expand Down
2 changes: 2 additions & 0 deletions apps/dumili/src/pages/indexation/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
ref="bookComponent"
v-model:book="book"
v-model:current-page="bookCurrentPage"
v-model:opened="isBookOpened"
:cover-ratio="coverRatio"
:urls="indexation!.pages.map(({ url }) => url)"
:with-table-of-contents="false" />
Expand Down Expand Up @@ -57,6 +58,7 @@ const { Book } = webComponents;
const book = ref<PageFlip | undefined>(undefined);
const bookCurrentPage = ref(0);
const isBookOpened = ref(true);
const coverRatio = ref<number | undefined>(undefined);
const showUploadWidget = ref(false);
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/components/Book.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ onMounted(() => {
(newValue) => {
if (newValue && coverRatio) {
const height = coverHeight || container.value!.clientHeight;
debugger;
book.value = new PageFlip(document.getElementById("book")!, {
width: height / coverRatio,
height,
Expand Down

0 comments on commit b058823

Please sign in to comment.