Implemented new playback scrubber textures.

This commit is contained in:
Nick Winter 2014-11-04 19:03:35 -08:00
parent 49b8c745a0
commit f461aeca95
11 changed files with 141 additions and 215 deletions

Binary file not shown.

Before

(image error) Size: 19 KiB

After

(image error) Size: 13 KiB

Before After
Before After

View file

@ -153,40 +153,6 @@ a
cursor: pointer cursor: pointer
// Bigger versions of some Bootstrap icons
// TODO: make the non-white versions of these if we ever need them
.icon.big
background-image: url(/images/pages/base/glyphicons-simplified.png)
.icon-white.big
background-image: url(/images/pages/base/glyphicons-simplified.png)
.icon.big, .icon-white.big
width: 19px
height: 19px
line-height: 19px
.icon-pause.big
background-position: -114px 0px
.icon-play.big
background-position: -95px 0px
.icon-repeat.big
background-position: -76px 0px
.icon-volume-off.big
background-position: -57px 0px
.icon-volume-down.big
background-position: -38px 0px
.icon-volume-up.big
background-position: -19px 0px
.icon-cog.big
background-position: 0px 0px
// loading screens for everything but the play view // loading screens for everything but the play view
.loading-screen .loading-screen
.progress .progress
@ -339,3 +305,7 @@ kbd
&.gem-60 &.gem-60
width: 60px width: 60px
height: 60px height: 60px
.popover
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
border-width: 15px 20px

View file

@ -144,14 +144,6 @@ $level-resize-transition-time: 0.5s
left: -3px left: -3px
bottom: 0 bottom: 0
#hud-top-gradient
top: -32px
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8*$GI) 100%)
left: 0
right: 0
bottom: 0
height: 3px
#canvas-left-gradient #canvas-left-gradient
left: 0px left: 0px
width: 5px width: 5px

View file

@ -9,7 +9,7 @@
background: transparent url(/images/level/goals_background.png) background: transparent url(/images/level/goals_background.png)
background-size: 100% 100% background-size: 100% 100%
padding: 19px 17px 6px 25px padding: 19px 17px 2px 25px
z-index: 3 z-index: 3
font-size: 14px font-size: 14px

View file

@ -4,6 +4,8 @@
// TODO: Replace this devart with nice shinies // TODO: Replace this devart with nice shinies
#multiplayer-status-view #multiplayer-status-view
position: absolute
.player-count .player-count
color: white color: white
.players-available .players-available

View file

