import { Message } from "@/types/message/index";
const Messages: Message[] = [
- {
- content:
- "I can be there at 5 pm tomorrow to greet you at a Chick file with my almond and chive salad.",
- context: "You to Josie Wright",
- subContext: "josie@gmail.com",
- modifier: "sf",
- id: "1",
- time: ""
- },
{
content: "Sounds good, see you Thursday.",
context: "Message from Josie Wright",
time: ""
},
{
- content: "Hey Anna, did you get the paper done?",
- context: "Mesage from Tommy McConville",
- subContext: "New Conversation",
- modifier: "ai",
- id: "3",
- time: ""
- },
- {
- content: "Yes posting it online soon.",
- context: "You to Tommy McConville",
- subContext: "",
- modifier: "ai",
- id: "4",
+ content:
+ "I can be there at 5 pm tomorrow to greet you at a Chick file with my almond and chive salad.",
+ context: "You to Josie Wright",
+ subContext: "josie@gmail.com",
+ modifier: "sf",
+ id: "1",
time: ""
},
{
id: "6",
time: ""
},
+
+ {
+ content: "Hey Anna, did you get the paper done?",
+ context: "Mesage from Tommy McConville",
+ subContext: "New Conversation",
+ modifier: "ai",
+ id: "3",
+ time: ""
+ },
{
content: "Hey do you know Enrique Hernandez?",
context: "Message from Crimata",
id: "7",
time: ""
},
+
+ {
+ content: "Yes posting it online soon.",
+ context: "You to Tommy McConville",
+ subContext: "",
+ modifier: "sf",
+ id: "4",
+ time: ""
+ },
{
content: "Hey do you know Enrique Hernandez?",
context: "Message from Crimata",
export default function useOffsetCalculator() {
const xOffset = ref(0);
const yOffset = ref(0);
+ const firstChildMarginTop = 40;
let previousMessageHeight = 0;
const messagePadding = 10;
-
function setXoffset(message: HTMLElement): void {
const computedQuery = window.getComputedStyle(message)
const matrix = new WebKitCSSMatrix(computedQuery.webkitTransform);
function setYoffset(messageHeight: number): void {
if (previousMessageHeight === 0) {
- yOffset.value = 40;
+ yOffset.value = firstChildMarginTop;
} else {
yOffset.value += previousMessageHeight + messagePadding;
}