diff --git a/src/App.vue b/src/App.vue index 244e055..63e9a66 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,7 +12,16 @@ import config from "./assets/config"; export default { name: "App", mounted() { - if (window.location.protocol == "http" && !window.location.hostname.endsWith('.onion')) { + // Set RTL mode if flag given in config. TODO: this should be based on language, not a global setting. + // + if (config.rtl) { + this.$vuetify.rtl = true; + document.documentElement.setAttribute("dir", "rtl"); + } + if ( + window.location.protocol == "http" && + !window.location.hostname.endsWith(".onion") + ) { // Redirect to HTTPS window.location.href = window.location.href.replace("http:", "https:"); return; diff --git a/src/assets/config.json b/src/assets/config.json index 70a82c2..7cbcb80 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -4,6 +4,7 @@ "productLink": "letsconvene.im", "defaultServer": "https://neo.keanu.im", "useShortCodeStickers": false, + "rtl": false, "analytics": { "enabled": true, "config": { diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index efe659d..bc9bff4 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -51,6 +51,7 @@ $admin-fg: white; position: absolute; top: 10px; left: 40px; + right: initial; color: white; background-color: black; font-size: 10px; @@ -61,6 +62,10 @@ $admin-fg: white; text-align: center; padding-left: 4px; padding-right: 4px; + [dir="rtl"] & { + right: 40px; + left: initial; + } } .chat-root { @@ -138,6 +143,9 @@ $admin-fg: white; overflow-x: hidden; overflow-y: auto; padding: 0 0 0px 20px; + [dir="rtl"] & { + padding: 0 20px 0px 0px; + } margin: 6px 0; font-family: "Inter", sans-serif; font-weight: 300; @@ -181,10 +189,16 @@ $admin-fg: white; .messageIn { margin: 8px; text-align: left; + [dir="rtl"] & { + text-align: right; + } position: relative; .bubble { background-color: #eeeeee; border-radius: 0px 10px 10px 10px; + [dir="rtl"] & { + border-radius: 10px 0px 10px 0px; + } padding: 8px; border-width: 1px !important; border-style: solid !important; @@ -220,6 +234,10 @@ $admin-fg: white; display: inline-block; vertical-align: top !important; margin-right: 10px; + [dir="rtl"] & { + margin-right: initial; + margin-left: 10px; + } top: 0; border: 2px solid white; } @@ -234,6 +252,10 @@ $admin-fg: white; color: rgba(#000000, 0.6); margin-left: 40px; margin-right: 8px; + [dir="rtl"] & { + margin-left: 8px; + margin-right: 40px; + } display: inline-block; } .time { @@ -252,10 +274,16 @@ $admin-fg: white; .messageOut { margin: 8px; text-align: right; + [dir="rtl"] & { + text-align: left; + } position: relative; .bubble { background-color: #e5e5e5; border-radius: 10px 10px 0 10px; + [dir="rtl"] & { + border-radius: 10px 10px 10px 0px; + } padding: 8px; display: inline-block; position: relative; @@ -264,6 +292,9 @@ $admin-fg: white; .audio-bubble { background-color: #e5e5e5; border-radius: 10px 10px 0 10px; + [dir="rtl"] & { + border-radius: 10px 10px 10px 0px; + } padding: 8px; display: inline-block; position: relative; @@ -274,6 +305,9 @@ $admin-fg: white; .video2-bubble { background-color: #e5e5e5; border-radius: 10px 10px 0 10px; + [dir="rtl"] & { + border-radius: 10px 10px 10px 0px; + } } .bubble.image-bubble { padding: 0px; @@ -283,6 +317,9 @@ $admin-fg: white; .v-image, video { border-radius: 10px 10px 0 10px; + [dir="rtl"] & { + border-radius: 10px 10px 10px 0px; + } } } .bubble.sticker-bubble { @@ -296,6 +333,10 @@ $admin-fg: white; display: inline-block; vertical-align: bottom !important; margin-left: 10px; + [dir="rtl"] & { + margin-left: initial; + margin-right: 10px; + } bottom: 0; border: 2px solid white; } @@ -311,6 +352,10 @@ $admin-fg: white; display: inline-block; margin-left: 40px; margin-right: 8px; + [dir="rtl"] & { + margin-left: 8px; + margin-right: 40px; + } } .time { font-family: "Inter", sans-serif; @@ -566,6 +611,9 @@ $admin-fg: white; top: -4px; background: white; transform: translate(-50%, 0); + [dir="rtl"] & { + transform: translate(50%, 0); + } padding-left: 4px; padding-right: 4px; content: attr(title); @@ -595,6 +643,9 @@ $admin-fg: white; top: -8px; background: white; transform: translate(-50%, 0); + [dir="rtl"] & { + transform: translate(50%, 0); + } padding-left: 10px; padding-right: 10px; content: attr(title); @@ -684,6 +735,11 @@ $admin-fg: white; font-size: 14 * $chat-text-size; font-weight: bold; margin-left: 10px; + [dir="rtl"] & { + margin-left: initial; + margin-right: 10px; + } + text-decoration: underline; } } @@ -695,12 +751,24 @@ $admin-fg: white; margin: 10px 0px; font-weight: bold; font-size: 12 * $chat-text-size; + [dir="rtl"] & { + right: 0px; + left: unset; + .v-icon { + // Mirror the icon + transform: scale(-1, 1); + } + } } .header-button-right { position: absolute; top: 0px; right: 0px; + [dir="rtl"] & { + left: 0px; + right: unset; + } margin: 10px 0px; font-weight: bold; font-size: 12 * $chat-text-size; @@ -729,6 +797,10 @@ $admin-fg: white; font-size: 14 * $chat-text-size; font-weight: bold; margin-left: 10px; + [dir="rtl"] & { + margin-left: initial; + margin-right: 10px; + } } } diff --git a/src/components/ActionRow.vue b/src/components/ActionRow.vue index 47c5162..80f82ec 100644 --- a/src/components/ActionRow.vue +++ b/src/components/ActionRow.vue @@ -1,6 +1,11 @@ @@ -121,42 +137,50 @@ export default { \ No newline at end of file diff --git a/src/components/RoomInfo.vue b/src/components/RoomInfo.vue index a74ee0d..5f4b335 100644 --- a/src/components/RoomInfo.vue +++ b/src/components/RoomInfo.vue @@ -15,7 +15,7 @@ 👋 {{ $t("room_info.leave_room") }} @@ -83,7 +83,7 @@ item-value="id" >