@ -2,50 +2,52 @@
@import "app/styles/bootstrap/variables" @import "app/styles/bootstrap/variables"
#playback-view #playback-view
$playback-button-color: rgb(248, 197, 146)
// When 75% alpha, it will look like the rgb(194, 154, 114) from Heald's design
width: 55% width: 55%
height: 30px height: 60px
padding-top: 17px
position: relative position: relative
background: #383434 background: transparent url(/images/level/scrubber_background.png)
// Counteract 50px height of absolutely positioned control bar. background-size: 100% 100%
margin-top: 50px // Counteract 50px height of absolutely positioned control bar, but overlap by 10px of jagged transparent top.
margin-top: 50px - 10px
z-index: 2
button button
height: 26px font-size: 26px
margin-left: 10px
background: transparent background: transparent
@include opacity(0.50) @include opacity(0.75)
i color: $playback-button-color
text-shadow: 1px 1px 0px black
.glyphicon
position: relative position: relative
button:hover button:hover
@include opacity(0.75) @include opacity(1)
#play-button, #volume-button, #music-button #play-button, #volume-button, #music-button
float: left float: left
margin-left: 2px
margin-top: 2px
width: 25px
position: relative position: relative
#music-button #music-button
@include opacity(0.25) @include opacity(0.5)
font-size: 20px
span span
position: relative position: relative
left: -3px left: -3px
top: -2px top: -2px
&:hover &:hover
@include opacity(0.50) @include opacity(0.75)
&.music-on &.music-on
@include opacity(0.50) @include opacity(0.75)
&:hover &:hover
@include opacity(0.75) @include opacity(1)
#play-button, #volume-button #play-button, #volume-button
i .glyphicon
display: none display: none
position: absolute
left: 2px
top: 2px
#settings-button #settings-button
padding-left: 4px padding-left: 4px
@ -54,51 +56,58 @@
#playback-settings #playback-settings
float: right float: right
position: relative position: relative
top: 2px margin-right: 10px
margin-right: 2px ul button
ul i
margin: 0 10px margin: 0 10px
li:hover li:hover
background: #add8e6 background: #add8e6
#play-button.disabled i #play-button.disabled .glyphicon
@include opacity(0.5) @include opacity(0.75)
#play-button.playing i.icon-pause #play-button.playing .glyphicon-pause
display: inline-block display: inline-block
#play-button.paused i.icon-play #play-button.paused .glyphicon-play
display: inline-block display: inline-block
#play-button.ended i.icon-repeat #play-button.ended .glyphicon-repeat
display: inline-block display: inline-block
#volume-button.vol-up i.icon-volume-up #volume-button.vol-up .glyphicon.glyphicon-volume-up
display: inline-block display: inline-block
#volume-button.vol-off i.icon-volume-off #volume-button.vol-off .glyphicon.glyphicon-volume-off
display: inline-block display: inline-block
@include opacity(0.50) @include opacity(0.75)
&:hover &:hover
@include opacity(0.75) @include opacity(1)
#volume-button.vol-down i.icon-volume-down #volume-button.vol-down .glyphicon.glyphicon-volume-down
display: inline-block display: inline-block
.scrubber .scrubber
position: absolute position: absolute
left: 100px left: 170px
top: 0px top: 21px
bottom: 0px bottom: 0px
right: 125px right: 175px
background: rgb(3, 3, 3)
height: 28px
border: 1px solid rgb(67, 67, 44)
border-radius: 14px
.scrubber-inner
border: 1px solid rgb(44, 38, 29)
width: 100%
height: 100%
border-radius: 14px
padding: 6px 8px
.progress .progress
float: left float: left
width: 100% width: 100%
height: 14px height: 12px
margin-top: 8px
cursor: pointer cursor: pointer
overflow: visible overflow: visible
border: 1px solid #444 border: 1px solid #444
// Remove gradient background in favor of solid fill background: rgb(80, 67, 53)
background-color: #888 border-radius: 6px
background-image: none
border-radius: 0
border: 0 border: 0
// Can't do this transition because handle then jitters, but would be good for streaming. // Can't do this transition because handle then jitters, but would be good for streaming.
//@include transition(width .2s linear) //@include transition(width .2s linear)
@ -113,19 +122,19 @@
@include transition(width .0s linear) @include transition(width .0s linear)
position: relative position: relative
// Remove gradient background in favor of solid fill // Remove gradient background in favor of solid fill
background-color: #67A4C8 background: rgb(245, 170, 49)
//background-image: none // gradient looks kind of cool though; keep it in border: 1px solid rgb(62, 45, 16)
border-radius: 6px
.scrubber-handle .scrubber-handle
cursor: pointer cursor: pointer
position: absolute position: absolute
right: -16px right: -18px
top: -9px top: -11px
background: transparent url(/images/level/playback_thumb.png) background: transparent url(/images/level/scrubber_knob.png)
width: 32px background-size: contain
height: 32px width: 36px
// z: above the gradient line bordering the playback bar height: 36px
z-index: 6
.ui-slider-handle .ui-slider-handle
height: 100% height: 100%
@ -140,3 +149,5 @@
body.ipad #playback-view body.ipad #playback-view
#playback-settings #playback-settings
display: none display: none
.scrubber
right: 25px

View file

@ -124,14 +124,6 @@
left: -3px left: -3px
bottom: 0 bottom: 0
#hud-top-gradient
top: -32px
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8*$GI) 100%)
left: 0
right: 0
bottom: 0
height: 3px
#canvas-left-gradient #canvas-left-gradient
left: 0px left: 0px
width: 5px width: 5px

View file

@ -1,6 +1,6 @@
ul#primary-goals-list ul#primary-goals-list
div.goals-status div.goals-status
strong(data-i18n="play_level.goals") Goals span(data-i18n="play_level.goals") Goals
span.spr : span.spr :
span(data-i18n="play_level.success").secret.goal-status.success Success! span(data-i18n="play_level.success").secret.goal-status.success Success!
span(data-i18n="play_level.incomplete").secret.goal-status.incomplete Incomplete span(data-i18n="play_level.incomplete").secret.goal-status.incomplete Incomplete

View file

@ -1,5 +1,3 @@
#hud-top-gradient.gradient
.center .center
.thang-canvas-wrapper.thang-elem .thang-canvas-wrapper.thang-elem

View file

