Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified images/tour/f1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/tour/f2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/tour/f3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/tour/f4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/tour/f5.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/home/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var _ = require('lodash');
var View = require('ampersand-view');
var format = require('util').format;
var SidebarView = require('../sidebar');
Expand Down Expand Up @@ -50,8 +51,9 @@ var HomeView = View.extend({
},
render: function() {
this.renderWithTemplate(this);
if (app.isFeatureEnabled('First Run Tour')) {
if (_.isUndefined(localStorage.tourHasRun)) {
this.renderSubview(new TourView(), this.queryByHook('tour-container'));
localStorage.tourHasRun = 'true';
}
},
onInstanceFetched: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/refine-view/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
}
.sampling-message {
font-size: 12px;
font-size: 13px;
font-weight: 200;
padding: 5px 25px;
border-bottom: 2px solid @gray7
Expand Down
1 change: 0 additions & 1 deletion src/sidebar/index.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
div
.sidebar.panel
div.compass-logo
div(data-hook='instance-properties-subview')
div(data-hook='collection-filter-subview')
div(data-hook='collection-list-subview')
58 changes: 31 additions & 27 deletions src/tour/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
var $ = require('jquery');
var View = require('ampersand-view');

var TourView = View.extend({
props: {
tourCount: {
type: 'number',
default: 0
},
tourImages: {
type: 'array',
default: function() {
return ['f1.gif', 'f2.gif', 'f3.gif', 'f4.gif', 'f5.gif'];
}
},
tourImagesFolder: {
type: 'string',
default: './images/tour/'
isAnimating: { type: 'boolean', default: true },
tourCount: { type: 'number', default: 0 },
tourImages: { type: 'array', default: function() {
return [
{ file: 'f1.gif', duration: 4000 },
{ file: 'f2.gif', duration: 9000 },
{ file: 'f3.gif', duration: 9000 },
{ file: 'f4.gif', duration: 6000 },
{ file: 'f5.gif', duration: 9000 }
];
}
},
tourImagesFolder: { type: 'string', default: './images/tour/' }
},

template: require('./index.jade'),
events: {
'click #features ul': 'showFeature',
Expand All @@ -27,39 +26,44 @@ var TourView = View.extend({
render: function() {
var that = this;
this.renderWithTemplate(this);

this.$featuresUL = this.query('#features ul');
this.$featuresLI = this.queryAll('#features li');
this.$animationGIF = this.query('#animation-gif');
this.$tourRemove = this.query('#tour-remove');

this.playAuto = setInterval(function() {
that.$featuresLI[that.tourCount].className = '';

function showAnimation() {
var duration = that.tourImages[that.tourCount].duration;
// deselect old
$('#features li.selected').removeClass('selected');
// select new
that.$featuresLI[that.tourCount].className = 'selected';
that.$animationGIF.src = that.tourImagesFolder + that.tourImages[that.tourCount].file;
if (that.tourCount === 4) {
that.tourCount = 0;
} else {
that.tourCount++;
}
that.$featuresLI[that.tourCount].className = 'selected';
that.$animationGIF.src = that.tourImagesFolder + that.tourImages[that.tourCount];
}, 1000 * 7);
if (that.isAnimating) {
setTimeout(showAnimation, duration);
}
}
showAnimation();
},

showFeature: function(ev) {
this.isAnimating = false;
var nCLick = ev.target.getAttribute('data-n');
if (!nCLick) {
if (nCLick === null) {
return false;
}
var nFeature = parseInt(nCLick, 10);
this.$featuresLI[this.tourCount].className = '';
// deselect old
$('#features li.selected').removeClass('selected');
// select new
ev.target.className = 'selected';
this.$animationGIF.src = this.tourImagesFolder + ev.target.id + '.gif';
this.tourCount = nFeature;
clearInterval(this.playAuto);
},
tourRemove: function() {
clearInterval(this.playAuto);
this.isAnimating = false;
this.remove();
}
});
Expand Down
11 changes: 5 additions & 6 deletions src/tour/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,26 @@
left: 50%;
-webkit-transform: translate(-50%, -50%);

width: 80%;
max-width: 925px;
width: 90%;
max-width: 1200px;
position: absolute;
background-color: white;
border-radius: 9px;

#animation, #features {
float: left;
}
#animation {
width: 66%;
width: 70%;

img {
width: 80%;
width: 83%;
margin: 60px auto;
display: block;
border: 1px lightgrey solid;
}
}
#features {
width: 33%;
width: 30%;

h2 {
margin: 60px 0 0;
Expand Down
6 changes: 3 additions & 3 deletions styles/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

.instance-properties {
position: absolute;
top: 78px;
top: 18px;
left: 10px;

.hostname {
Expand Down Expand Up @@ -84,7 +84,7 @@

.list-filter {
position: absolute;
top: 156px;
top: 96px;
width: 100%;
// padding-bottom: 12px;
box-shadow: 0 2px 0 rgba(0,0,0,0.2);
Expand Down Expand Up @@ -137,7 +137,7 @@
.list-group {
line-height: 24px;
position: absolute;
top: 189px;
top: 129px;
bottom: 0px;
overflow-y: auto;
width: 100%;
Expand Down