From 2e539debbb2622f13edd607d97d819afc94f6604 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 17 Oct 2014 20:47:32 -0700 Subject: [PATCH] Added signup poke to HeroVictoryModal. --- app/styles/mixins.sass | 6 ++++ .../play/level/modal/hero-victory-modal.sass | 32 +++++++++++++++---- .../play/level/modal/hero-victory-modal.jade | 9 ++++-- .../play/level/modal/HeroVictoryModal.coffee | 2 ++ 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/app/styles/mixins.sass b/app/styles/mixins.sass index 18f695aac..c3ca386c1 100644 --- a/app/styles/mixins.sass +++ b/app/styles/mixins.sass @@ -86,6 +86,12 @@ -ms-flex-pack: justify justify-content: space-between +@mixin flex-justify-center() + -webkit-box-pack: center + -webkit-justify-content: center + -ms-flex-pack: center + justify-content: center + @mixin flex-align-content-start() -webkit-align-content: flex-start -ms-flex-align-content: flex-start diff --git a/app/styles/play/level/modal/hero-victory-modal.sass b/app/styles/play/level/modal/hero-victory-modal.sass index f3cc7f6a9..f044a91a3 100644 --- a/app/styles/play/level/modal/hero-victory-modal.sass +++ b/app/styles/play/level/modal/hero-victory-modal.sass @@ -43,10 +43,10 @@ @include transition-duration(1s) - -webkit-filter: grayscale(100%) - -moz-filter: grayscale(100%) - -o-filter: grayscale(100%) - filter: grayscale(100%) + -webkit-filter: grayscale(100%) brightness(75%) + -moz-filter: grayscale(100%) brightness(75%) + -o-filter: grayscale(100%) brightness(75%) + filter: grayscale(100%) brightness(75%) &.earned -webkit-filter: none @@ -54,7 +54,11 @@ -o-filter: none filter: none + .achievement-description + @include opacity(1) + .achievement-description + @include opacity(0.75) position: absolute text-align: center left: 95px @@ -64,14 +68,15 @@ white-space: nowrap overflow: hidden text-overflow: ellipsis - + .achievement-rewards position: absolute left: 25px right: 23px top: 41px bottom: 18px - + @include flexbox() + @include flex-justify-center() //- Reward panels @@ -156,7 +161,10 @@ .modal-content padding-bottom: 50px // so the footer appears at the bottom - + + &.with-sign-up .modal-content + padding-bottom: 100px // need more space for signup poke + .modal-footer position: absolute bottom: -20px @@ -166,6 +174,16 @@ #totals color: white + p.sign-up-poke + position: absolute + bottom: 60px + right: 20px + color: white + + .sign-up-button + float: right + margin-left: 10px + html.no-borderimage #hero-victory-modal .background-wrapper diff --git a/app/templates/play/level/modal/hero-victory-modal.jade b/app/templates/play/level/modal/hero-victory-modal.jade index ffb2c3c21..32d4f2fbb 100644 --- a/app/templates/play/level/modal/hero-victory-modal.jade +++ b/app/templates/play/level/modal/hero-victory-modal.jade @@ -17,13 +17,13 @@ block modal-body-content .reward-panel.numerical.xp(data-number=worth, data-number-unit='xp') .reward-image-container(class=animate?'':'show') img(src="/images/pages/play/level/modal/reward_icon_xp.png") - .reward-text= animate ? 'x0' : '+'+worth + .reward-text= animate ? '+0' : '+'+worth if rewards.gems .reward-panel.numerical.gems(data-number=rewards.gems, data-number-unit='gem') .reward-image-container(class=animate?'':'show') img(src="/images/pages/play/level/modal/reward_icon_gems.png") - .reward-text= animate ? 'x0' : '+'+rewards.gems + .reward-text= animate ? '+0' : '+'+rewards.gems if rewards.heroes for hero in rewards.heroes @@ -52,3 +52,8 @@ block modal-footer-content button.btn.btn-warning.hide#saving-progress-label(disabled, data-i18n="play_level.victory_saving_progress") Saving Progress a.btn.btn-success.world-map-button.hide#continue-button(href="/play-hero", data-dismiss="modal", data-i18n="play_level.victory_play_continue") Continue + + if me.get('anonymous') + p.sign-up-poke + button.btn.btn-success.sign-up-button.btn-large(data-toggle="coco-modal", data-target="modal/SignupModal", data-i18n="play_level.victory_sign_up") Sign Up to Save Progress + span(data-i18n="play_level.victory_sign_up_poke") Want to save your code? Create a free account! diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index 427ae7fcc..b21805334 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -87,11 +87,13 @@ module.exports = class HeroVictoryModal extends ModalView # rewards.gems *= (index + 1) c.thangTypes = @thangTypes + c.me = me return c afterRender: -> super() return unless @supermodel.finished() + @$el.addClass 'with-sign-up' if me.get('anonymous') @updateSavingProgressStatus() @$el.find('#victory-header').delay(250).queue(-> $(@).removeClass('out').dequeue()) complete = _.once(_.bind(@beginAnimateNumbers, @))