Skip to content

Commit bca0003

Browse files
Fix spreader title transform, new colorPalettes
1 parent 816c70f commit bca0003

15 files changed

+296
-212
lines changed

css/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ header a {
1616
background-color: #ddd;
1717
color: #555;
1818
text-decoration: none;
19+
padding: 0 3px 0 3px;
1920
}
2021

2122
header a:hover {
@@ -37,6 +38,7 @@ footer a {
3738
background-color: #ddd;
3839
color: #555;
3940
text-decoration: none;
41+
padding: 0 3px 0 3px;
4042
}
4143

4244
footer a:hover {

js/dist/core/wheelnav.js

Lines changed: 73 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ wheelnav.prototype.navigateWheel = function (clicked) {
357357
else {
358358
this.marker.setCurrentTransform();
359359
}
360-
this.spreader.setCurrentTransform();
360+
this.spreader.setCurrentTransform(true);
361361
}
362362
};
363363

@@ -530,8 +530,8 @@ wheelnav.prototype.parseWheel = function (holderDiv) {
530530
this.markerPathFunction = markerPath()[wheelnavMarkerPath];
531531
}
532532
}
533-
//data-wheelnav-onlyinit
534-
var wheelnavOnlyinit = holderDiv.getAttribute("data-wheelnav-onlyinit");
533+
//data-wheelnav-init
534+
var wheelnavOnlyinit = holderDiv.getAttribute("data-wheelnav-init");
535535
if (wheelnavOnlyinit !== null) {
536536
onlyInit = true;
537537
}
@@ -671,15 +671,16 @@ wheelnavItem = function (wheelnav, title, itemIndex) {
671671
this.animateeffect = "bounce";
672672
this.animatetime = 1500;
673673
this.sliceAngle = 360 / wheelnav.navItemCount;
674-
674+
675+
this.navigateHref = null;
676+
this.navigateFunction = null;
677+
678+
//Navitem styles
675679
this.styleNavItem();
676680

677681
//Wheelnav settings
678682
this.setWheelSettings();
679683

680-
this.navigateHref = null;
681-
this.navigateFunction = null;
682-
683684
return this;
684685
};
685686

@@ -889,7 +890,7 @@ wheelnavItem.prototype.hoverEffect = function (hovered, isEnter) {
889890
}
890891

891892
this.wheelnav.marker.setCurrentTransform();
892-
this.wheelnav.spreader.setCurrentTransform();
893+
this.wheelnav.spreader.setCurrentTransform(true);
893894
}
894895
};
895896

@@ -2009,16 +2010,28 @@ spreader = function (wheelnav) {
20092010
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
20102011
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
20112012
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2012-
this.spreaderTitle = thisWheelNav.raphael.path(this.outTitle.path);
20132013
}
20142014
else {
20152015
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
20162016
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2017-
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, this.outTitle.title);
20182017
}
20192018