@ -1,45 +1,29 @@
button.btn.btn-xs.btn-inverse#play-button.paused(title="Ctrl/Cmd + P: Toggle level play/pause") button.btn.btn-xs.btn-inverse#play-button.paused(title="Ctrl/Cmd + P: Toggle level play/pause")
i.icon-play.icon-white.big .glyphicon.glyphicon-play
i.icon-pause.icon-white.big .glyphicon.glyphicon-pause
i.icon-repeat.icon-white.big .glyphicon.glyphicon-repeat
button.btn.btn-xs.btn-inverse#volume-button(title="Adjust volume") button.btn.btn-xs.btn-inverse#volume-button(title="Adjust volume")
i.icon-volume-off.icon-white.big .glyphicon.glyphicon-volume-off
i.icon-volume-down.icon-white.big .glyphicon.glyphicon-volume-down
i.icon-volume-up.icon-white.big .glyphicon.glyphicon-volume-up
button.btn.btn-xs.btn-inverse#music-button(title="Toggle Music") button.btn.btn-xs.btn-inverse#music-button(title="Toggle Music")
span ♫ span ♫
.scrubber .scrubber
.progress.secret#timeProgress .scrubber-inner
.progress-bar .progress.secret#timeProgress
.scrubber-handle .progress-bar
.popover.fade.top.in#timePopover .scrubber-handle
.arrow .popover.fade.top.in#timePopover
h3.popover-title .arrow
.popover-content h3.popover-title
.popover-content
.btn-group.dropup#playback-settings .btn-group.dropup#playback-settings
button.btn.btn-xs.btn-inverse.toggle-fullscreen(title="Toggle fullscreen") button.btn.btn-xs.btn-inverse.toggle-fullscreen(title="Toggle fullscreen")
i.icon-fullscreen.icon-white .glyphicon.glyphicon-fullscreen
button.btn.btn-xs.btn-inverse#zoom-in-button(title="Zoom In (or scroll down)") button.btn.btn-xs.btn-inverse#zoom-in-button(title="Zoom In (or scroll down)")
i.icon-zoom-in.icon-white .glyphicon.glyphicon-zoom-in
button.btn.btn-xs.btn-inverse#zoom-out-button(title="Zoom Out (or scroll up)") button.btn.btn-xs.btn-inverse#zoom-out-button(title="Zoom Out (or scroll up)")
i.icon-zoom-out.icon-white .glyphicon.glyphicon-zoom-out
button.btn.btn-xs.btn-inverse.dropdown-toggle(data-toggle="dropdown")#settings-button
i.icon-cog.icon-white.big
ul.dropdown-menu
if me.get('name') == "Nick"
li(title="Ctrl/Cmd + \\: Toggle debug display").selectable#debug-toggle
i.icon-globe
| Debug Mode
i.icon-ok.secret
li.selectable#view-keyboard-shortcuts
i.icon-info-sign
span(data-i18n="play_level.keyboard_shortcuts") Key Shortcuts
li.selectable#edit-wizard-settings
i.icon-user
span(data-i18n="play_level.customize_wizard") Customize Wizard
li.selectable#edit-editor-config
i.icon-edit
span(data-i18n="play_level.editor_config") Editor Config

View file

