Skip to content

Commit 2667e04

Browse files
committed
(UI) improve image hover icons
1 parent e22c592 commit 2667e04

File tree

2 files changed

+44
-29
lines changed

2 files changed

+44
-29
lines changed

src/ChatWindow/ChatMessage.vue

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,24 @@
5656
'image-loading': isImageLoading && message.sender_id === 'me'
5757
}"
5858
:style="{ background: `url(${message.file.url})` }"
59-
></div>
60-
<transition name="fade">
61-
<div class="image-buttons" v-if="imageHover">
62-
<div
63-
class="svg-button button-view"
64-
@click.stop="openFile(message.file)"
65-
>
66-
<svg-icon name="eye" />
67-
</div>
68-
<div
69-
class="svg-button button-download"
70-
@click.stop="openFile(message.file)"
71-
>
72-
<svg-icon name="document" />
59+
>
60+
<transition name="fade">
61+
<div class="image-buttons" v-if="imageHover">
62+
<div
63+
class="svg-button button-view"
64+
@click.stop="openFile(message.file)"
65+
>
66+
<svg-icon name="eye" />
67+
</div>
68+
<div
69+
class="svg-button button-download"
70+
@click.stop="openFile(message.file)"
71+
>
72+
<svg-icon name="document" />
73+
</div>
7374
</div>
74-
</div>
75-
</transition>
75+
</transition>
76+
</div>
7677
<span>{{ message.content }}</span>
7778
</div>
7879

@@ -314,6 +315,7 @@ export default {
314315
}
315316
316317
.message-image {
318+
position: relative;
317319
background-color: #ddd !important;
318320
background-size: cover !important;
319321
background-position: center center !important;
@@ -414,30 +416,43 @@ export default {
414416
}
415417
416418
.image-buttons {
419+
position: absolute;
420+
width: 100%;
421+
height: 100%;
422+
border-radius: 4px;
423+
background: linear-gradient(
424+
to bottom,
425+
rgba(0, 0, 0, 0) 55%,
426+
rgba(0, 0, 0, 0.02) 60%,
427+
rgba(0, 0, 0, 0.05) 65%,
428+
rgba(0, 0, 0, 0.1) 70%,
429+
rgba(0, 0, 0, 0.2) 75%,
430+
rgba(0, 0, 0, 0.3) 80%,
431+
rgba(0, 0, 0, 0.5) 85%,
432+
rgba(0, 0, 0, 0.6) 90%,
433+
rgba(0, 0, 0, 0.7) 95%,
434+
rgba(0, 0, 0, 0.8) 100%
435+
);
436+
417437
svg {
418-
height: 20px;
419-
width: 20px;
438+
height: 26px;
439+
width: 26px;
420440
}
421441
422442
.button-view,
423443
.button-download {
424444
position: absolute;
425-
bottom: 2px;
426-
left: 5px;
445+
bottom: 6px;
446+
left: 7px;
427447
}
428448
429449
:first-child {
430-
left: 30px;
450+
left: 40px;
431451
}
432452
433453
.button-view {
434454
max-width: 18px;
435-
bottom: 4px;
436-
437-
svg {
438-
height: 18px;
439-
width: 18px;
440-
}
455+
bottom: 8px;
441456
}
442457
}
443458
@@ -446,7 +461,7 @@ export default {
446461
}
447462
448463
.fade-enter-active {
449-
transition: opacity 1.5s;
464+
transition: opacity 1s;
450465
}
451466
452467
.fade-leave-active {

src/themes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const defaultThemeColors = {
4040
pencilEdited: '#9e9e9e',
4141
trash: '#f44336',
4242
checkmark: '#0696c7',
43-
eye: '#9ca6af'
43+
eye: '#fff'
4444
}
4545
},
4646
dark: {

0 commit comments

Comments
 (0)