Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit 38bfbb5

Browse files
authored
Avatar video fallback (#170)
* Add tile variation to avatars and place in live stream video * Update higher resolution avatar samples * Refactor paths to work relatively
1 parent 92c390f commit 38bfbb5

File tree

17 files changed

+60
-19
lines changed

17 files changed

+60
-19
lines changed
49.3 KB
Loading
30.3 KB
Loading

app/assets/images/sage/avatar/cj.png

35.5 KB
Loading
48.6 KB
Loading
24.6 KB
Loading
43.5 KB
Loading

app/assets/images/sage/avatar/jay.png

35.7 KB
Loading

app/assets/images/sage/avatar/jj.png

36.8 KB
Loading
40.6 KB
Loading
96 KB
Loading
33.2 KB
Loading

app/assets/stylesheets/sage/system/patterns/elements/_live_stream_wrapper.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
&:not(:last-child) {
2222
margin-bottom: sage-spacing(md);
2323
}
24-
}
25-
}
2624

27-
.sage-live-stream-wrapper--fullscreen-demo {
28-
position: absolute;
29-
z-index: sage-z-index(nuclear);
25+
&.sage-live-stream-wrapper--fullscreen-demo {
26+
position: absolute;
27+
z-index: sage-z-index(nuclear);
28+
}
29+
}
3030
}

app/assets/stylesheets/sage/system/patterns/objects/_live_avatar.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ $-live-avatar-ring-colors: (
3333
bg: sage-color(red, 100)
3434
)
3535
);
36+
$-live-avatar-tile-size: rem(216px);
3637

3738
.sage-live-avatar {
3839
display: grid;
3940
grid-template-columns: 100%;
4041
grid-template-rows: 100%;
4142
grid-template-areas: "full";
4243
align-items: center;
43-
justify-content: center;
44+
justify-items: center;
4445
position: relative;
4546
width: $-live-avatar-min-size;
4647
height: $-live-avatar-min-size;
@@ -83,6 +84,11 @@ $-live-avatar-ring-colors: (
8384
height: 100%;
8485
}
8586

87+
.sage-live-avatar--tile {
88+
padding: sage-spacing(md);
89+
border-radius: initial;
90+
}
91+
8692
// Set up color variations
8793
@each $color, $settings in $-live-avatar-ring-colors {
8894
.sage-live-avatar--#{"" + $color} {
@@ -110,14 +116,22 @@ $-live-avatar-ring-colors: (
110116
fill: map-get($settings, main);
111117
}
112118
}
119+
120+
.sage-live-avatar--tile & {
121+
max-width: $-live-avatar-tile-size;
122+
}
113123
}
114124

115125
.sage-live-avatar__image {
116126
position: relative;
117127
z-index: sage-z-index(default, 2);
118128
grid-area: full;
119129
width: 100%;
120-
height: 100%;
121130
border-radius: sage-border(radius-round);
122131
object-fit: cover;
132+
133+
.sage-live-avatar--tile & {
134+
max-width: $-live-avatar-tile-size;
135+
max-height: $-live-avatar-tile-size;
136+
}
123137
}

app/views/sage/examples/objects/live_avatar/_preview.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
initials: "LJ",
2525
color: "",
2626
hasRing: false,
27-
url: "/assets/sage/avatar/jay.png",
27+
url: "../../assets/sage/avatar/jay.png",
2828
scale: false,
2929
custom_class: ""
3030
%>
@@ -54,7 +54,7 @@
5454
initials: "CJ",
5555
color: "sage",
5656
hasRing: true,
57-
url: "/assets/sage/avatar/cj.png",
57+
url: "../../assets/sage/avatar/cj.png",
5858
scale: false,
5959
custom_class: ""
6060
%>
@@ -99,7 +99,7 @@
9999
initials: "LJ",
100100
color: "",
101101
hasRing: false,
102-
url: "/assets/sage/avatar/jay.png",
102+
url: "../../assets/sage/avatar/jay.png",
103103
scale: true,
104104
custom_class: ""
105105
%>
@@ -109,7 +109,7 @@
109109
initials: "LJ",
110110
color: "",
111111
hasRing: false,
112-
url: "/assets/sage/avatar/jay.png",
112+
url: "../../assets/sage/avatar/jay.png",
113113
scale: true,
114114
custom_class: ""
115115
%>
@@ -119,7 +119,7 @@
119119
initials: "LJ",
120120
color: "",
121121
hasRing: false,
122-
url: "/assets/sage/avatar/jay.png",
122+
url: "../../assets/sage/avatar/jay.png",
123123
scale: true,
124124
custom_class: ""
125125
%>

app/views/sage/examples/objects/live_profile_card/_preview.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
initials: "JC",
88
color: "",
99
hasRing: false,
10-
url: "/assets/sage/avatar/jay.png",
10+
url: "../../assets/sage/avatar/jay.png",
1111
iconsActive: true
1212
%>
1313

@@ -20,7 +20,7 @@
2020
initials: "JC",
2121
color: "sage",
2222
hasRing: false,
23-
url: "/assets/sage/avatar/cj.png",
23+
url: "../../assets/sage/avatar/cj.png",
2424
iconsActive: false
2525
%>
2626
</ul>
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
<div class="sage-live-stream-video-grid sage-live-stream-video-grid--<%= numVideos > 1 ? "#{numVideos}-up": "solo" %>">
2-
<% for video in (1..numVideos) %>
1+
<div class="sage-live-stream-video-grid sage-live-stream-video-grid--<%= videos.size > 1 ? "#{videos.size}-up": "solo" %>">
2+
<% videos.each do |video| %>
33
<div class="sage-live-stream-video-grid__tile">
4-
<!-- NOTE: This is just placeholder as it will be replaced with actual video containers in the interface -->
5-
<img src="https://source.unsplash.com/random/780x540" class="sage-live-stream-video-grid__video" alt="Video placeholder" />
4+
<%= render "sage/examples/objects/live_avatar/markup",
5+
initials: video[:initials],
6+
color: video[:color],
7+
hasRing: false,
8+
url: video[:avatarURL],
9+
scale: true,
10+
custom_class: "sage-live-stream-video-grid__video sage-live-avatar--tile"
11+
%>
612
</div>
713
<% end %>
814
</div>

app/views/sage/examples/objects/live_stream_video_grid/_preview.html.erb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@
66
runningTime: '00:32:13'
77
%>
88
<%= render "sage/examples/objects/live_stream_video_grid/markup",
9-
numVideos: 5
9+
videos: [
10+
{
11+
initials: 'CJ',
12+
avatarURL: '',
13+
color: '',
14+
},
15+
{
16+
initials: 'CM',
17+
avatarURL: '../../assets/sage/avatar/court.png',
18+
color: '',
19+
},
20+
{
21+
initials: 'PJ',
22+
avatarURL: '../../assets/sage/avatar/phil.png',
23+
color: 'red',
24+
},
25+
{
26+
initials: 'JJ',
27+
avatarURL: '',
28+
color: 'sage',
29+
}
30+
]
1031
%>
1132
<%= render "sage/examples/objects/live_stream_footer/markup",
1233
isAwake: true

0 commit comments

Comments
 (0)