@@ -75,6 +103,7 @@
data = {
modalId: modalId,
theme: opts.theme,
+ header: opts.header,
fullScreen: (opts.fullScreen ? "fullscreen" : ""),
styles: [],
iframe: opts.iframe
@@ -99,6 +128,7 @@
// 파트수집
this.$ = {
"root": this.activeModal.find('[data-modal-els="root"]'),
+ "header": this.activeModal.find('[data-modal-els="header"]'),
"body": this.activeModal.find('[data-modal-els="body"]')
};
@@ -147,22 +177,188 @@
}).bind(this));
}
jQuery(window).bind("resize.ax-modal", (function (e) {
- align.call(this, null, e || window.event);
+ this.align(null, e || window.event);
+ }).bind(this));
+
+ this.activeModal.find("[data-modal-header-btn]").on(cfg.clickEventName, (function (e) {
+ btnOnClick.call(this, e || window.event, opts);
}).bind(this));
+
+ this.$.header
+ .bind(ENM["mousedown"], function (e) {
+ self.mousePosition = getMousePosition(e);
+ moveModal.on.call(self);
+ })
+ .bind("dragstart", function (e) {
+ U.stopEvent(e);
+ return false;
+ });
+ },
+ btnOnClick = function (e, opts, callBack, target, k) {
+ var that;
+ if (e.srcElement) e.target = e.srcElement;
+
+ target = U.findParentNode(e.target, function (target) {
+ if (target.getAttribute("data-modal-header-btn")) {
+ return true;
+ }
+ });
+
+ if (target) {
+ k = target.getAttribute("data-modal-header-btn");
+
+ that = {
+ self: this,
+ key: k, value: opts.header.btns[k],
+ dialogId: opts.id,
+ btnTarget: target
+ };
+
+ if (opts.header.btns[k].onClick) {
+ opts.header.btns[k].onClick.call(that, k);
+ }
+ }
+
+ that = null;
+ opts = null;
+ callBack = null;
+ target = null;
+ k = null;
},
onkeyup = function (e) {
if (e.keyCode == ax5.info.eventKeys.ESC) {
this.close();
}
+ },
+ alignProcessor = {
+ "top-left": function () {
+ this.align({left: "left", top: "top"});
+ },
+ "top-right": function () {
+ this.align({left: "right", top: "top"});
+ },
+ "bottom-left": function () {
+ this.align({left: "left", top: "bottom"});
+ },
+ "bottom-right": function () {
+ this.align({left: "right", top: "bottom"});
+ },
+ "center-middle": function () {
+ this.align({left: "center", top: "middle"});
+ }
+ },
+ moveModal = {
+ "on": function () {
+ var modalOffset = this.activeModal.position();
+ var modalBox = {
+ width: this.activeModal.outerWidth(), height: this.activeModal.outerHeight()
+ };
+ var windowBox = {
+ width: jQuery(window).width(),
+ height: jQuery(window).height()
+ };
+ var getResizerPosition = function (e) {
+ self.__dx = e.clientX - self.mousePosition.clientX;
+ self.__dy = e.clientY - self.mousePosition.clientY;
+
+ var minX = 0;
+ var maxX = windowBox.width - modalBox.width;
+ var minY = 0;
+ var maxY = windowBox.height - modalBox.height;
+
+ if(minX > modalOffset.left + self.__dx){
+ self.__dx = -modalOffset.left;
+ }
+ else if(maxX < modalOffset.left + self.__dx){
+ self.__dx = (maxX) - modalOffset.left;
+ }
+
+ if(minY > modalOffset.top + self.__dy){
+ self.__dy = -modalOffset.top;
+ }
+ else if(maxY < modalOffset.top + self.__dy){
+ self.__dy = (maxY) - modalOffset.top;
+ }
+
+ return {
+ left: modalOffset.left + self.__dx,
+ top: modalOffset.top + self.__dy
+ };
+ };
+
+ self.__dx = 0; // 변화량 X
+ self.__dy = 0; // 변화량 Y
+
+ jQuery(document.body)
+ .bind(ENM["mousemove"] + ".ax5modal-" + cfg.id, function (e) {
+ if (!self.resizer) {
+ // self.resizerBg : body 가 window보다 작을 때 문제 해결을 위한 DIV
+ self.resizerBg = jQuery('
');
+ self.resizer = jQuery('
');
+ self.resizer.css({
+ left: modalOffset.left,
+ top: modalOffset.top,
+ width: modalBox.width,
+ height: modalBox.height
+ });
+ jQuery(document.body)
+ .append(self.resizerBg)
+ .append(self.resizer);
+ self.activeModal.addClass("draged");
+ }
+ self.resizer.css(getResizerPosition(e));
+ })
+ .bind(ENM["mouseup"] + ".ax5layout-" + this.instanceId, function (e) {
+ moveModal.off.call(self);
+ })
+ .bind("mouseleave.ax5layout-" + this.instanceId, function (e) {
+ moveModal.off.call(self);
+ });
+
+ jQuery(document.body)
+ .attr('unselectable', 'on')
+ .css('user-select', 'none')
+ .on('selectstart', false);
+ },
+ "off": function () {
+ var setModalPosition = function () {
+ //console.log(this.activeModal.offset(), this.__dx);
+ var box = this.activeModal.offset();
+ box.left += this.__dx;
+ box.top += this.__dy;
+ this.activeModal.css(box);
+ };
+
+ if (this.resizer) {
+ this.activeModal.removeClass("draged");
+ this.resizer.remove();
+ this.resizer = null;
+ this.resizerBg.remove();
+ this.resizerBg = null;
+ setModalPosition.call(this);
+ //this.align();
+ }
+
+ jQuery(document.body)
+ .unbind(ENM["mousemove"] + ".ax5modal-" + cfg.id)
+ .unbind(ENM["mouseup"] + ".ax5modal-" + cfg.id)
+ .unbind("mouseleave.ax5modal-" + cfg.id);
+
+ jQuery(document.body)
+ .removeAttr('unselectable')
+ .css('user-select', 'auto')
+ .off('selectstart');
+
+ }
};
/// private end
/**
* Preferences of modal UI
- * @method ax5.ui.modal.setConfig
+ * @method ax5modal.setConfig
* @param {Object} config - 클래스 속성값
- * @returns {ax5.ui.modal}
+ * @returns {ax5modal}
* @example
* ```
* ```
@@ -174,40 +370,29 @@
/**
* open the modal
- * @method ax5.ui.modal.open
- * @returns {ax5.ui.modal}
+ * @method ax5modal.open
+ * @returns {ax5modal}
* @example
* ```
* my_modal.open();
* ```
*/
this.open = function (opts, callBack) {
- if (U.isString(opts)) {
- opts = {
- title: cfg.title,
- msg: opts
- }
- }
-
- self.modalConfig = {};
- jQuery.extend(true, self.modalConfig, cfg);
- jQuery.extend(true, self.modalConfig, opts);
- opts = self.modalConfig;
-
+ opts = self.modalConfig = jQuery.extend(true, {}, cfg, opts);
open.call(this, opts, callBack);
return this;
};
/**
* close the modal
- * @method ax5.ui.modal.close
- * @returns {ax5.ui.modal}
+ * @method ax5modal.close
+ * @returns {ax5modal}
* @example
* ```
* my_modal.close();
* ```
*/
- this.close = function (opts, that) {
+ this.close = function (opts) {
if (this.activeModal) {
opts = self.modalConfig;
this.activeModal.addClass("destroy");
@@ -217,10 +402,6 @@
setTimeout((function () {
this.activeModal.remove();
this.activeModal = null;
- that = {
- self: this,
- state: "close"
- };
onStateChanged.call(this, opts, {
self: this,
state: "close"
@@ -230,11 +411,56 @@
return this;
};
+ /**
+ * @method ax5modal.minimize
+ * @returns {axClass}
+ */
+ this.minimize = (function () {
+
+ return function (minimizePosition) {
+ var opts = self.modalConfig;
+ if (typeof minimizePosition === "undefined") minimizePosition = cfg.minimizePosition;
+ this.minimized = true;
+ this.$.body.hide();
+ self.modalConfig.originalHeight = opts.height;
+ self.modalConfig.height = 0;
+ alignProcessor[minimizePosition].call(this);
+
+ onStateChanged.call(this, opts, {
+ self: this,
+ state: "minimize"
+ });
+
+ return this;
+ };
+ })();
+
+ /**
+ * @method ax5modal.maximize
+ * @returns {axClass}
+ */
+ this.maximize = function () {
+ var opts = self.modalConfig;
+ if (this.minimized) {
+ this.minimized = false;
+ this.$.body.show();
+ self.modalConfig.height = self.modalConfig.originalHeight;
+ self.modalConfig.originalHeight = undefined;
+
+ this.align({left: "center", top: "middle"});
+ onStateChanged.call(this, opts, {
+ self: this,
+ state: "restore"
+ });
+ }
+ return this;
+ };
+
/**
* setCSS
- * @method ax5.ui.modal.css
+ * @method ax5modal.css
* @param {Object} css -
- * @returns {ax5.ui.modal}
+ * @returns {ax5modal}
*/
this.css = function (css) {
if (this.activeModal && !self.fullScreen) {
@@ -254,14 +480,14 @@
};
/**
- * @mothod ax5.ui.modal.align
+ * @mothod ax5modal.align
* @param position
* @param e
- * @returns {ax5.ui.modal}
+ * @returns {ax5modal}
*/
this.align = (function () {
- return function(position, e){
+ return function (position, e) {
if (!this.activeModal) return this;
var opts = self.modalConfig,
@@ -270,7 +496,9 @@
height: opts.height
};
+
if (opts.fullScreen) {
+ if (opts.header) this.$.header.hide();
box.width = jQuery(window).width();
box.height = jQuery(window).height();
box.left = 0;
@@ -286,6 +514,10 @@
jQuery.extend(true, opts.position, position);
}
+ if (opts.header) {
+ box.height += this.$.header.outerHeight();
+ }
+
//- position 정렬
if (opts.position.left == "left") {
box.left = (opts.position.margin || 0);
@@ -313,6 +545,7 @@
else {
box.top = opts.position.top || 0;
}
+
}
this.activeModal.css(box);
diff --git a/src/scss/_ax5modal.scss b/src/scss/_ax5modal.scss
index a6e75c3..5883a0b 100644
--- a/src/scss/_ax5modal.scss
+++ b/src/scss/_ax5modal.scss
@@ -1,176 +1,274 @@
@mixin ax-modal() {
- box-sizing: $ax5modal-box-model;
- background-color: $ax5modal-bg;
- border: $ax5modal-border;
-
- @include ax-border-radius($ax5modal-border-radius);
- @include box-shadow($ax5modal-box-shaodw);
-
- z-index: $ax5modal-z-index;
- position: fixed;
- left: 0px;
- top: 0px;
- overflow: hidden;
+ box-sizing: $ax5modal-box-model;
+ background-color: $ax5modal-bg;
+ border: $ax5modal-border;
+
+ @include ax-border-radius($ax5modal-border-radius);
+ @include box-shadow($ax5modal-box-shadow);
+
+ z-index: $ax5modal-z-index;
+ position: fixed;
+ left: 0px;
+ top: 0px;
+ overflow: hidden;
}
@mixin ax-modal-section() {
- .ax-modal-body {
- padding: $ax5modal-body-padding;
- text-align: center;
- @include flex(1);
- position: relative;
- iframe {
- border: 0px none;
- }
- }
+ .ax-modal-header {
+ @include user-select(none);
+ //font-size: 1em;
+ font-weight: 600;
+ padding: $ax5modal-header-padding;
+ border-bottom: 1px solid transparent;
+ cursor: move;
+ .ax-modal-header-addon{
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ padding: $ax5modal-header-addon-padding;
+ a{
+ padding: $ax5modal-header-addon-btn-padding;
+ background: transparent;
+ display: inline-block;
+ text-align: center;
+ cursor: pointer;
+ }
+ }
+ }
+ .ax-modal-body {
+ padding: $ax5modal-body-padding;
+ text-align: center;
+ @include flex(1);
+ position: relative;
+ iframe {
+ border: 0px none;
+ }
+ }
}
-@mixin modal-variant() {
- .ax-modal-body {
+@mixin modal-variant($text-color, $border, $header-bg-color) {
+ .ax-modal-header {
+ color: $text-color;
+ background: $header-bg-color;
+ .ax-modal-header-addon{
+ a{
+ color: $text-color;
+ }
+ }
+ }
+ .ax-modal-body {
- }
+ }
}
@include keyframes(ax-modal) {
- 0% {
- opacity: 0.0;
- -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 0.1% {
- opacity: 1.0;
- -webkit-transform: matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 5.9% {
- -webkit-transform: matrix3d(0.711, 0, 0, 0, 0, 0.742, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.711, 0, 0, 0, 0, 0.742, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 7.7% {
- -webkit-transform: matrix3d(0.768, 0, 0, 0, 0, 0.812, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.768, 0, 0, 0, 0, 0.812, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 11.5% {
- -webkit-transform: matrix3d(0.869, 0, 0, 0, 0, 0.935, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.869, 0, 0, 0, 0, 0.935, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 11.7% {
- -webkit-transform: matrix3d(0.873, 0, 0, 0, 0, 0.94, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.873, 0, 0, 0, 0, 0.94, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 15.2% {
- -webkit-transform: matrix3d(0.941, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.941, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 17.5% {
- -webkit-transform: matrix3d(0.973, 0, 0, 0, 0, 1.045, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.973, 0, 0, 0, 0, 1.045, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 19% {
- -webkit-transform: matrix3d(0.99, 0, 0, 0, 0, 1.058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.99, 0, 0, 0, 0, 1.058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 22.8% {
- -webkit-transform: matrix3d(1.019, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.019, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 23.2% {
- -webkit-transform: matrix3d(1.021, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.021, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 30.3% {
- -webkit-transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 30.4% {
- -webkit-transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 37.5% {
- -webkit-transform: matrix3d(1.028, 0, 0, 0, 0, 1.016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.028, 0, 0, 0, 0, 1.016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 44.6% {
- -webkit-transform: matrix3d(1.016, 0, 0, 0, 0, 0.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.016, 0, 0, 0, 0, 0.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 50.3% {
- -webkit-transform: matrix3d(1.008, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.008, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 51.7% {
- -webkit-transform: matrix3d(1.006, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1.006, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 70.3% {
- -webkit-transform: matrix3d(0.998, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.998, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 80.3% {
- -webkit-transform: matrix3d(0.999, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(0.999, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- 100% {
- -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
-
+ 0% {
+ opacity: 0.0;
+ @include transform(translateY(20%));
+ }
+ 100% {
+ opacity: 1.0;
+ @include transform(translateY(0));
+ }
+ /*
+ 0% {
+ opacity: 0.0;
+ -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 0.1% {
+ opacity: 1.0;
+ -webkit-transform: matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 5.9% {
+ -webkit-transform: matrix3d(0.711, 0, 0, 0, 0, 0.742, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.711, 0, 0, 0, 0, 0.742, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 7.7% {
+ -webkit-transform: matrix3d(0.768, 0, 0, 0, 0, 0.812, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.768, 0, 0, 0, 0, 0.812, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 11.5% {
+ -webkit-transform: matrix3d(0.869, 0, 0, 0, 0, 0.935, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.869, 0, 0, 0, 0, 0.935, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 11.7% {
+ -webkit-transform: matrix3d(0.873, 0, 0, 0, 0, 0.94, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.873, 0, 0, 0, 0, 0.94, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 15.2% {
+ -webkit-transform: matrix3d(0.941, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.941, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 17.5% {
+ -webkit-transform: matrix3d(0.973, 0, 0, 0, 0, 1.045, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.973, 0, 0, 0, 0, 1.045, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 19% {
+ -webkit-transform: matrix3d(0.99, 0, 0, 0, 0, 1.058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.99, 0, 0, 0, 0, 1.058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 22.8% {
+ -webkit-transform: matrix3d(1.019, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.019, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 23.2% {
+ -webkit-transform: matrix3d(1.021, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.021, 0, 0, 0, 0, 1.071, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 30.3% {
+ -webkit-transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 30.4% {
+ -webkit-transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.036, 0, 0, 0, 0, 1.049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 37.5% {
+ -webkit-transform: matrix3d(1.028, 0, 0, 0, 0, 1.016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.028, 0, 0, 0, 0, 1.016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 44.6% {
+ -webkit-transform: matrix3d(1.016, 0, 0, 0, 0, 0.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.016, 0, 0, 0, 0, 0.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 50.3% {
+ -webkit-transform: matrix3d(1.008, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.008, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 51.7% {
+ -webkit-transform: matrix3d(1.006, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1.006, 0, 0, 0, 0, 0.992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 70.3% {
+ -webkit-transform: matrix3d(0.998, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.998, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 80.3% {
+ -webkit-transform: matrix3d(0.999, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(0.999, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ 100% {
+ -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
+ */
}
@include keyframes(ax-modal-destroy) {
- from {
- @include transform(scale(1));
- opacity: 1.0;
- }
- to {
- @include transform(scale(0.5));
- opacity: 0.0;
- }
+ /*
+ from {
+ @include transform(scale(1));
+ opacity: 1.0;
+ }
+ to {
+ @include transform(scale(0.5));
+ opacity: 0.0;
+ }
+ */
+ 100% {
+ opacity: 0.0;
+ @include transform(translateY(20%));
+ }
+ 0% {
+ opacity: 1.0;
+ @include transform(translateY(0));
+ }
+
}
@include keyframes(ax-modal-fullscreen) {
- 0% {
- @include transform(translateY(100%));
- }
- 100% {
- @include transform(translateY(0));
- }
+ 0% {
+ @include transform(translateY(20%));
+ }
+ 100% {
+ @include transform(translateY(0));
+ }
}
@include keyframes(ax-modal-fullscreen-destroy) {
- 0% {
- @include transform(translateY(0));
- }
- 100% {
- @include transform(translateY(100%));
- }
+ 0% {
+ @include transform(translateY(0));
+ }
+ 100% {
+ @include transform(translateY(100%));
+ }
}
// mixins --------------------------------------------- end
-.ax5-ui-modal {
- @include animation(ax-modal 0.7s linear both);
- @include transform(translateZ(0px));
- //@include transition(all $ax5modal-easing-time-open linear);
+.ax5modal {
+ @include animation(ax-modal $ax5modal-easing-time-open $ease-out-back forwards);
+ @include transform(translateZ(0px));
+ //@include transition(all $ax5modal-easing-time-open linear);
+
+ @include ax-modal();
+ @include ax-modal-section();
+ @include modal-variant($ax5modal-default-text, $ax5modal-default-border, $ax5modal-default-header-bg);
- @include ax-modal();
- @include ax-modal-section();
- @include modal-variant();
+ &.primary {
+ @include modal-variant($ax5modal-primary-text, $ax5modal-primary-border, $ax5modal-primary-header-bg);
+ }
+ &.success {
+ @include modal-variant($ax5modal-success-text, $ax5modal-success-border, $ax5modal-success-header-bg);
+ }
+ &.info {
+ @include modal-variant($ax5modal-info-text, $ax5modal-info-border, $ax5modal-info-header-bg);
+ }
+ &.warning {
+ @include modal-variant($ax5modal-warning-text, $ax5modal-warning-border, $ax5modal-warning-header-bg);
+ }
+ &.danger {
+ @include modal-variant($ax5modal-danger-text, $ax5modal-danger-border, $ax5modal-danger-header-bg);
+ }
- &.destroy {
- @include animation(ax-modal-destroy $ax5modal-easing-time-close $ease-in-back forwards);
- }
+ &.destroy {
+ @include animation(ax-modal-destroy $ax5modal-easing-time-close $ease-out-back forwards);
+ }
+ &.fullscreen {
+ border: 0px none;
+ @include ax-border-radius(0px);
+ @include box-shadow(none);
+ @include animation(ax-modal-fullscreen $ax5modal-easing-time-open $ease-out-back forwards);
+
+ &.destroy {
+ @include animation(ax-modal-fullscreen-destroy $ax5modal-easing-time-close $ease-out-expo forwards);
+ }
+ }
+
+ &.draged{
+ .ax-modal-header {
+ opacity: 0.5;
+ }
+ .ax-modal-body {
+ opacity: 0.5;
+ }
+ }
+}
+
+.ax5modal-resizer-background{
+ position: fixed;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ height: 100%;
+ background: transparent;
+}
+.ax5modal-resizer{
+ position: absolute;
+ left: 0px;
+ top: 0px;
- &.fullscreen{
- border: 0px none;
- @include ax-border-radius(0px);
- @include box-shadow(none);
- @include animation(ax-modal-fullscreen 0.3s $ease-in-back forwards);
+ z-index: $ax5modal-z-index + 1;
+ cursor: move;
- &.destroy {
- @include animation(ax-modal-fullscreen-destroy $ax5modal-easing-time-close $ease-out-expo forwards);
- }
- }
+ box-sizing: $ax5modal-box-model;
+ background-color: $ax5modal-resizer-bg;
+ border: $ax5modal-resizer-border;
+ opacity: $ax5modal-resizer-opacity;
+ @include ax-border-radius($ax5modal-border-radius);
+ @include box-shadow($ax5modal-box-shadow);
}
\ No newline at end of file
diff --git a/src/scss/_ax5modal_variables.scss b/src/scss/_ax5modal_variables.scss
index 0b11cd1..6a7a8ef 100644
--- a/src/scss/_ax5modal_variables.scss
+++ b/src/scss/_ax5modal_variables.scss
@@ -3,8 +3,44 @@ $ax5modal-z-index: 2000 !default;
$ax5modal-box-model: border-box !default;
$ax5modal-bg: $panel-bg !default;
$ax5modal-border: 1px solid $panel-inner-border !default;
-$ax5modal-box-shaodw: 0px 0px 5px 0px rgba(0, 0, 0, 0.60) !default;
+$ax5modal-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.60) !default;
$ax5modal-body-padding: 0px !default;
+$ax5modal-header-padding: $panel-heading-padding !default;
+
+$ax5modal-header-addon-padding: 10px 10px !default;
+$ax5modal-header-addon-btn-padding: 0px 2px !default;
+
$ax5modal-border-radius: $panel-border-radius !default;
$ax5modal-easing-time-open: 0.3s !default;
-$ax5modal-easing-time-close: 0.3s !default;
\ No newline at end of file
+$ax5modal-easing-time-close: 0.3s !default;
+
+//== modal resizer
+$ax5modal-resizer-bg: #ccc !default;
+$ax5modal-resizer-border: 3px dotted #ff0000 !default;
+$ax5modal-resizer-box-shaodw: 0px 0px 5px 0px rgba(0, 0, 0, 0.60) !default;
+$ax5modal-resizer-opacity : 0.3 !default;
+
+//** Border color for elements within dialog
+$ax5modal-default-text: $panel-default-text !default;
+$ax5modal-default-border: 1px solid $panel-default-border !default;
+$ax5modal-default-header-bg: $panel-default-heading-bg !default;
+
+$ax5modal-primary-text: $panel-primary-text !default;
+$ax5modal-primary-border: 1px solid $panel-primary-border !default;
+$ax5modal-primary-header-bg: $panel-primary-heading-bg !default;
+
+$ax5modal-success-text: $panel-success-text !default;
+$ax5modal-success-border: 1px solid $panel-success-border !default;
+$ax5modal-success-header-bg: $panel-success-heading-bg !default;
+
+$ax5modal-info-text: $panel-info-text !default;
+$ax5modal-info-border: 1px solid $panel-info-border !default;
+$ax5modal-info-header-bg: $panel-info-heading-bg !default;
+
+$ax5modal-warning-text: $panel-warning-text !default;
+$ax5modal-warning-border: 1px solid $panel-warning-border !default;
+$ax5modal-warning-header-bg: $panel-warning-heading-bg !default;
+
+$ax5modal-danger-text: $panel-danger-text !default;
+$ax5modal-danger-border: 1px solid $panel-danger-border !default;
+$ax5modal-danger-header-bg: $panel-danger-heading-bg !default;
\ No newline at end of file
diff --git a/test/index.html b/test/index.html
index e00ecd5..9e627bd 100644
--- a/test/index.html
+++ b/test/index.html
@@ -21,9 +21,32 @@