From 025d78ee9c568bdd86909e39952135799e9053c8 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Mon, 9 Feb 2015 21:13:40 -0800 Subject: [PATCH] Fine tune animation timings --- .../crafting_grid_controller.coffee | 2 +- .../crafting_table_controller.coffee | 4 ++-- .../controllers/feedback_controller.coffee | 4 ++-- .../controllers/full_recipe_controller.coffee | 2 +- .../controllers/inventory_controller.coffee | 4 ++-- .../inventory_table_controller.coffee | 4 ++-- .../controllers/item_group_controller.coffee | 11 +++++----- .../controllers/item_page_controller.coffee | 20 +++++++++---------- .../minimal_recipe_controller.coffee | 2 +- .../controllers/mod_page_controller.coffee | 6 +++--- 10 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/scripts/controllers/crafting_grid_controller.coffee b/src/scripts/controllers/crafting_grid_controller.coffee index 16abb286d..a4f535da4 100644 --- a/src/scripts/controllers/crafting_grid_controller.coffee +++ b/src/scripts/controllers/crafting_grid_controller.coffee @@ -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 ###################################################################### diff --git a/src/scripts/controllers/crafting_table_controller.coffee b/src/scripts/controllers/crafting_table_controller.coffee index 91845a908..844193ca0 100644 --- a/src/scripts/controllers/crafting_table_controller.coffee +++ b/src/scripts/controllers/crafting_table_controller.coffee @@ -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 diff --git a/src/scripts/controllers/feedback_controller.coffee b/src/scripts/controllers/feedback_controller.coffee index 8eacf5821..2f1a15139 100644 --- a/src/scripts/controllers/feedback_controller.coffee +++ b/src/scripts/controllers/feedback_controller.coffee @@ -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 diff --git a/src/scripts/controllers/full_recipe_controller.coffee b/src/scripts/controllers/full_recipe_controller.coffee index ed6b0b38e..ea2f355d0 100644 --- a/src/scripts/controllers/full_recipe_controller.coffee +++ b/src/scripts/controllers/full_recipe_controller.coffee @@ -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() diff --git a/src/scripts/controllers/inventory_controller.coffee b/src/scripts/controllers/inventory_controller.coffee index aa48a8bec..45fe19e4e 100644 --- a/src/scripts/controllers/inventory_controller.coffee +++ b/src/scripts/controllers/inventory_controller.coffee @@ -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: -> diff --git a/src/scripts/controllers/inventory_table_controller.coffee b/src/scripts/controllers/inventory_table_controller.coffee index 6abddb72e..4e1d7de00 100644 --- a/src/scripts/controllers/inventory_table_controller.coffee +++ b/src/scripts/controllers/inventory_table_controller.coffee @@ -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: -> diff --git a/src/scripts/controllers/item_group_controller.coffee b/src/scripts/controllers/item_group_controller.coffee index 9e25a1d5d..644a9a14e 100644 --- a/src/scripts/controllers/item_group_controller.coffee +++ b/src/scripts/controllers/item_group_controller.coffee @@ -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() diff --git a/src/scripts/controllers/item_page_controller.coffee b/src/scripts/controllers/item_page_controller.coffee index 00bfbabe8..b672376e4 100644 --- a/src/scripts/controllers/item_page_controller.coffee +++ b/src/scripts/controllers/item_page_controller.coffee @@ -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 diff --git a/src/scripts/controllers/minimal_recipe_controller.coffee b/src/scripts/controllers/minimal_recipe_controller.coffee index 498aefe52..75d554f1c 100644 --- a/src/scripts/controllers/minimal_recipe_controller.coffee +++ b/src/scripts/controllers/minimal_recipe_controller.coffee @@ -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 diff --git a/src/scripts/controllers/mod_page_controller.coffee b/src/scripts/controllers/mod_page_controller.coffee index bafcc5f52..9c6e730fa 100644 --- a/src/scripts/controllers/mod_page_controller.coffee +++ b/src/scripts/controllers/mod_page_controller.coffee @@ -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()