2019+
var currentTitle = this.outTitle;
2020+
var currentTitleAttr = this.wheelnav.spreaderTitleOutAttr;
2021+
if (thisWheelNav.initPercent < thisWheelNav.maxPercent) {
2022+
currentTitle = this.inTitle;
2023+
currentTitleAttr = this.wheelnav.spreaderTitleInAttr;
2024+
}
2025+
2026+
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
2027+
this.spreaderTitle = thisWheelNav.raphael.path(currentTitle.path);
2028+
}
2029+
else {
2030+
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, currentTitle.title);
2031+
}
2032+
20202033
this.spreaderTitle.attr(this.fontAttr);
2021-
this.spreaderTitle.attr(thisWheelNav.spreaderOnAttr);
2034+
this.spreaderTitle.attr(currentTitleAttr);
20222035
this.spreaderTitle.id = thisWheelNav.getSpreaderTitleId();
20232036
this.spreaderTitle.node.id = this.spreaderTitle.id;
20242037
this.spreaderTitle.click(function () {
@@ -2031,60 +2044,62 @@ spreader = function (wheelnav) {
20312044
return this;
20322045
};
20332046

2034-
spreader.prototype.setCurrentTransform = function () {
2047+
spreader.prototype.setCurrentTransform = function (withoutAnimate) {
20352048
if (this.wheelnav.spreaderEnable) {
2036-
this.spreaderPath.toFront();
2037-
20382049

2039-
if (this.wheelnav.currentPercent > this.wheelnav.minPercent) {
2040-
currentPath = this.spreaderPathOut.spreaderPathString;
2041-
}
2042-
else {
2043-
currentPath = this.spreaderPathIn.spreaderPathString;
2044-
}
2050+
if (withoutAnimate === undefined ||
2051+
withoutAnimate === false) {
2052+
2053+
if (this.wheelnav.currentPercent > this.wheelnav.minPercent) {
2054+
currentPath = this.spreaderPathOut.spreaderPathString;
2055+
}
2056+
else {
2057+
currentPath = this.spreaderPathIn.spreaderPathString;
2058+
}
20452059

2046-
spreaderTransformAttr = {
2047-
path: currentPath
2048-
};
2060+
spreaderTransformAttr = {
2061+
path: currentPath
2062+
};
20492063

2050-
//Animate spreader
2051-
this.spreaderPath.animate(spreaderTransformAttr, this.animatetime, this.animateeffect);
2064+
//Animate spreader
2065+
this.spreaderPath.animate(spreaderTransformAttr, this.animatetime, this.animateeffect);
20522066

2053-
//titles
2054-
var currentTitle;
2067+
//titles
2068+
var currentTitle;
2069+
var titleTransformAttr;
20552070

2056-
if (this.wheelnav.currentPercent === this.wheelnav.maxPercent) {
2057-
currentTitle = this.outTitle;
2058-
this.spreaderTitle.attr(this.wheelnav.spreaderTitleOutAttr);
2059-
this.spreaderPath.attr(this.wheelnav.spreaderPathOutAttr);
2060-
}
2061-
else {
2062-
currentTitle = this.inTitle;
2063-
this.spreaderTitle.attr(this.wheelnav.spreaderTitleInAttr);
2064-
this.spreaderPath.attr(this.wheelnav.spreaderPathInAttr);
2065-
}
2071+
if (this.wheelnav.currentPercent === this.wheelnav.maxPercent) {
2072+
currentTitle = this.outTitle;
2073+
titleTransformAttr = this.wheelnav.spreaderTitleOutAttr;
2074+
this.spreaderPath.attr(this.wheelnav.spreaderPathOutAttr);
2075+
}
2076+
else {
2077+
currentTitle = this.inTitle;
2078+
titleTransformAttr = this.wheelnav.spreaderTitleInAttr;
2079+
this.spreaderPath.attr(this.wheelnav.spreaderPathInAttr);
2080+
}
20662081

2067-
if (this.spreaderTitle.type === "path") {
2068-
titleTransformAttr = {
2069-
path: currentTitle.path
2070-
};
2071-
}
2072-
else {
2073-
//Little hack for proper appearance of "-" sign
2074-
offYOffset = 0;
2075-
if (currentTitle.title === "-") { offYOffset = 3; }
2082+
if (this.spreaderTitle.type === "path") {
2083+
titleTransformAttr.path = currentTitle.path;
2084+
}
2085+
else {
2086+
//Little hack for proper appearance of "-" sign
2087+
offYOffset = 0;
2088+
if (currentTitle.title === "-") { offYOffset = 3; };
20762089

2077-
titleTransformAttr = {
2078-
x: currentTitle.x,
2079-
y: currentTitle.y - offYOffset
2080-
};
2090+
titleTransformAttr.x = currentTitle.x;
2091+
titleTransformAttr.y = currentTitle.y - offYOffset;
20812092

2082-
if (currentTitle.title !== null) {
2083-
this.spreaderTitle.attr({ text: currentTitle.title });
2093+
if (currentTitle.title !== null) {
2094+
this.spreaderTitle.attr({ text: currentTitle.title });
2095+
}
20842096
}
2097+
2098+
//Animate title
2099+
this.spreaderTitle.animate(titleTransformAttr, this.animatetime, this.animateeffect);
20852100
}
20862101

2087-
this.spreaderTitle.animate(titleTransformAttr, this.animatetime, this.animateeffect);
2102+
this.spreaderPath.toFront();
20882103
this.spreaderTitle.toFront();
20892104
}
20902105
};
@@ -2702,6 +2717,7 @@ var colorpalette = {
27022717
defaultpalette: new Array("#2ECC40", "#FFDC00", "#FF851B", "#FF4136", "#0074D9", "#777"),
27032718
purple: new Array("#4F346B", "#623491", "#9657D6", "#AD74E7", "#CBA3F3"),
27042719
greenred: new Array("#17B92A", "#FF3D00", "#17B92A", "#FF3D00"),
2720+
greensilver: new Array("#1F700A", "#79CC3C", "#D4E178", "#E6D5C3", "#AC875D"),
27052721
oceanfive: new Array("#00A0B0", "#6A4A3C", "#CC333F", "#EB6841", "#EDC951"),
27062722
garden: new Array("#648A4F", "#2B2B29", "#DF6126", "#FFA337", "#F57C85"),
27072723
gamebookers: new Array("#FF9900", "#DCDCDC", "#BCBCBC", "#3299BB", "#727272"),
@@ -2711,5 +2727,8 @@ var colorpalette = {
27112727
theworldismine: new Array("#F21D1D", "#FF2167", "#B521FF", "#7E2AA8", "#000000"),
27122728
fractalloveone: new Array("#002EFF", "#00FFF7", "#00FF62", "#FFAA00", "#FFF700"),
27132729
fractallovetwo: new Array("#FF9500", "#FF0000", "#FF00F3", "#AA00FF", "#002EFF"),
2714-
fractallove: new Array("#002EFF", "#00FFF7", "#00FF62", "#FFAA00", "#FFF700", "#FF0000", "#FF00F3", "#AA00FF")
2730+
fractallove: new Array("#002EFF", "#00FFF7", "#00FF62", "#FFAA00", "#F5D908", "#FF0000", "#FF00F3", "#AA00FF"),
2731+
sprinkles: new Array("#272523", "#FFACAC", "#FFD700", "#00590C", "#08006D"),
2732+
goldenyellow: new Array("#D8B597", "#8C4006", "#B6690F", "#E3C57F", "#FFEDBE"),
2733+
hotaru: new Array("#364C4A", "#497C7F", "#92C5C0", "#858168", "#CCBCA5")
27152734
};

js/dist/core/wheelnav.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/core/wheelnav.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)