Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/dist/index.html

Large diffs are not rendered by default.

71 changes: 3 additions & 68 deletions docs/src/js/model/marker.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ <h1>ФRuŠKać</h1>
</li>
<li><a href="#animateBounce"><i class="alert alert-info"></i><span>animateBounce</span></a>
</li>
<li><a href="#animateWobble"><i class="alert alert-info"></i><span>animateWobble</span></a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -182,10 +180,7 @@ <h5 class="subheader"></h5>
if (!div) {

div = self.div = document.createElement('div');
div.setAttribute('class', 'marker-container');
if (!self.options.visible) {
div.setAttribute('class', div.getAttribute('class') + ' hidden');
}
div.setAttribute('class', 'marker-container hidden');

if (!self.pulsate) {
self.markerShadow = document.createElement('div');
Expand Down Expand Up @@ -223,9 +218,9 @@ <h5 class="subheader"></h5>

// if this is a regular marker
if (!self.pulsate) {
// add wobble animation on enter
// add random timeout on enter
setTimeout(function () {
self.animateWobble();
util.removeClass(self.div, 'hidden');
}, Math.random() * 800 + 200);

// Show info Window for desktop
Expand Down Expand Up @@ -351,9 +346,6 @@ <h5 class="subheader"></h5>
//clusterer.addMarker(self);
setTimeout(function () {
util.removeClass(self.div, 'hidden');
//if (!self.clustered) {
self.animateWobble();
//}
}, Math.random() * 400);
} else {
//clusterer.removeMarker(self);
Expand Down Expand Up @@ -478,31 +470,6 @@ <h5 class="subheader"></h5>

dialog.open(content, self);
};</code></pre>
<div class="description"><p>Animate Marker with &quot;Drop&quot; animation</p> </div>
<div class="description"><p>Marker.prototype.animateDrop = function () {<br /> dynamics.stop(this.markerWrap);<br /> dynamics.css(this.markerWrap, {<br /> &#39;transform&#39;: &#39;scaleY(2) translateY(-&#39; + $(&#39;#map&#39;).outerHeight() + &#39;px)&#39;,<br /> &#39;opacity&#39;: &#39;1&#39;<br /> });<br /> dynamics.animate(this.markerWrap, {<br /> translateY: 0,<br /> scaleY: 1.0<br /> }, {<br /> type: dynamics.gravity,<br /> duration: 1800<br /> });</p><pre><code> dynamics.stop(this.marker);
dynamics.css(this.marker, {
&#39;transform&#39;: &#39;none&#39;
});
dynamics.animate(this.marker, {
scaleY: 0.8
}, {
type: dynamics.bounce,
duration: 1800,
bounciness: 600
});

dynamics.stop(this.markerShadow);
dynamics.css(this.markerShadow, {
&#39;transform&#39;: &#39;scale(0,0)&#39;,
});
dynamics.animate(this.markerShadow, {
scale: 1
}, {
type: dynamics.gravity,
duration: 1800
});
};
</code></pre> </div>
<section id="animateBounce">
<h1>animateBounce</h1>
<h5 class="subheader"></h5>
Expand Down Expand Up @@ -557,38 +524,6 @@ <h5 class="subheader"></h5>
duration: 500,
delay: 150
});
};</code></pre>
<section id="animateWobble">
<h1>animateWobble</h1>
<h5 class="subheader"></h5>
<p>
<div class="label label-info radius ctx-type">method</div><span>Marker.prototype.animateWobble()</span>
</p>
</section>
<div class="description"><p>Animate Marker with Wobble animation</p> </div>
<pre><code class="language-javascript">Marker.prototype.animateWobble = function () {
dynamics.stop(this.markerWrap);
dynamics.css(this.markerWrap, {
'transform': 'none'
});
dynamics.animate(this.markerWrap, {
rotateZ: Math.random() * 90 - 45
}, {
type: dynamics.bounce,
duration: 1800
});

dynamics.stop(this.marker);
dynamics.css(this.marker, {
'transform': 'none'
});
dynamics.animate(this.marker, {
scaleX: 0.8
}, {
type: dynamics.bounce,
duration: 800,
bounciness: 1800
});
};

return Marker;
Expand Down
23 changes: 1 addition & 22 deletions docs/src/js/service/dialog.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ <h1>ФRuŠKać</h1>
</li>
<li><a href="#close"><i class="alert alert-info"></i><span>close</span></a>
</li>
<li><a href="#animateWobble"><i class="alert alert-info"></i><span>animateWobble</span></a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -213,9 +211,6 @@ <h5 class="subheader"></h5>

setTimeout(function () {
self.dialog.open(gmap, anchor);
setTimeout(function () {
self.animateWobble();
}, 99)
}, 99);

},</code></pre>
Expand All @@ -231,23 +226,7 @@ <h5 class="subheader"></h5>
if (this.dialog.getVisible()) {
this.dialog.close();
}
},</code></pre>
<section id="animateWobble">
<h1>animateWobble</h1>
<h5 class="subheader"></h5>
<p>
<div class="label label-info radius ctx-type">method</div><span>Dialog.prototype.animateWobble()</span>
</p>
</section>
<div class="description"><p>Animate Marker with Wobble animation</p> </div>
<pre><code class="language-javascript">animateWobble: function () {
dynamics.animate(this.container.parentNode, {
rotateZ: Math.random() * 30 - 15
}, {
type: dynamics.bounce,
duration: 1800
})
}
},

};

