Fine tune animation timings
This commit is contained in:
@@ -49,7 +49,7 @@ module.exports = class CraftingGridController extends BaseController
|
||||
@_imageLoader.load display.iconUrl, slot.img
|
||||
slot.img.attr 'alt', display.itemName
|
||||
|
||||
@$el.tooltip show:{delay:Duration.slow, duration:Duration.fast}
|
||||
@$el.tooltip show:{delay:Duration.snap, duration:Duration.fast}
|
||||
super
|
||||
|
||||
# Backbone.View Overrides ######################################################################
|
||||
|
||||
@@ -78,9 +78,9 @@ module.exports = class CraftingTableController extends BaseController
|
||||
@$multiplier.html ''
|
||||
|
||||
if not (@model.hasSteps and global.feedbackController?)
|
||||
@$problemControl.hide duration:Duration.fast
|
||||
@$problemControl.hide duration:Duration.snap
|
||||
else
|
||||
@$problemControl.show duration:Duration.normal
|
||||
@$problemControl.show duration:Duration.snap
|
||||
|
||||
super
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = class FeedbackController extends BaseController
|
||||
@model.send(message)
|
||||
.then =>
|
||||
@onToggle()
|
||||
@$error.slideUp duration:Duration.fast
|
||||
@$error.slideUp duration:Duration.normal
|
||||
.catch (error)=>
|
||||
@$error.slideDown duration:Duration.normal
|
||||
.finally =>
|
||||
@@ -97,7 +97,7 @@ module.exports = class FeedbackController extends BaseController
|
||||
@$sendButton = @$('button[name="send"]')
|
||||
|
||||
windowHeight = window.innerHeight
|
||||
@$el.delay(Duration.slow).animate {left:-@$el.outerWidth()}, Duration.slow
|
||||
@$el.delay(Duration.slow).animate {left:-@$el.outerWidth()}, Duration.normal
|
||||
@onTextChanged()
|
||||
|
||||
super
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = class FullRecipeController extends BaseController
|
||||
@gridController.model = @model
|
||||
@$tool.html @_findToolNames().join ', '
|
||||
|
||||
@$el.tooltip show:{delay:Duration.fast, duration:Duration.fast}
|
||||
@$el.tooltip show:{delay:Duration.normal, duration:Duration.normal}
|
||||
|
||||
@_refreshInputs()
|
||||
@_refreshOutputs()
|
||||
|
||||
@@ -97,8 +97,8 @@ module.exports = class InventoryController extends BaseController
|
||||
@$quantityField.focus()
|
||||
return
|
||||
|
||||
@$quantityField.removeClass 'error', Duration.fast
|
||||
@$quantityField.removeClass 'error-new', Duration.fast
|
||||
@$quantityField.removeClass 'error', Duration.normal
|
||||
@$quantityField.removeClass 'error-new', Duration.normal
|
||||
@_updateButtonState()
|
||||
|
||||
onQuantityFieldFocused: ->
|
||||
|
||||
@@ -95,8 +95,8 @@ module.exports = class InventoryTableController extends BaseController
|
||||
@$quantityField.focus()
|
||||
return
|
||||
|
||||
@$quantityField.removeClass 'error', Duration.fast
|
||||
@$quantityField.removeClass 'error-new', Duration.fast
|
||||
@$quantityField.removeClass 'error', Duration.normal
|
||||
@$quantityField.removeClass 'error-new', Duration.normal
|
||||
@_updateButtonState()
|
||||
|
||||
onQuantityFieldFocused: ->
|
||||
|
||||
@@ -21,6 +21,7 @@ module.exports = class ItemGroupController extends BaseController
|
||||
options.templateName = 'item_group'
|
||||
super options
|
||||
|
||||
@_delayStep = 20
|
||||
@_itemControllers = []
|
||||
@_modPack = options.modPack
|
||||
@_title = options.title
|
||||
@@ -53,12 +54,12 @@ module.exports = class ItemGroupController extends BaseController
|
||||
|
||||
_createItemController: (item)->
|
||||
controller = new ItemController model:item, modPack:@_modPack
|
||||
controller.$el.hide()
|
||||
controller.render()
|
||||
|
||||
@_itemControllers.push controller
|
||||
|
||||
controller.render()
|
||||
controller.$el.hide()
|
||||
@$items.append controller.$el
|
||||
controller.$el.slideDown duration:Duration.fast
|
||||
controller.$el.fadeIn duration:Duration.fast
|
||||
|
||||
_refreshItems: ->
|
||||
controllerIndex = 0
|
||||
@@ -77,4 +78,4 @@ module.exports = class ItemGroupController extends BaseController
|
||||
|
||||
while @_itemControllers.length > controllerIndex
|
||||
controller = @_itemControllers.pop()
|
||||
controller.$el.slideUp duration:Duration.fast, complete:-> @remove()
|
||||
controller.$el.fadeOut duration:Duration.normal, complete:-> @remove()
|
||||
|
||||
@@ -60,11 +60,11 @@ module.exports = class ItemPageController extends BaseController
|
||||
display = @_modPack.findItemDisplay @model.item?.slug
|
||||
if display?
|
||||
@$craftingPlanLink.attr href:display.craftingUrl
|
||||
@$craftingPlanLink.fadeIn duration:Duration.fast
|
||||
@$craftingPlanLink.fadeIn duration:Duration.normal
|
||||
@_imageLoader.load display.iconUrl, @$titleImage
|
||||
@$name.html display.itemName
|
||||
else
|
||||
@$craftingPlanLink.fadeOut duration:Duration.fast
|
||||
@$craftingPlanLink.fadeOut duration:Duration.normal
|
||||
@$titleImage.removeAttr 'src'
|
||||
@$name.html ''
|
||||
|
||||
@@ -89,18 +89,18 @@ module.exports = class ItemPageController extends BaseController
|
||||
if mod?.name?.length > 0
|
||||
@$bylineLink.attr 'href', Url.mod modSlug:mod.slug
|
||||
@$bylineLink.html mod.name
|
||||
@$byline.fadeIn duration:Duration.fast
|
||||
@$byline.fadeIn duration:Duration.normal
|
||||
else
|
||||
@$byline.fadeOut duration:Duration.fast
|
||||
@$byline.fadeOut duration:Duration.normal
|
||||
|
||||
_refreshUsedToMake: ->
|
||||
@_usedToMakeController.title = 'Used to Make'
|
||||
|
||||
@_usedToMakeController.model = @model.findComponentInItems()
|
||||
if @_usedToMakeController.model?
|
||||
@$usedToMakeContainer.fadeIn duration:Duration.fast
|
||||
@$usedToMakeContainer.fadeIn duration:Duration.normal
|
||||
else
|
||||
@$usedToMakeContainer.fadeOut duration:Duration.fast
|
||||
@$usedToMakeContainer.fadeOut duration:Duration.normal
|
||||
|
||||
_refreshRecipes: ->
|
||||
@_recipeControllers ?= []
|
||||
@@ -123,11 +123,11 @@ module.exports = class ItemPageController extends BaseController
|
||||
controller.model = recipe
|
||||
index++
|
||||
else
|
||||
@$recipesSection.fadeOut duration:Duration.fast
|
||||
@$recipesSection.fadeOut duration:Duration.normal
|
||||
|
||||
while @_recipeControllers.length > index
|
||||
controller = @_recipeControllers.pop()
|
||||
controller.fadeOut duration:Duration.fast, complete:-> controller.$el.remove()
|
||||
controller.fadeOut duration:Duration.normal, complete:-> controller.$el.remove()
|
||||
|
||||
_refreshSimilarItems: ->
|
||||
group = @model.item?.group
|
||||
@@ -138,9 +138,9 @@ module.exports = class ItemPageController extends BaseController
|
||||
@_similarItemsController.model = null
|
||||
|
||||
if @_similarItemsController.model?
|
||||
@$similarContainer.fadeIn duration:Duration.fast
|
||||
@$similarContainer.fadeIn duration:Duration.normal
|
||||
else
|
||||
@$similarContainer.fadeOut duration:Duration.fast
|
||||
@$similarContainer.fadeOut duration:Duration.normal
|
||||
|
||||
_resolveItemSlug: ->
|
||||
oldItem = @model.item
|
||||
|
||||
@@ -56,7 +56,7 @@ module.exports = class MinimalRecipeController extends BaseController
|
||||
|
||||
@_imageLoader.load display.iconUrl, @$outputImg
|
||||
|
||||
@$el.tooltip show:{delay:Duration.fast, duration:Duration.fast}
|
||||
@$el.tooltip show:{delay:Duration.snap, duration:Duration.fast}
|
||||
|
||||
super
|
||||
|
||||
|
||||
@@ -110,14 +110,14 @@ module.exports = class ModPageController extends BaseController
|
||||
|
||||
while @_groupControllers.length > groupIndex + 1
|
||||
controller = @_groupControllers.pop()
|
||||
controller.$el.slideUp duration:Duration.fast, -> @remove()
|
||||
controller.$el.slideUp duration:Duration.normal, -> @remove()
|
||||
|
||||
_refreshLink: ($link, url)->
|
||||
if url?
|
||||
$link.fadeIn duration:Duration.fast
|
||||
$link.fadeIn duration:Duration.normal
|
||||
$link.attr 'href', url
|
||||
else
|
||||
$link.fadeOut duration:Duration.fast
|
||||
$link.fadeOut duration:Duration.normal
|
||||
|
||||
_refreshVersions: ->
|
||||
@$versionSelector.empty()
|
||||
|
||||
Reference in New Issue
Block a user