diff --git a/app.vue b/app.vue index f606843..ffdb884 100644 --- a/app.vue +++ b/app.vue @@ -9,17 +9,17 @@ const banner = useState("banner", () => false); -let current_theme = "dark" // default theme -const saved_theme = localStorage.getItem("selectedTheme"); -if (saved_theme) { - current_theme = saved_theme; +let currentTheme = "dark" // default theme +const savedTheme = localStorage.getItem("selectedTheme"); +if (savedTheme) { + currentTheme = savedTheme; } useHead({ link: [ { rel: "stylesheet", - href: `/themes/${current_theme}.css` + href: `/themes/${currentTheme}.css` } ] }) diff --git a/components/MemberEntry.vue b/components/MemberEntry.vue new file mode 100644 index 0000000..3eed3c5 --- /dev/null +++ b/components/MemberEntry.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/components/Message.vue b/components/Message.vue index e8bb600..e8a91b5 100644 --- a/components/Message.vue +++ b/components/Message.vue @@ -10,6 +10,8 @@ {{ username }} + Yesterday at + {{ date.toLocaleDateString(undefined) }}, {{ date.toLocaleTimeString(undefined, { timeStyle: "short" }) }} @@ -49,6 +51,7 @@ const messageElement = ref(); const dateHidden = ref(true); const date = new Date(props.timestamp); +const currentDate: Date = new Date() console.log("message:", props.text); console.log("author:", props.username); @@ -74,6 +77,17 @@ onMounted(async () => { // showHover.value = !showHover.value; //} +function getDayDifference(date1: Date, date2: Date) { + const midnight1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()); + const midnight2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); + + const timeDifference = midnight2.getTime() - midnight1.getTime(); + + const dayDifference = timeDifference / (1000 * 60 * 60 * 24); + + return Math.round(dayDifference); +} + \ No newline at end of file diff --git a/components/UserArea.vue b/components/UserArea.vue new file mode 100644 index 0000000..d922c3f --- /dev/null +++ b/components/UserArea.vue @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/components/UserPopup.vue b/components/UserPopup.vue index b27ecea..3a65cf0 100644 --- a/components/UserPopup.vue +++ b/components/UserPopup.vue @@ -1,6 +1,8 @@