diff --git a/src/assets/css/sendattachments.scss b/src/assets/css/sendattachments.scss index 4ffd699..1aac19a 100644 --- a/src/assets/css/sendattachments.scss +++ b/src/assets/css/sendattachments.scss @@ -482,7 +482,8 @@ $hiliteColor: #4642f1; } .send-attachments-info-popup { - background-color: rgba(0, 0, 0, 0.9); + background-color: rgba(0, 0, 0, 0.8); + border-radius: 24px 24px 0 0; .done-button { padding: 14px 24px; @@ -621,6 +622,20 @@ $hiliteColor: #4642f1; } } + .detail-info { + color: #333333; + background-color: #DAD9FC; + padding: 16px; + margin: 16px 0 16px 0; + border-radius: 8px 8px 0 8px; + font-family: "Inter", sans-serif; + font-weight: 400; + font-size: 14px; + line-height: 125%; + letter-spacing: 0.4px; + vertical-align: middle; + } + .detail-row { margin-top: 12px; font-family: "Inter", sans-serif; @@ -629,9 +644,29 @@ $hiliteColor: #4642f1; line-height: 125%; letter-spacing: 0.4px; color: rgba(255, 255, 255, 0.9); + display: flex; .v-icon { + padding: 9.33px; margin-right: 8px; + width: 32px; + height: 32px; + background-color: black; + } + + .detail-row__text { + display: flex; + flex-direction: column; + } + + .detail-row__title { + color: #dad9fc; + font-family: "Inter", sans-serif; + font-weight: 400; + font-size: 12px; + line-height: 125%; + letter-spacing: 0.4px; + vertical-align: middle; } } } diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index ab3763e..fa95640 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -504,8 +504,16 @@ "content_credentials_info": "Source or history information is available for this media to be verified.", "learn_more": "Learn more", "ai_used": "Photo modified with AI", + "screenshot": "Screenshot. ", "screenshot_taken_on": "Screenshot taken on {date}", - "captured_with_camera": "Captured with a camera", - "old_photo": "Photo older than 3 months" + "captured_with_camera": "Captured with a real camera. ", + "captured_screenshot": "Screenshot. ", + "captured_screenshot_ago": "Screenshot captured {ago} ago. ", + "generated_with_ai": "Generated with AI. ", + "generated_with_ai_ago": "Generated with AI {ago} ago. ", + "old_photo": "Photo older than 3 months. ", + "cc_source": "Source", + "cc_capture_timestamp": "Capture Timestamp", + "cc_location": "Location" } } diff --git a/src/components/content-credentials/C2PAInfo.vue b/src/components/content-credentials/C2PAInfo.vue index 4df016b..7d1e5c8 100644 --- a/src/components/content-credentials/C2PAInfo.vue +++ b/src/components/content-credentials/C2PAInfo.vue @@ -1,132 +1,99 @@ diff --git a/src/components/content-credentials/EXIFInfo.vue b/src/components/content-credentials/EXIFInfo.vue index 5f3b32f..2ec59d7 100644 --- a/src/components/content-credentials/EXIFInfo.vue +++ b/src/components/content-credentials/EXIFInfo.vue @@ -3,16 +3,13 @@
{{ t("file_mode.exif_data") }}
-
- $vuetify.icons.ic_exif_time{{ dateTime }} -
-
- $vuetify.icons.ic_exif_location{{ location }} -
-
- $vuetify.icons.ic_exif_device_camera{{ makeAndModel }} -
- + + + + + @@ -20,6 +17,7 @@ import { computed } from "vue"; import dayjs from "dayjs"; import { useI18n } from "vue-i18n"; +import CCProperty from "./CCProperty.vue"; const { t } = useI18n(); diff --git a/src/components/file_mode/AttachmentInfo.vue b/src/components/file_mode/AttachmentInfo.vue index 2fdfa91..54c624b 100644 --- a/src/components/file_mode/AttachmentInfo.vue +++ b/src/components/file_mode/AttachmentInfo.vue @@ -28,7 +28,7 @@ - + diff --git a/src/components/file_mode/GalleryItemsView.vue b/src/components/file_mode/GalleryItemsView.vue index 82dd87e..352bd71 100644 --- a/src/components/file_mode/GalleryItemsView.vue +++ b/src/components/file_mode/GalleryItemsView.vue @@ -1,24 +1,33 @@ - @@ -125,7 +131,7 @@ export default { bottom: 21px; width: 34px; height: 34px; - background: rgba(255,255,255,0.8); + background: rgba(255, 255, 255, 0.8); border-radius: 17px; display: flex; align-items: center; @@ -133,13 +139,13 @@ export default { } .fill-screen { - position: fixed !important; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: black; - z-index: 20 !important; - justify-content: space-between !important; + position: fixed !important; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: black; + z-index: 20 !important; + justify-content: space-between !important; } - \ No newline at end of file + diff --git a/src/components/messages/composition/MessageThreadSending.vue b/src/components/messages/composition/MessageThreadSending.vue index ce44c0d..43707f8 100644 --- a/src/components/messages/composition/MessageThreadSending.vue +++ b/src/components/messages/composition/MessageThreadSending.vue @@ -38,13 +38,6 @@ - @@ -52,7 +45,6 @@ import MessageOutgoing from "./MessageOutgoing.vue"; import { MessageProps, useMessage } from "./useMessage"; import { ROOM_TYPE_CHANNEL } from "@/plugins/utils"; -import GalleryItemsView from "../../file_mode/GalleryItemsView.vue"; import ThumbnailView from "../../file_mode/ThumbnailView.vue"; import SwipeableThumbnailsView from "../channel/SwipeableThumbnailsView.vue"; import { inject, ref, Ref, unref, watch } from "vue"; @@ -65,7 +57,6 @@ const $$sanitize: any = inject("globalSanitize"); let items: Ref = ref([]); const layoutedItems: Ref<{ size: number; item: Attachment }[]> = ref([]); -const showItem: Ref = ref(undefined); const uploadBatch: Ref = ref(undefined); @@ -93,10 +84,6 @@ const retryUpload = () => { } } -const onItemClick = (event: any) => { - showItem.value = event.item; -}; - const layout = () => { if (!items.value || items.value.length == 0) { layoutedItems.value = []; diff --git a/src/models/proof.ts b/src/models/proof.ts index b00012f..f71d27a 100644 --- a/src/models/proof.ts +++ b/src/models/proof.ts @@ -60,6 +60,9 @@ export type Proof = { }; export type ProofHintFlags = { + valid: boolean; + source?: string; + creationDate?: Date; aiGenerated?: boolean; aiEdited?: boolean; screenshot?: boolean; @@ -150,10 +153,11 @@ const matchFlag = (rules: FlagMatchRule[], file: any) => { values.forEach((v) => { re.forEach((r) => { if (r.test(v.value)) { - resultInfo.push({ field: v.path, value: v.value, re: r.source }) + result = true; + resultInfo.push({ field: v.path, value: v.value, re: r.source }); } }); - }) + }); } catch (e) { console.error("Invalid RE", e); } @@ -162,7 +166,12 @@ const matchFlag = (rules: FlagMatchRule[], file: any) => { }; const extractFlagValues = (flagPath: string, file: any): FlagMatchRuleValue[] => { - const getValues = (path: string[], objectPath: any[], actualPath: string, o: any): FlagMatchRuleValue[] | undefined => { + const getValues = ( + path: string[], + objectPath: any[], + actualPath: string, + o: any + ): FlagMatchRuleValue[] | undefined => { if (path.length == 0 || o == undefined) return undefined; let part = path[0]; const lastBracket = part.lastIndexOf("["); @@ -189,7 +198,7 @@ const extractFlagValues = (flagPath: string, file: any): FlagMatchRuleValue[] => return strings.map((s, i) => ({ path: actualPath + "/" + part + "[" + i + "]", value: s })); } else { return opart.reduce((res: FlagMatchRuleValue[] | undefined, o: any, i: number) => { - const newObjectPaths = [o, ...objectPath]; + const newObjectPaths = [o, ...objectPath]; let matches = getValues(path.slice(1), newObjectPaths, actualPath + "/" + part + "[" + i + "]", o); if (matches) { const r2 = res || []; @@ -237,19 +246,34 @@ export const extractProofHintFlags = (proof?: Proof): ProofHintFlags | undefined if (results) { valid = results.failure.length == 0 && results.success.length > 0; } - if (valid) { - const dateCreated = extractFlagValues("integrity/c2pa/manifest_info/manifests[]/assertions[label=c2pa.actions]/data/actions[action=c2pa.created]/../../../../signature_info/time", proof); - console.log("DATE CREATED", dateCreated); + const source = extractFlagValues( + "integrity/c2pa/manifest_info/manifests[]/assertions[label=c2pa.actions]/data/actions[action=c2pa.created]/softwareAgent", + proof + ); - const flags: ProofHintFlags = { - aiGenerated: matchFlag(ruleAiGenerated(), proof).result, - aiEdited, - screenshot: matchFlag(ruleScreenshot(), proof).result, - camera: matchFlag(ruleCamera(), proof).result, - }; - return flags; + const dateCreated = extractFlagValues( + "integrity/c2pa/manifest_info/manifests[]/assertions[label=c2pa.actions]/data/actions[action=c2pa.created]/../../../../signature_info/time", + proof + ); + let date: Date | undefined = undefined; + if (dateCreated && dateCreated.length == 1) { + try { + date = new Date(Date.parse(dateCreated[0].value)); + } catch (error) {} } + console.log("DATE CREATED", date); + + const flags: ProofHintFlags = { + valid: valid, + source: source && source.length == 1 ? source[0].value : undefined, + creationDate: date, + aiGenerated: matchFlag(ruleAiGenerated(), proof).result, + aiEdited, + screenshot: matchFlag(ruleScreenshot(), proof).result, + camera: matchFlag(ruleCamera(), proof).result, + }; + return flags; } catch (error) {} return undefined; };