Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposed initial poc 'benchmark' ui - #115 #264

Merged
merged 1 commit into from
Jul 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion client/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,25 @@ a.github-fork {
.transform(translateX(0));
}
}
&.layout1 {
.calc(width, ~'100% - ' @rooms-box-width + @flex-tab-webrtc-width);
margin-right: 420px;
.flex-tab {
max-width: @flex-tab-webrtc-width;
.transform(translateX(0));

}

}
&.layout2 {
.calc(width, ~'100% - ' @rooms-box-width + @flex-tab-webrtc-2-width);
margin-right: 420px;
.flex-tab {
max-width: @flex-tab-webrtc-2-width;
.transform(translateX(0));
}

}
.container-fluid {
padding-top: 0;
}
Expand Down Expand Up @@ -2125,7 +2144,7 @@ a.github-fork {
}
}
}
}
}
}
.search-form {
padding: 0 4px 0 0;
Expand Down
2 changes: 2 additions & 0 deletions client/stylesheets/global/_variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

@rooms-box-width: 260px;
@flex-tab-width: 400px;
@flex-tab-webrtc-width: 400px;
@flex-tab-webrtc-2-width: 850px;

// Colors
// --------------
Expand Down
10 changes: 10 additions & 0 deletions client/views/app/layout.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
Template.appLayout.helpers
flexOpened: ->
console.log 'layout.helpers flexOpened' if window.rocketDebug
return 'flex-opened' if Session.equals('flexOpened', true)

flexOpenedRTC1: ->
console.log 'layout.helpers flexOpenedRTC1' if window.rocketDebug
return 'layout1' if Session.equals('flexOpenedRTC1', true)

flexOpenedRTC2: ->
console.log 'layout.helpers flexOpenedRTC2' if window.rocketDebug
return 'layout2' if Session.equals('flexOpenedRTC2', true)


Template.appLayout.rendered = ->
$('html').addClass("noscroll").removeClass "scroll"

Expand Down
2 changes: 1 addition & 1 deletion client/views/app/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="connection-status">
{{> status}}
</div>
<main class="main-content {{flexOpened}}">
<main class="main-content {{flexOpened}} {{flexOpenedRTC1}} {{flexOpenedRTC2}}">
{{> yield}}
</main>
{{> sideNav }}
Expand Down
39 changes: 38 additions & 1 deletion client/views/app/room.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ Template.room.helpers
console.log 'room.helpers flexOpened' if window.rocketDebug
return 'opened' if Session.equals('flexOpened', true)

flexOpenedRTC1: ->
console.log 'room.helpers flexOpenedRTC1' if window.rocketDebug
return 'layout1' if Session.equals('flexOpenedRTC1', true)

flexOpenedRTC2: ->
console.log 'room.helpers flexOpenedRTC2' if window.rocketDebug
return 'layout2' if Session.equals('flexOpenedRTC2', true)


arrowPosition: ->
console.log 'room.helpers arrowPosition' if window.rocketDebug
return 'left' unless Session.equals('flexOpened', true)
Expand Down Expand Up @@ -267,12 +276,24 @@ Template.room.helpers
selfVideoUrl: ->
return Session.get('selfVideoUrl')

rtcLayout1: ->
return Session.get('flexOpenedRTC1');

rtcLayout2: ->
return Session.get('flexOpenedRTC2');


Template.room.events

"click .flex-tab .more": (event) ->
console.log 'room click .flex-tab .more' if window.rocketDebug
Session.set('flexOpened', !Session.get('flexOpened'))
if (Session.get('flexOpened'))
Session.set('flexOpenedRTC2', false);
Session.set('flexOpenedRTC1', false);
Session.set('flexOpened',false);
else
Session.set('flexOpened', !Session.get('flexOpened'))


'click .chat-new-messages': (event) ->
console.log 'room click .chat-new-messages' if window.rocketDebug
Expand Down Expand Up @@ -358,6 +379,22 @@ Template.room.events
Session.set('flexOpened', true)
Session.set('showUserInfo', $(e.currentTarget).data('username'))

"click .flex-tab .video-remote" : (e) ->
console.log 'room click .flex-tab .avatar-image' if window.rocketDebug
if (Session.get('flexOpenedRTC2'))
console.log 'resetting both flexOpenedRTC1 and flexOpenedRTC2 to false' if window.rocketDebug
Session.set('flexOpenedRTC1', false)
Session.set('flexOpenedRTC2', false)
else
if (Session.get('flexOpenedRTC1'))
console.log 'flexOpenedRTC2 set to true' if window.rocketDebug
Session.set('flexOpenedRTC2', true)
else
if (Session.get('flexOpened'))
console.log 'flexOpenedRTC1 set to true' if window.rocketDebug
Session.set('flexOpenedRTC1', true)


'click .user-card-message': (e) ->
console.log 'room click .user-card-message' if window.rocketDebug
roomData = Session.get('roomData' + this._arguments[1].rid)
Expand Down
24 changes: 20 additions & 4 deletions client/views/app/room.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,28 @@ <h3>{{username}}</h3>
<div class="user-view">
{{#with userData}}
<div class="about cf_">
<div>

{{#if selfVideoUrl}}
<video class="video-remote" src="{{remoteVideoUrl}}" style="width: 100%; margin-bottom: 10px; background-color: #000;" autoplay></video>
<video class="video-self" src="{{selfVideoUrl}}" style="width: 100px; position: absolute; top: 21px; right: 21px; border: 1px solid #FFF; background-color: #000;" autoplay muted></video>
{{#if rtcLayout2}}
<div style="display: flex; flex-direction: row; align-items: center; width: 800px; height: 350px">
<video class="video-remote" src="{{remoteVideoUrl}}" style="flex: 1 0; width: 480px; margin: 10px; background-color: #000;" autoplay></video>
<video class="video-self" src="{{selfVideoUrl}}" style="flex: 1 0; width: 480px; margin: 10px; background-color: #000;" autoplay muted></video>
</div>
{{else}}
{{#if rtcLayout1}}
<div style="display: flex; flex-direction: column; align-items: center; width: 360px; height: 500px">
<video class="video-remote" src="{{remoteVideoUrl}}" style="flex: 1 1; width: 320px; margin: 10px; background-color: #000;" autoplay></video>
<video class="video-self" src="{{selfVideoUrl}}" style="flex: 1 1; width: 320px; margin: 10px; background-color: #000;" autoplay muted></video>
</div>
{{else}}
<div>
<video class="video-remote" src="{{remoteVideoUrl}}" style="width: 100%; align-items: center; margin-bottom: 10px; background-color: #000; transition: width 2s, height 2s, top 2s, left 2s, transform 2s;" autoplay></video>
<video class="video-self" src="{{selfVideoUrl}}" style="width: 100px; position: absolute; top: 21px; right: 21px; border: 1px solid #FFF; background-color: #000; transition: width 2s, height 2s, top 2s, left 2s, transform 2s;" autoplay muted></video>
</div>
{{/if}}
{{/if}}
{{/if}}
</div>

<div class="thumb">
{{> avatar username=username}}
</div>
Expand Down