Skip to content

Commit

Permalink
Adjusted the active user indicator removing self and adding blinking …
Browse files Browse the repository at this point in the history
…animation
  • Loading branch information
Severino committed Dec 13, 2024
1 parent 311bc05 commit 0201588
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 23 deletions.
28 changes: 5 additions & 23 deletions resources/js/components/EntityDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,30 +156,10 @@
:icon-only="false"
/>
<div class="d-flex flex-row gap-2">
<div
<ActiveUsers
v-if="state.activeUsers.length > 0"
class="d-flex flex-row gap-1 align-items-center"
>
<div class="avatar-list">
<a
v-for="user in state.activeUsers"
:key="user.id"
href="#"
class="avatar-list-item"
@click.prevent="showUserInfo(user)"
>
<user-avatar
:user="user"
:size="20"
class="align-middle"
/>
</a>
</div>
<DotIndicator
:type="'success'"
style="width: 0.6rem;"
/>
</div>
:active-users="state.activeUsers"
/>
<div class="d-flex flex-row gap-1 align-items-center">
<i class="fas fa-fw fa-user-edit" />
<span :title="date(state.lastModified, undefined, true, true)">
Expand Down Expand Up @@ -471,12 +451,14 @@
import { usePreventNavigation } from '@/helpers/form.js';
import ActiveUsers from '@/components/user/ActiveUsers.vue';
import MetadataTab from '@/components/entity/MetadataTab.vue';
import EntityTypeLabel from '@/components/entity/EntityTypeLabel.vue';
import DotIndicator from '@/components/indicators/DotIndicator.vue';
export default {
components: {
ActiveUsers,
EntityTypeLabel,
MetadataTab,
DotIndicator,
Expand Down
66 changes: 66 additions & 0 deletions resources/js/components/user/ActiveUsers.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<template>
<div
v-if="otherUsers.length > 0"
class="d-flex flex-row gap-1 align-items-center rounded bg-white border border-1 border-primary p-1 px-2"
>
<DotIndicator
class="blink"
type="primary"
style="width: 0.6rem;"
/>

<div class="d-flex align-items-center avatar-list ps-2">
<a
v-for="user in otherUsers"
:key="user.id"
href="#"
class="avatar-list-item d-flex align-items-center text-decoration-none"
@click.prevent="showUserInfo(user)"
>
<user-avatar
:user="user"
:size="20"
class="align-middle"
/>
</a>
</div>
</div>
</template>

<script>
import {
showUserInfo,
} from '@/helpers/modal.js';
import { computed } from 'vue';
import useUserStore from '@/bootstrap/stores/user.js';
import DotIndicator from '@/components/indicators/DotIndicator.vue';
import UserAvatar from '@/components/UserAvatar.vue';
export default {
components: {
DotIndicator,
UserAvatar,
},
props: {
activeUsers: {
required: true,
type: Array,
},
},
setup(props) {
const userStore = useUserStore();
const otherUsers = computed(() => {
return props.activeUsers.filter(user => user.id !== userStore.getCurrentUserId);
});
return {
otherUsers,
showUserInfo,
};
},
};
</script>
10 changes: 10 additions & 0 deletions resources/sass/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@
opacity: 1;
transform: rotate(0deg);
}
}


.blink {
animation: blink ease-in-out 1s infinite;
}
@keyframes blink {
0% {opacity: 0;}
50% {opacity: 1;}
100% {opacity: 0;}
}

0 comments on commit 0201588

Please sign in to comment.