BIN
src/assets/avatars/av_baboon.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
src/assets/avatars/av_badger.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_bear.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_bee.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_beta.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_bunny.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_butterfly.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_cardinal.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_cat.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_cockatoo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_crab_2.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_crane.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_dragonfly.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_eagle.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_egret.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_elephant.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_flamingo.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_fox.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_gazelle.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_giraffe.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/avatars/av_gorilla.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/assets/avatars/av_hedgehog.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/avatars/av_hippo.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_horse.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_hummingbird.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_iguna.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/avatars/av_jellyfish.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_leopard.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src/assets/avatars/av_lion.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/avatars/av_lionfish.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_lizard.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_macaw.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_mantis.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_octopus.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_orangutan.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_osprey.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_otter.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/avatars/av_owl.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/avatars/av_panda.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_pangolin.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/avatars/av_panther.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_peacock.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
src/assets/avatars/av_penguin.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/avatars/av_polar bear.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_puffin.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_puppy.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_rhino.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_rooster.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/avatars/av_shark.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/avatars/av_sloth.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_snake.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/avatars/av_squirrel.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_starfish.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/avatars/av_stingray.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/avatars/av_tiger.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src/assets/avatars/av_tucan.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/avatars/av_turtle.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/avatars/av_walrus.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/avatars/av_whaleshark.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/avatars/av_yak.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/avatars/av_zebra.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,5 +0,0 @@
|
|||
Guest Pangolin
|
||||
Guest Cat
|
||||
Guest Dog
|
||||
Guest Iguana
|
||||
Guest Sloth
|
||||
|
|
@ -24,20 +24,32 @@
|
|||
<v-container class="join-user-info">
|
||||
<v-row>
|
||||
<v-col class="flex-grow-0 flex-shrink-0">
|
||||
<v-avatar @click="showAvatarPicker = true">
|
||||
<v-img v-if="avatar" :src="avatar.image" />
|
||||
<v-avatar @click="showAvatarPickerList">
|
||||
<v-img v-if="profile" :src="profile.image" />
|
||||
</v-avatar>
|
||||
</v-col>
|
||||
<v-col class="flex-shrink-1 flex-grow-1">
|
||||
<v-combobox
|
||||
v-if="!currentUser || currentUser"
|
||||
@update:search-input="updateDisplayName"
|
||||
:items="defaultDisplayNames"
|
||||
:value="userDisplayName || displayName"
|
||||
<v-select
|
||||
ref="avatar"
|
||||
:items="availableAvatars"
|
||||
cache-items
|
||||
label="User name"
|
||||
outlined
|
||||
dense
|
||||
></v-combobox>
|
||||
@change="selectAvatar"
|
||||
:value="availableAvatars[0]"
|
||||
single-line
|
||||
>
|
||||
<template v-slot:selection>
|
||||
<v-text-field background-color="transparent" solo flat hide-details @click.native.stop="{}" v-model="profile.name"></v-text-field>
|
||||
</template>
|
||||
<template v-slot:item="data">
|
||||
<v-avatar size="32">
|
||||
<v-img :src="data.item.image" />
|
||||
</v-avatar>
|
||||
<div class="ml-2">{{ data.item.name }}</div>
|
||||
</template>
|
||||
</v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
|
@ -78,48 +90,6 @@
|
|||
|
||||
<div v-if="loadingMessage">{{ loadingMessage }}</div>
|
||||
</div>
|
||||
|
||||
<v-dialog
|
||||
scrollable
|
||||
:fullscreen="$vuetify.breakpoint.xs"
|
||||
width="500"
|
||||
transition="dialog-bottom-transition"
|
||||
v-model="showAvatarPicker"
|
||||
>
|
||||
<v-card>
|
||||
<v-toolbar dark flat color="primary">
|
||||
<v-btn icon dark @click="showAvatarPicker = false">
|
||||
<v-icon>close</v-icon>
|
||||
</v-btn>
|
||||
<v-toolbar-title>Select an Avatar</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-container row wrap>
|
||||
<v-col
|
||||
v-for="avatar in availableAvatars"
|
||||
:key="avatar.id"
|
||||
xs4
|
||||
sm3
|
||||
d-flex
|
||||
>
|
||||
<v-card tile flat class="d-flex">
|
||||
<v-card-text class="d-flex">
|
||||
<v-avatar
|
||||
size="48"
|
||||
@click="selectAvatar(avatar)"
|
||||
class="avatar-picker-avatar"
|
||||
:class="{ current: avatar === selectedAvatar }"
|
||||
>
|
||||
<img :src="avatar.image" />
|
||||
</v-avatar>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -138,27 +108,15 @@ export default {
|
|||
loadingMessage: null,
|
||||
waitingForInfo: true,
|
||||
waitingForMembership: false,
|
||||
selectedAvatar: null,
|
||||
displayName: null,
|
||||
defaultDisplayNames: [],
|
||||
availableAvatars: [],
|
||||
showAvatarPicker: false,
|
||||
shouldSetAvatar: false,
|
||||
randomProfile: null,
|
||||
selectedProfile: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$matrix.on("Room.myMembership", this.onMyMembership);
|
||||
this.availableAvatars = util.getDefaultAvatars();
|
||||
this.selectedAvatar = this.userAvatar || this.availableAvatars[0];
|
||||
if (!this.currentUser || this.currentUser.is_guest) {
|
||||
var values = require("!!raw-loader!../assets/usernames.txt")
|
||||
.default.split("\n")
|
||||
.filter((item) => {
|
||||
return item.length > 0;
|
||||
});
|
||||
this.displayName = values[Math.floor(Math.random() * values.length)];
|
||||
this.defaultDisplayNames = values;
|
||||
}
|
||||
this.randomProfile = this.availableAvatars[Math.floor(Math.random() * this.availableAvatars.length)];
|
||||
},
|
||||
destroyed() {
|
||||
this.$matrix.off("Room.myMembership", this.onMyMembership);
|
||||
|
|
@ -182,21 +140,38 @@ export default {
|
|||
}
|
||||
return this.$matrix.currentRoomId;
|
||||
},
|
||||
|
||||
profile() {
|
||||
return {
|
||||
image: (this.selectedProfile ? this.selectedProfile.image : null) || this.userAvatar || this.randomProfile.image,
|
||||
name: (this.selectedProfile ? this.selectedProfile.name : null) || this.userDisplayName || this.randomProfile.name
|
||||
}
|
||||
},
|
||||
|
||||
hasChangedAvatar() {
|
||||
return this.userAvatar != this.profile.image;
|
||||
},
|
||||
|
||||
hasChangedDisplayName() {
|
||||
return this.userDisplayName != this.profile.name;
|
||||
},
|
||||
|
||||
userDisplayName() {
|
||||
return this.$matrix.userDisplayName;
|
||||
},
|
||||
|
||||
userAvatar() {
|
||||
if (!this.$matrix.userAvatar) {
|
||||
return null;
|
||||
}
|
||||
return { id: 'user', image: this.$matrix.matrixClient.mxcUrlToHttp(this.$matrix.userAvatar, 80, 80, 'scale', true) };
|
||||
return this.$matrix.matrixClient.mxcUrlToHttp(
|
||||
this.$matrix.userAvatar,
|
||||
80,
|
||||
80,
|
||||
"scale",
|
||||
true
|
||||
);
|
||||
},
|
||||
avatar() {
|
||||
if (!this.shouldSetAvatar) {
|
||||
return this.userAvatar || this.selectedAvatar; // TODO - Use random
|
||||
}
|
||||
return this.selectedAvatar;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
roomId: {
|
||||
|
|
@ -205,7 +180,9 @@ export default {
|
|||
if (!value || (value && value == oldVal)) {
|
||||
return; // No change.
|
||||
}
|
||||
console.log("Join: Current room changed to " + (value ? value : "null"));
|
||||
console.log(
|
||||
"Join: Current room changed to " + (value ? value : "null")
|
||||
);
|
||||
this.roomName = this.roomId;
|
||||
if (this.currentUser) {
|
||||
this.waitingForMembership = true;
|
||||
|
|
@ -299,12 +276,12 @@ export default {
|
|||
function (user) {
|
||||
if (
|
||||
(this.currentUser && !this.currentUser.is_guest) ||
|
||||
!this.displayName || this.displayName == this.userDisplayName /* No change */
|
||||
!this.hasChangedDisplayName /* No change */
|
||||
) {
|
||||
return Promise.resolve(user);
|
||||
} else {
|
||||
return this.$matrix.matrixClient.setDisplayName(
|
||||
this.displayName,
|
||||
this.profile.name,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
|
|
@ -314,13 +291,13 @@ export default {
|
|||
function () {
|
||||
if (
|
||||
(this.currentUser && !this.currentUser.is_guest) ||
|
||||
!this.shouldSetAvatar
|
||||
!this.hasChangedAvatar /* No change */
|
||||
) {
|
||||
return Promise.resolve("no avatar");
|
||||
} else {
|
||||
return util.setAvatar(
|
||||
this.$matrix.matrixClient,
|
||||
this.selectedAvatar.image,
|
||||
this.profile.image,
|
||||
function (progress) {
|
||||
console.log("Progress: " + JSON.stringify(progress));
|
||||
}
|
||||
|
|
@ -355,17 +332,13 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
updateDisplayName(value) {
|
||||
this.displayName = value;
|
||||
selectAvatar(value) {
|
||||
this.selectedProfile = Object.assign({}, value); // Make a copy, so editing does not destroy data
|
||||
},
|
||||
|
||||
selectAvatar(avatar) {
|
||||
if (avatar && (!this.userAvatar || this.userAvatar.image != avatar.image)) {
|
||||
this.selectedAvatar = avatar;
|
||||
this.shouldSetAvatar = true;
|
||||
}
|
||||
this.showAvatarPicker = false;
|
||||
},
|
||||
showAvatarPickerList() {
|
||||
this.$refs.avatar.$refs.input.click();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -376,14 +376,11 @@ class Util {
|
|||
r.keys().forEach(res => {
|
||||
console.log("Avatar", res);
|
||||
// // Remove"./"
|
||||
// const parts = res.split("/");
|
||||
// const pack = parts[1];
|
||||
// const sticker = parts[2].split(".")[0];
|
||||
var name = res.split("_")[1];
|
||||
name = name.slice(0, name.indexOf("."));
|
||||
name = name.charAt(0).toUpperCase() + name.slice(1);
|
||||
const image = r(res);
|
||||
images.push({ id: res, image: image });
|
||||
// if (stickerPacks[pack] !== undefined) {
|
||||
// stickerPacks[pack].push({ image: image, name: sticker });
|
||||
// }
|
||||
images.push({ id: res, image: image, name: "Guest " + name });
|
||||
});
|
||||
return images;
|
||||
}
|
||||
|
|
|
|||