diff --git a/README.md b/README.md index b86a3a8..ecdb2d5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Nuxt Minimal Starter + + Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. ## Setup diff --git a/app.vue b/app.vue index fbc6572..a0a0ed6 100644 --- a/app.vue +++ b/app.vue @@ -9,21 +9,31 @@ const banner = useState("banner", () => false); +let currentTheme = "dark" // default theme +const savedTheme = localStorage.getItem("selectedTheme"); +if (savedTheme) { + currentTheme = savedTheme; +} + +const baseURL = useRuntimeConfig().app.baseURL; + +useHead({ + link: [ + { + rel: "stylesheet", + href: `${baseURL}themes/${currentTheme}.css` + } + ] +}) \ No newline at end of file diff --git a/components/Channel.vue b/components/Channel.vue index 1828641..0f48323 100644 --- a/components/Channel.vue +++ b/components/Channel.vue @@ -36,6 +36,6 @@ const isCurrentChannel = props.uuid == props.currentUuid; } .current-channel { - background-color: rgb(70, 70, 70); + background-color: var(--sidebar-highlighted-background-color); } \ No newline at end of file diff --git a/components/CropPopup.vue b/components/CropPopup.vue new file mode 100644 index 0000000..12c3a0b --- /dev/null +++ b/components/CropPopup.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/components/MemberEntry.vue b/components/MemberEntry.vue new file mode 100644 index 0000000..c77c429 --- /dev/null +++ b/components/MemberEntry.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/components/Message.vue b/components/Message.vue index 5cd7773..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/Settings/AppSettings/Appearance.vue b/components/Settings/AppSettings/Appearance.vue index 135c0a1..3adfda6 100644 --- a/components/Settings/AppSettings/Appearance.vue +++ b/components/Settings/AppSettings/Appearance.vue @@ -1,14 +1,100 @@ \ No newline at end of file +.theme-preview-container { + margin: .5em; + width: 5em; + height: 5em; +} + +.theme-preview { + width: 5em; + height: 5em; + border-radius: 100%; + border: .1em solid var(--primary-color); + + display: inline-block; + text-align: center; + align-content: center; + cursor: pointer; +} + +.theme-title { + font-size: .8em; + line-height: 5em; /* same height as the parent to centre it vertically */ +} + diff --git a/components/Settings/UserSettings/Account.vue b/components/Settings/UserSettings/Account.vue index 0fe5013..5d76a0a 100644 --- a/components/Settings/UserSettings/Account.vue +++ b/components/Settings/UserSettings/Account.vue @@ -1,33 +1,16 @@