@ -17,7 +17,6 @@ module.exports = class LevelPlaybackView extends CocoView
'level:scrub-forward': 'onScrubForward' 'level:scrub-forward': 'onScrubForward'
'level:scrub-back': 'onScrubBack' 'level:scrub-back': 'onScrubBack'
'level:set-volume': 'onSetVolume' 'level:set-volume': 'onSetVolume'
'level:set-debug': 'onSetDebug'
'surface:frame-changed': 'onFrameChanged' 'surface:frame-changed': 'onFrameChanged'
'god:new-world-created': 'onNewWorld' 'god:new-world-created': 'onNewWorld'
'god:streaming-world-updated': 'onNewWorld' 'god:streaming-world-updated': 'onNewWorld'
@ -28,10 +27,6 @@ module.exports = class LevelPlaybackView extends CocoView
'real-time-multiplayer:manual-cast': 'onRealTimeMultiplayerCast' 'real-time-multiplayer:manual-cast': 'onRealTimeMultiplayerCast'
events: events:
'click #debug-toggle': 'onToggleDebug'
'click #edit-wizard-settings': 'onEditWizardSettings'
'click #edit-editor-config': 'onEditEditorConfig'
'click #view-keyboard-shortcuts': 'onViewKeyboardShortcuts'
'click #music-button': 'onToggleMusic' 'click #music-button': 'onToggleMusic'
'click #zoom-in-button': -> Backbone.Mediator.publish 'camera:zoom-in', {} unless @shouldIgnore() 'click #zoom-in-button': -> Backbone.Mediator.publish 'camera:zoom-in', {} unless @shouldIgnore()
'click #zoom-out-button': -> Backbone.Mediator.publish 'camera:zoom-out', {} unless @shouldIgnore() 'click #zoom-out-button': -> Backbone.Mediator.publish 'camera:zoom-out', {} unless @shouldIgnore()
@ -52,59 +47,6 @@ module.exports = class LevelPlaybackView extends CocoView
'⌘+], ctrl+]': 'onScrubForward' '⌘+], ctrl+]': 'onScrubForward'
'⌘+⇧+], ctrl+⇧+]': 'onSingleScrubForward' '⌘+⇧+], ctrl+⇧+]': 'onSingleScrubForward'
# popover that shows at the current mouse position on the progressbar, using the bootstrap popover.
# Could make this into a jQuery plugins itself theoretically.
class HoverPopup extends $.fn.popover.Constructor
constructor: () ->
@enabled = true
@shown = false
@type = 'HoverPopup'
@options =
placement: 'top'
container: 'body'
animation: true
html: true
delay:
show: 400
@$element = $('#timeProgress')
@$tip = $('#timePopover')
@content = ''
getContent: -> @content
show: ->
unless @shown
super()
@shown = true
updateContent: (@content) ->
@setContent()
@$tip.addClass('fade top in')
onHover: (@e) ->
pos = @getPosition()
actualWidth = @$tip[0].offsetWidth
actualHeight = @$tip[0].offsetHeight
calculatedOffset =
top: pos.top - actualHeight
left: pos.left + pos.width / 2 - actualWidth / 2
this.applyPlacement(calculatedOffset, 'top')
getPosition: ->
top: @$element.offset().top
left: if @e? then @e.pageX else @$element.offset().left
height: 0
width: 0
hide: ->
super()
@shown = false
disable: ->
super()
@hide()
constructor: -> constructor: ->
super(arguments...) super(arguments...)
me.on('change:music', @updateMusicButton, @) me.on('change:music', @updateMusicButton, @)
@ -192,20 +134,6 @@ module.exports = class LevelPlaybackView extends CocoView
@currentTime = 0 @currentTime = 0
@lastLoadedFrameCount = loadedFrameCount @lastLoadedFrameCount = loadedFrameCount
onToggleDebug: ->
return if @shouldIgnore()
flag = $('#debug-toggle i.icon-ok')
Backbone.Mediator.publish('level:set-debug', {debug: flag.hasClass('invisible')})
onEditWizardSettings: ->
Backbone.Mediator.publish 'level:edit-wizard-settings', {}
onEditEditorConfig: ->
@openModalView new EditorConfigModal session: @options.session
onViewKeyboardShortcuts: ->
@openModalView new KeyboardShortcutsModal()
onDisableControls: (e) -> onDisableControls: (e) ->
if not e.controls or 'playback' in e.controls if not e.controls or 'playback' in e.controls
@disabled = true @disabled = true
@ -340,10 +268,6 @@ module.exports = class LevelPlaybackView extends CocoView
Backbone.Mediator.publish 'level:set-letterbox', on: false Backbone.Mediator.publish 'level:set-letterbox', on: false
Backbone.Mediator.publish 'playback:real-time-playback-ended', {} Backbone.Mediator.publish 'playback:real-time-playback-ended', {}
onSetDebug: (e) ->
flag = $('#debug-toggle i.icon-ok')
flag.toggleClass 'invisible', not e.debug
# to refactor # to refactor
hookUpScrubber: -> hookUpScrubber: ->
@ -423,3 +347,56 @@ module.exports = class LevelPlaybackView extends CocoView
$(window).off('resize', @onWindowResize) $(window).off('resize', @onWindowResize)
@onWindowResize = null @onWindowResize = null
super() super()
# popover that shows at the current mouse position on the progressbar, using the bootstrap popover.
# Could make this into a jQuery plugins itself theoretically.
class HoverPopup extends $.fn.popover.Constructor
constructor: () ->
@enabled = true
@shown = false
@type = 'HoverPopup'
@options =
placement: 'top'
container: 'body'
animation: true
html: true
delay:
show: 400
@$element = $('#timeProgress')
@$tip = $('#timePopover')
@content = ''
getContent: -> @content
show: ->
unless @shown
super()
@shown = true
updateContent: (@content) ->
@setContent()
@$tip.addClass('fade top in')
onHover: (@e) ->
pos = @getPosition()
actualWidth = @$tip[0].offsetWidth
actualHeight = @$tip[0].offsetHeight
calculatedOffset =
top: pos.top - actualHeight
left: pos.left + pos.width / 2 - actualWidth / 2
this.applyPlacement(calculatedOffset, 'top')
getPosition: ->
top: @$element.offset().top
left: if @e? then @e.pageX else @$element.offset().left
height: 0
width: 0
hide: ->
super()
@shown = false
disable: ->
super()
@hide()