Expand Down
4 changes: 0 additions & 4 deletions docs/src/js/service/map.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ <h5 class="subheader"></h5>
}
}

google.maps.event.addListener(marker, 'click', function () {
marker.animateWobble();
});

resolve(marker);

})
Expand Down
3 changes: 0 additions & 3 deletions docs/src/js/service/storage.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@ <h5 class="subheader"></h5>
item.children.forEach(function (child) {
var shoudBeOpaque = category &amp;&amp; child.categories.indexOf(category) === -1;
child.setOpaque(shoudBeOpaque);
if (!shoudBeOpaque) {
child.animateWobble();
}
})
}
})
Expand Down
46 changes: 41 additions & 5 deletions docs/src/js/util.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ <h1>ФRuŠKać</h1>
<ul class="nav nav-list bs-docs-sidenav affix-top">
<li><a href="#addClass"><i class="alert alert-info"></i><span>addClass</span></a>
</li>
<li><a href="#hasClass"><i class="alert alert-info"></i><span>hasClass</span></a>
</li>
<li><a href="#removeClass"><i class="alert alert-info"></i><span>removeClass</span></a>
</li>
<li><a href="#show"><i class="alert alert-info"></i><span>show</span></a>
Expand Down Expand Up @@ -138,12 +140,46 @@ <h5 class="subheader"></h5>
</tr>
</tbody>
</table>
<div class="description"><p>Add a class to a DOM element</p> </div>
<pre><code class="language-javascript">addClass: function (element, className) {
<div class="description"><p>Add a class to a DOM element if class does not exist</p> </div>
<pre><code class="language-javascript">addClass: function(element, className) {
if (this.hasClass(element, className))
return;
if (element.hasOwnProperty('classList'))
element.classList.add(className);
else
element.className += ' ' + className;
},</code></pre>
<section id="hasClass">
<h1>hasClass</h1>
<h5 class="subheader"></h5>
<p>
<div class="label label-info radius ctx-type">method</div><span>hasClass()</span>
</p>
</section>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width:20%">Option name</th>
<th style="width:20%">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>element</td>
<td>HTMLDomElement</td>
<td></td>
</tr>
<tr>
<td>className</td>
<td>string</td>
<td></td>
</tr>
</tbody>
</table>
<div class="description"><p>Check if a DOM element has a class</p> </div>
<pre><code class="language-javascript">hasClass: function(element, className) {
return ((element.hasOwnProperty('classList') &amp;&amp; element.classList.contains(className)) || (' ' + element.className + ' ').indexOf(' ' + className + ' ') &gt; -1) ? true : false;
},</code></pre>
<section id="removeClass">
<h1>removeClass</h1>
Expand Down Expand Up @@ -174,7 +210,7 @@ <h5 class="subheader"></h5>
</tbody>
</table>
<div class="description"><p>Remove a class from a DOM element</p> </div>
<pre><code class="language-javascript">removeClass: function (element, className) {
<pre><code class="language-javascript">removeClass: function(element, className) {
if (element.hasOwnProperty('classList'))
element.classList.remove(className);
else
Expand Down Expand Up @@ -204,7 +240,7 @@ <h5 class="subheader"></h5>
</tbody>
</table>
<div class="description"><p>Show a DOM element</p> </div>
<pre><code class="language-javascript">show: function (element) {
<pre><code class="language-javascript">show: function(element) {
element.style.display = '';
},</code></pre>
<section id="remove">
Expand All @@ -231,7 +267,7 @@ <h5 class="subheader"></h5>
</tbody>
</table>
<div class="description"><p>Remove an element from DOM</p> </div>
<pre><code class="language-javascript">remove: function (element) {
<pre><code class="language-javascript">remove: function(element) {
element.parentNode.removeChild(element);
},</code></pre>
</div>
Expand Down
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ paths.less = [
gulp.task('build:less', function () {
return gulp.src(paths.less)
.pipe(less())
.pipe(sourcemaps.init())
.pipe(cssnano())
.pipe(concat('map.min.css'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dist'));
});

Expand Down
81 changes: 3 additions & 78 deletions src/js/model/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ fruskac.Marker = (function () {
if (!div) {

div = self.div = document.createElement('div');
div.setAttribute('class', 'marker-container');
if (!self.options.visible) {
div.setAttribute('class', div.getAttribute('class') + ' hidden');
}
div.setAttribute('class', 'marker-container hidden');

if (!self.pulsate) {
self.markerShadow = document.createElement('div');
Expand Down Expand Up @@ -74,9 +71,9 @@ fruskac.Marker = (function () {

// if this is a regular marker
if (!self.pulsate) {
// add wobble animation on enter
// add random timeout on enter
setTimeout(function () {
self.animateWobble();
util.removeClass(self.div, 'hidden');
}, Math.random() * 800 + 200);

// Show info Window for desktop
Expand Down Expand Up @@ -148,9 +145,6 @@ fruskac.Marker = (function () {
//clusterer.addMarker(self);
setTimeout(function () {
util.removeClass(self.div, 'hidden');
//if (!self.clustered) {
self.animateWobble();
//}
}, Math.random() * 400);
} else {
//clusterer.removeMarker(self);
Expand Down Expand Up @@ -239,47 +233,6 @@ fruskac.Marker = (function () {
dialog.open(content, self);
};

/**
* Animate Marker with "Drop" animation
*/
/*Marker.prototype.animateDrop = function () {
dynamics.stop(this.markerWrap);
dynamics.css(this.markerWrap, {
'transform': 'scaleY(2) translateY(-' + $('#map').outerHeight() + 'px)',
'opacity': '1'
});
dynamics.animate(this.markerWrap, {
translateY: 0,
scaleY: 1.0
}, {
type: dynamics.gravity,
duration: 1800
});

dynamics.stop(this.marker);
dynamics.css(this.marker, {
'transform': 'none'
});
dynamics.animate(this.marker, {
scaleY: 0.8
}, {
type: dynamics.bounce,
duration: 1800,
bounciness: 600
});

dynamics.stop(this.markerShadow);
dynamics.css(this.markerShadow, {
'transform': 'scale(0,0)',
});
dynamics.animate(this.markerShadow, {
scale: 1
}, {
type: dynamics.gravity,
duration: 1800
});
};*/

/**
* Animate Marker with Bounce animation
*/
Expand Down Expand Up @@ -331,34 +284,6 @@ fruskac.Marker = (function () {
});
};

/**
* Animate Marker with Wobble animation
*/
Marker.prototype.animateWobble = function () {
dynamics.stop(this.markerWrap);
dynamics.css(this.markerWrap, {
'transform': 'none'
});
dynamics.animate(this.markerWrap, {
rotateZ: Math.random() * 90 - 45
}, {
type: dynamics.bounce,
duration: 1800
});

dynamics.stop(this.marker);
dynamics.css(this.marker, {
'transform': 'none'
});
dynamics.animate(this.marker, {
scaleX: 0.8
}, {
type: dynamics.bounce,
duration: 800,
bounciness: 1800
});
};

return Marker;

})();
Loading