diff --git a/rpg-docs/Model/Character/Characters.js b/rpg-docs/Model/Character/Characters.js index 740d7cea..50b7156b 100644 --- a/rpg-docs/Model/Character/Characters.js +++ b/rpg-docs/Model/Character/Characters.js @@ -191,6 +191,7 @@ Schemas.Character = new SimpleSchema({ "settings.exportFeatures": {type: Boolean, defaultValue: true}, "settings.exportAttacks": {type: Boolean, defaultValue: true}, "settings.exportDescription": {type: Boolean, defaultValue: true}, + "settings.newUserExperience": {type: Boolean, optional: true}, }); Characters.attachSchema(Schemas.Character); @@ -554,6 +555,10 @@ if (Meteor.isServer){ }); Characters.before.insert(function(userId, doc) { doc.urlName = getSlug(doc.name, {maintainCase: true}) || "-"; + // The first character a user creates should have the new user experience + if (!Characters.find({owner: userId}).count()){ + doc.settings.newUserExperience = true; + } }); } diff --git a/rpg-docs/client/style/bounce.css b/rpg-docs/client/style/bounce.css new file mode 100644 index 00000000..481754d5 --- /dev/null +++ b/rpg-docs/client/style/bounce.css @@ -0,0 +1,17 @@ +@keyframes bounce { + from { + transform: translate(0px,0px); + } + to { + transform: translate(0px,-16px); + } +} + +.bounce{ + animation-name: bounce; + animation-duration: 0.3s; + animation-direction: alternate; + animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); + animation-delay: 0s; + animation-iteration-count: infinite; +} diff --git a/rpg-docs/client/views/character/characterSheet.html b/rpg-docs/client/views/character/characterSheet.html index 9fd7a65f..ca18dbfd 100644 --- a/rpg-docs/client/views/character/characterSheet.html +++ b/rpg-docs/client/views/character/characterSheet.html @@ -44,17 +44,18 @@
- Stats - Features + Stats + Features Inventory {{#unless hideSpellcasting}} Spells {{/unless}} Persona - Journal + Journal
+ {{#if session "showNewUserExperience"}}{{> newUserStepper}}{{/if}}
diff --git a/rpg-docs/client/views/character/characterSheet.js b/rpg-docs/client/views/character/characterSheet.js index 528cf42d..bd14795a 100644 --- a/rpg-docs/client/views/character/characterSheet.js +++ b/rpg-docs/client/views/character/characterSheet.js @@ -29,7 +29,17 @@ Template.characterSheet.onRendered(function() { tabFabMenus = _.times(6, (n) => tabPages[n].find(".mini-holder") ); - }) + }); + + // New user experience starts on the features tab + var settings = Characters.findOne(this.data._id, { + fields: {settings: 1} + }).settings; + if (settings && settings.newUserExperience){ + Session.set(this.data._id + ".selectedTab", "1"); + Session.set("showNewUserExperience", true); + Session.set("newUserExperienceStep", 0); + } //watch this character and make sure their encumbrance is updated //trackEncumbranceConditions(this.data._id, this); @@ -172,6 +182,20 @@ Template.characterSheet.helpers({ var char = Characters.findOne(this._id); return char && char.settings.hideSpellcasting; }, + newUserExperience: function(){ + var char = Characters.findOne(this._id); + return char && char.settings.newUserExperience; + }, + shouldBounce: function(tab){ + console.log(this._id); + const selected = Session.get(this._id + ".selectedTab") + const step = Session.get("newUserExperienceStep"); + console.log({selected, step, tab}); + if (selected == tab) return false; + return (tab === 1 && step === 0) || + (tab === 5 && step === 1) || + (tab === 0 && step === 2); + }, }); Template.characterSheet.events({ diff --git a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html index c73a988c..187e2216 100644 --- a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html +++ b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html @@ -42,9 +42,20 @@