diff --git a/index.html b/index.html index 4740408..03e9fa1 100644 --- a/index.html +++ b/index.html @@ -5,8 +5,17 @@ + +
+

2048

+ +

Score: 0

+ New Game + + +
@@ -26,7 +35,6 @@
-
2
diff --git a/javascripts/2048.js b/javascripts/2048.js index 4b2746c..4b28e54 100644 --- a/javascripts/2048.js +++ b/javascripts/2048.js @@ -1,36 +1,476 @@ var Game = function() { - // Game logic and initialization here + this.board = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]; + this.score = 0; + this.win = false; }; -Game.prototype.moveTile = function(tile, direction) { +Game.prototype.scoring = function(value) { + this.score += value; + if (value == 2048) { + sweetAlert({ title: "You won!", text: "You won the game!!! Keep playing or click restart to start a new game.", type: "success", confirmButtonText: "I'm the best!" }); + } +}; + +Game.prototype.lost = function() { + //var count = 0; + board = this.board; + //check col + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 4; j++) { + if (board[i][j] === board[i+1][j]) { + return false; + } + } + } + //check row + for (var x = 0; x < 4; x++) { + for (var y = 0; y < 3; y++) { + if (board[x][y] === board[x][y+1]) { + return false; + } + } + } + + sweetAlert({ title: "You lost!", text: "You lost the game. You should try again!", type: "error", confirmButtonText: "Okay" }); +// this.restart(); +}; + + +Game.prototype.randTile = function() { + var arr = []; + self = this; + for(var i = 0; i < 4; i++) { + for(var j = 0; j < 4; j++ ) { + if( this.board[i][j] === 0 ) { + arr.push([i,j]); + } + } + } + //console.log(arr) + //if (arr.length !== 0) { + var randNum = Math.floor((Math.random() * arr.length)); + var i_board = arr[randNum][0]; + var j_board = arr[randNum][1]; + + if (Math.floor((Math.random() * 10) + 1) == 7) { + this.board[i_board][j_board] = 4; + } else { + this.board[i_board][j_board] = 2; + } + var val = this.board[i_board][j_board]; + $('#gameboard').append('
'+ val +'
'); + console.log(arr.length); + if (arr.length <= 1) { + self.lost(); + } + //} + //else {console.log(this.board);} +}; + +Game.prototype.selectTile = function(row, col, value) { + var $tile = $('.tile[data-row="r' + row + '"][data-col="c' + col + '"][data-val="' + value + '"]'); + return $tile; +}; + +Game.prototype.moveTile = function(direction) { // Game method here + var board = this.board; + var self = this; switch(direction) { case 38: //up - console.log('up'); + var countU = self.moveBoardUp(); + self.moveBoardUp(); + setTimeout(function() { + self.collideBoardUp(); + }, 100); + if (countU > 0) { + setTimeout(function() { + self.randTile(); + }, 300); + } break; case 40: //down - console.log('down'); + var countD = self.moveBoardDown(); + self.moveBoardDown(); + setTimeout(function() { + self.collideBoardDown(); + }, 100); + if (countD > 0) { + setTimeout(function() { + self.randTile(); + }, 300); + } break; case 37: //left - console.log('left'); + countL = self.moveBoardLeft(); + self.moveBoardLeft(); + setTimeout(function() { + self.collideBoardLeft(); + }, 100); + if (countL > 0) { + setTimeout(function() { + self.randTile(); + }, 300); + } break; case 39: //right - console.log('right'); + var countR = self.moveBoardRight(); + self.moveBoardRight(); + setTimeout(function() { + self.collideBoardRight(); + }, 100); + if (countR > 0) { + setTimeout(function() { + self.randTile(); + }, 300); + } break; } }; +Game.prototype.moveLeft = function(row,col, count) { + var $tile; + var value = this.board[row][col]; + $tile = $('.tile[data-row="r' + row + '"][data-col="c' + col + '"]'); + if (this.board[row][col] !== 0) { + for(var j=0; j < col; j++) { + if (this.board[row][j] === 0) { + count += 1; + this.board[row][j] = value; + $tile.attr('data-col', 'c' + j); + this.board[row][col] = 0; + break; + } + } + } + return count; +}; + +Game.prototype.moveRight = function(row,col, count) { + var $tile; + var value = this.board[row][col]; + $tile = $('.tile[data-row="r' + row + '"][data-col="c' + col + '"]'); + if (this.board[row][col] !== 0) { + for(var j=3; j > col; j--) { + if (this.board[row][j] === 0) { + count += 1; + this.board[row][j] = value; + $tile.attr('data-col', 'c' + j); + this.board[row][col] = 0; + break; + } + } + } + return count; +}; + +Game.prototype.moveUp = function(row, col, count) { + var $tile; + var value = this.board[row][col]; + $tile = $('.tile[data-row="r' + row + '"][data-col="c' + col + '"]'); + if (this.board[row][col] !== 0) { + for(var i = 0; i < row ; i++) { + if ((this.board[i][col]) === 0) { + count += 1; + this.board[i][col] = value; + $tile.attr('data-row', 'r' + i); + this.board[row][col] = 0; + break; + } + } + } + return count; +}; + +Game.prototype.moveDown = function(row, col, count) { + var $tile; + var value = this.board[row][col]; + $tile = $('.tile[data-row="r' + row + '"][data-col="c' + col + '"]'); + if (this.board[row][col] !== 0) { + for(var i = 3; i > row; i--) { + if ((this.board[i][col]) === 0) { + count += 1; + this.board[i][col] = value; + $tile.attr('data-row', 'r' + i); + this.board[row][col] = 0; + break; + } + } + } + return count; +}; + +Game.prototype.moveBoardLeft = function() { + count = 0; + self = this; + for (var row=0; row < 4; row++) { + for (var col=1; col < 4; col++) { + count += self.moveLeft(row, col, count); + } + } + return count; +}; + +Game.prototype.moveBoardRight = function() { + self = this; + count = 0; + for (var row=0; row < 4; row++) { + for (var col=3; col >= 0; col--) { + count += self.moveRight(row, col, count); + } + } + return count; +}; + +Game.prototype.moveBoardUp = function() { + count = 0; + var self = this; + for (var row = 1; row < 4; row++) { + for (var col = 0; col < 4; col++) { + count += self.moveUp(row, col, count); + } + } + return count; +}; + +Game.prototype.moveBoardDown = function() { + count = 0; + var self = this; + for (var row = 2; row >= 0; row--) { + for (var col = 0; col < 4; col++) { + count+= self.moveDown(row, col, count); + } + } + return count; +}; + +Game.prototype.collideBoardLeft = function() { + self = this; + for (var row = 0; row < 4; row++) { + for (var col = 0; col < 3; col++) { + if ((this.board[row][col] === this.board[row][col+1]) && (this.board[row][col] !== 0)) { + self.collideLeft(row, col); + } + } + } + return this.board; +}; + +Game.prototype.collideBoardRight = function() { + self = this; + for (var row = 0; row < 4; row++) { + for (var col = 3; col >= 1; col--) { + if ((this.board[row][col] === this.board[row][col-1]) && this.board[row][col] !== 0) { + self.collideRight(row, col); + } + } + } + return this.board; +}; + +Game.prototype.collideBoardUp = function() { +var self = this; +var board = this.board; +for (var row = 0; row < 3 ; row++) { + for (var col = 0; col < 4; col++) { + if (( board[row][col] === board[row+1][col]) && (board[row][col] !== 0)) { + self.collideUp(row, col); + } + } +} +return this.board; +}; + +Game.prototype.collideBoardDown = function() { +var self = this; +var board = this.board; +for (var row = 3; row > 0 ; row--) { + for (var col = 0; col < 4; col++) { + if (( board[row][col] === board[row-1][col]) && (board[row][col] !== 0)) { + self.collideDown(row, col); + } + } +} +return this.board; +}; + +Game.prototype.collideLeft = function(row, col) { + self = this; + var value = this.board[row][col]; + var value2 = this.board[row][col+1]; + var $tile1 = self.selectTile(row, col, value); + var $tile2 = self.selectTile(row, col+1, value2); + this.board[row][col] = (value + value2); + this.board[row][col+1] = 0; + $tile2.attr('data-col', 'c' + col); + setTimeout(function() { + //console.log() + $tile1.attr('data-val', self.board[row][col]); + // $tile1.height('5px'); + $tile1.html(self.board[row][col]); + // $tile1.animate({width: '4rem', height: '4rem'}, "fast"); + $tile2.remove(); + self.scoring(self.board[row][col]); + $("#score").html("Score: " + self.score); + }, 100); + switch(col) { + case 0: + $tile3 = self.selectTile(row, 2, this.board[row][2]); + $tile4 = self.selectTile(row, 3, this.board[row][3]); + $tile3.attr('data-col', 'c' + 1); + $tile4.attr('data-col', 'c' + 2); + this.board[row][1] = this.board[row][2]; + this.board[row][2] = this.board[row][3]; + this.board[row][3] = 0; + break; + case 1: + $tile5 = self.selectTile(row, 3, this.board[row][3]); + $tile5.attr('data-col', 'c' + 2); + this.board[row][2] = this.board[row][3]; + this.board[row][3] = 0; + break; + } + return this.board; +}; + +Game.prototype.collideRight = function(row, col) { + self = this; + var value = this.board[row][col]; + var value2 = this.board[row][col-1]; + var $tile1 = self.selectTile(row, col, value); + var $tile2 = self.selectTile(row, col-1, value2); + this.board[row][col] = (value + value2); + this.board[row][col-1] = 0; + $tile2.attr('data-col', 'c' + col); + setTimeout(function() { + $tile1.attr('data-val', self.board[row][col]); + $tile1.html(self.board[row][col]); + $tile2.remove(); + self.scoring(self.board[row][col]); + $("#score").html("Score: " + self.score); + }, 100); + switch(col) { + case 3: + $tile3 = self.selectTile(row, 1, this.board[row][1]); + $tile4 = self.selectTile(row, 0, this.board[row][0]); + $tile3.attr('data-col', 'c' + 2); + $tile4.attr('data-col', 'c' + 1); + this.board[row][2] = this.board[row][1]; + this.board[row][1] = this.board[row][0]; + this.board[row][0] = 0; + break; + case 2: + $tile5 = self.selectTile(row, 0, this.board[row][0]); + $tile5.attr('data-col', 'c' + 1); + this.board[row][1] = this.board[row][0]; + this.board[row][0] = 0; + break; + } + return this.board; +}; + +Game.prototype.collideUp = function(row, col) { + var self = this; + var value = this.board[row][col]; + var value2 = this.board[row+1][col]; + var $tile1 = self.selectTile(row, col, value); + var $tile2 = self.selectTile(row+1, col, value2); + this.board[row][col] = (value + value2); + this.board[row+1][col] = 0; + $tile2.attr('data-row', 'r' + row); + setTimeout(function() { + $tile1.attr('data-val', self.board[row][col]); + $tile1.html(self.board[row][col]); + $tile2.remove(); + self.scoring(self.board[row][col]); + $("#score").html("Score: " + self.score); + }, 100); + + switch(row) { + case 0: + var $tile3 = self.selectTile(2, col, this.board[2][col]); + var $tile4 = self.selectTile(3, col, this.board[3][col]); + $tile3.attr('data-row', 'r' + 1); + $tile4.attr('data-row', 'r' + 2); + this.board[1][col] = this.board[2][col]; + this.board[2][col] = this.board[3][col]; + this.board[3][col] = 0; + + break; + case 1: + var $tile5 = self.selectTile(3, col, this.board[3][col]); + $tile5.attr('data-row', 'r' + 2); + this.board[2][col] = this.board[3][col]; + this.board[3][col] = 0; + break; + } + return this.board; +}; + +Game.prototype.collideDown = function(row, col) { + var self = this; + var value = this.board[row][col]; + var value2 = this.board[row-1][col]; + var $tile1 = self.selectTile(row, col, value); + var $tile2 = self.selectTile(row-1, col, value2); + this.board[row][col] = (value + value2); + this.board[row-1][col] = 0; + $tile2.attr('data-row', 'r' + row); + setTimeout(function() { + $tile1.attr('data-val', self.board[row][col]); + $tile1.html(self.board[row][col]); + $tile2.remove(); + self.scoring(self.board[row][col]); + $("#score").html("Score: " + self.score); + }, 100); + + switch(row) { + case 3: + var $tile3 = self.selectTile(1, col, this.board[1][col]); + var $tile4 = self.selectTile(0, col, this.board[0][col]); + $tile3.attr('data-row', 'r' + 2); + $tile4.attr('data-row', 'r' + 1); + this.board[2][col] = this.board[1][col]; + this.board[1][col] = this.board[0][col]; + this.board[0][col] = 0; + break; + case 2: + var $tile5 = self.selectTile(0, col, this.board[0][col]); + $tile5.attr('data-row', 'r' + 1); + this.board[1][col] = this.board[0][col]; + this.board[0][col] = 0; + break; + } + return this.board; +}; + +Game.prototype.restart = function() { + this.board = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]; + this.score = 0; + this.win = false; + $("#score").html("Score: " + self.score); + $(".tile").remove(); + this.randTile(); + this.randTile(); +}; + + + $(document).ready(function() { - console.log("ready to go!"); - // Any interactive jQuery functionality var game = new Game(); + game.randTile(); + game.randTile(); + //$("#score").html(this.score); $('body').keydown(function(event){ var arrows = [37, 38, 39, 40]; if (arrows.indexOf(event.which) > -1) { - var tile = $('.tile'); - - game.moveTile(tile, event.which); + game.moveTile(event.which); } }); + + $('#restart').click(function() { + game.restart(); + console.log(game.board); + }); }); diff --git a/node_modules/sweetalert/.editorconfig b/node_modules/sweetalert/.editorconfig new file mode 100644 index 0000000..f29d257 --- /dev/null +++ b/node_modules/sweetalert/.editorconfig @@ -0,0 +1,11 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/node_modules/sweetalert/.jshintrc b/node_modules/sweetalert/.jshintrc new file mode 100644 index 0000000..f6dd383 --- /dev/null +++ b/node_modules/sweetalert/.jshintrc @@ -0,0 +1,11 @@ +{ + "predef": [ + "document", + "window", + "module", + "define" + ], + "browser": true, + "esnext": true, + "validthis": true +} diff --git a/node_modules/sweetalert/.npmignore b/node_modules/sweetalert/.npmignore new file mode 100644 index 0000000..84bfeb2 --- /dev/null +++ b/node_modules/sweetalert/.npmignore @@ -0,0 +1,5 @@ +*.codekit +*.sass-cache +*.DS_STORE +node_modules +bower_components diff --git a/node_modules/sweetalert/.travis.yml b/node_modules/sweetalert/.travis.yml new file mode 100644 index 0000000..46614b6 --- /dev/null +++ b/node_modules/sweetalert/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.12" +before script: + - npm install -g gulp + - npm install -g bower + - bower install +script: gulp test diff --git a/node_modules/sweetalert/LICENSE b/node_modules/sweetalert/LICENSE new file mode 100644 index 0000000..2d4ac32 --- /dev/null +++ b/node_modules/sweetalert/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Tristan Edwards + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/sweetalert/README.md b/node_modules/sweetalert/README.md new file mode 100644 index 0000000..f03a952 --- /dev/null +++ b/node_modules/sweetalert/README.md @@ -0,0 +1,157 @@ +SweetAlert [![Build Status](https://travis-ci.org/t4t5/sweetalert.svg?branch=master)](https://travis-ci.org/t4t5/sweetalert) +========== + +An awesome replacement for JavaScript's alert. + +![A success modal](https://raw.github.com/t4t5/sweetalert/master/sweetalert.gif) + +[See it in action!](http://t4t5.github.io/sweetalert) + +[Learn how to use it!](https://www.ludu.co/lesson/how-to-use-sweetalert) + + +Usage +----- + +You can install SweetAlert through bower: + +```bash +bower install sweetalert +``` + +Or through npm: + +```bash +npm install sweetalert +``` + +Alternatively, download the package and reference the JavaScript and CSS files manually: + +```html + + +``` +**Note:** If you're using an older version than v1.0.0, the files are `lib/sweet-alert.min.js` and `lib/sweet-alert.css` + + +Tutorial +-------- + +The easiest way to get started is follow the [SweetAlert tutorial on Ludu](https://www.ludu.co/lesson/how-to-use-sweetalert)! + + +Examples +-------- + +The most basic message: + +```javascript +swal("Hello world!"); +``` + +A message signaling an error: + +```javascript +swal("Oops...", "Something went wrong!", "error"); +``` + +A warning message, with a function attached to the "Confirm"-button: + +```javascript +swal({ + title: "Are you sure?", + text: "You will not be able to recover this imaginary file!", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#DD6B55", + confirmButtonText: "Yes, delete it!", + closeOnConfirm: false, + html: false +}, function(){ + swal("Deleted!", + "Your imaginary file has been deleted.", + "success"); +}); +``` + +A prompt modal where the user's input is logged: + +```javascript +swal({ + title: "An input!", + text: 'Write something interesting:', + type: 'input', + showCancelButton: true, + closeOnConfirm: false, + animation: "slide-from-top" +}, function(inputValue){ + console.log("You wrote", inputValue); +}); +``` + +Ajax request example: + +```javascript +swal({ + title: 'Ajax request example', + text: 'Submit to run ajax request', + type: 'info', + showCancelButton: true, + closeOnConfirm: false, + disableButtonsOnConfirm: true, + confirmLoadingButtonColor: '#DD6B55' +}, function(inputValue){ + setTimeout(function() { + swal('Ajax request finished!'); + }, 2000); +}); +``` + +[View more examples](http://t4t5.github.io/sweetalert) + + +Themes +------ + +SweetAlert can easily be themed to fit your site's design. SweetAlert comes with three example themes that you can try out: **facebook**, **twitter** and **google**. They can be referenced right after the intial sweetalert-CSS: +```html + + +``` + + +Browser compatibility +--------------------- + +SweetAlert works in most major browsers (yes, even IE). Some details: + +- **IE8**: (Dropped since v1.0.0-beta) +- **IE9**: Works, but icons are not animated. +- **IE10+**: Works! +- **Safari 4+**: Works! +- **Firefox 3+**: Works! +- **Chrome 14+**: Works! +- **Opera 15+**: Works! + + +Contributing +------------ + +If you want to contribute: + +- Fork the repo + +- Make sure you have [Node](http://nodejs.org/), [NPM](https://www.npmjs.com/) and [Gulp](http://gulpjs.com/) installed. When in the SweetAlert directory, run `npm install` to install the dependencies. Then run `gulp` while working to automatically minify the SCSS and JS-files. + +- Keep in mind that SweetAlert uses Browserify in order to compile ES6-files. For easy debugging, make sure you reference the file `dist/sweetalert-dev.js` instead of `sweetalert.js`. + +- After you're done, make a pull request and wait for approval! :) + + +Related projects +---------------- + +* [SweetAlert for Android](https://github.com/pedant/sweet-alert-dialog) +* [SweetAlert for Bootstrap](https://github.com/lipis/bootstrap-sweetalert) +* [SweetAlert for AngularJS](https://github.com/oitozero/ngSweetAlert) +* [SweetAlert for RubyOnRails](https://github.com/sharshenov/sweetalert-rails) diff --git a/node_modules/sweetalert/bower.json b/node_modules/sweetalert/bower.json new file mode 100644 index 0000000..019653c --- /dev/null +++ b/node_modules/sweetalert/bower.json @@ -0,0 +1,25 @@ +{ + "name": "sweetalert", + "homepage": "http://tristanedwards.me/sweetalert", + "authors": [ + "Tristan Edwards (http://tristanedwards.me)" + ], + "description": "A beautiful replacement for JavaScript's alert.", + "main": [ + "dist/sweetalert.min.js", + "dist/sweetalert.css" + ], + "keywords": [ + "alert", + "modal" + ], + "repository": { + "type": "git", + "url": "git@github.com:t4t5/sweetalert.git" + }, + "license": "MIT", + "devDependencies": { + "qunit": "~1.18.0", + "jquery": "~2.1.4" + } +} diff --git a/node_modules/sweetalert/dev/gulpfile-wrap-template.js b/node_modules/sweetalert/dev/gulpfile-wrap-template.js new file mode 100644 index 0000000..5522acd --- /dev/null +++ b/node_modules/sweetalert/dev/gulpfile-wrap-template.js @@ -0,0 +1,18 @@ +;(function(window, document, undefined) { + "use strict"; + + <%= contents %> + + /* + * Use SweetAlert with RequireJS + */ + + if (typeof define === 'function' && define.amd) { + define(function () { + return sweetAlert; + }); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = sweetAlert; + } + +})(window, document); \ No newline at end of file diff --git a/node_modules/sweetalert/dev/ie9.css b/node_modules/sweetalert/dev/ie9.css new file mode 100644 index 0000000..6524fba --- /dev/null +++ b/node_modules/sweetalert/dev/ie9.css @@ -0,0 +1,23 @@ +/* Internet Explorer 9 has some special quirks that are fixed here */ +/* The icons are not animated. */ +/* This file is automatically merged into sweet-alert.min.js through Gulp */ + +/* Error icon */ +.sweet-alert .sa-icon.sa-error .sa-line.sa-left { + -ms-transform: rotate(45deg)\9; +} +.sweet-alert .sa-icon.sa-error .sa-line.sa-right { + -ms-transform: rotate(-45deg)\9; +} + + +/* Success icon */ +.sweet-alert .sa-icon.sa-success { + border-color: transparent\9; +} +.sweet-alert .sa-icon.sa-success .sa-line.sa-tip { + -ms-transform: rotate(45deg)\9; +} +.sweet-alert .sa-icon.sa-success .sa-line.sa-long { + -ms-transform: rotate(-45deg)\9; +} \ No newline at end of file diff --git a/node_modules/sweetalert/dev/loader-animation.css b/node_modules/sweetalert/dev/loader-animation.css new file mode 100644 index 0000000..2855635 --- /dev/null +++ b/node_modules/sweetalert/dev/loader-animation.css @@ -0,0 +1,209 @@ +/*! + * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/) + * Copyright 2015 Daniel Cardoso <@DanielCardoso> + * Licensed under MIT + */ +.la-ball-fall, +.la-ball-fall > div { +position: relative; +-webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.la-ball-fall { + display: block; + font-size: 0; + color: #fff; +} +.la-ball-fall.la-dark { + color: #333; +} +.la-ball-fall > div { + display: inline-block; + float: none; + background-color: currentColor; + border: 0 solid currentColor; +} +.la-ball-fall { + width: 54px; + height: 18px; +} +.la-ball-fall > div { + width: 10px; + height: 10px; + margin: 4px; + border-radius: 100%; + opacity: 0; + -webkit-animation: ball-fall 1s ease-in-out infinite; + -moz-animation: ball-fall 1s ease-in-out infinite; + -o-animation: ball-fall 1s ease-in-out infinite; + animation: ball-fall 1s ease-in-out infinite; +} +.la-ball-fall > div:nth-child(1) { + -webkit-animation-delay: -200ms; + -moz-animation-delay: -200ms; + -o-animation-delay: -200ms; + animation-delay: -200ms; +} +.la-ball-fall > div:nth-child(2) { + -webkit-animation-delay: -100ms; + -moz-animation-delay: -100ms; + -o-animation-delay: -100ms; + animation-delay: -100ms; +} +.la-ball-fall > div:nth-child(3) { + -webkit-animation-delay: 0ms; + -moz-animation-delay: 0ms; + -o-animation-delay: 0ms; + animation-delay: 0ms; +} +.la-ball-fall.la-sm { + width: 26px; + height: 8px; +} +.la-ball-fall.la-sm > div { + width: 4px; + height: 4px; + margin: 2px; +} +.la-ball-fall.la-2x { + width: 108px; + height: 36px; +} +.la-ball-fall.la-2x > div { + width: 20px; + height: 20px; + margin: 8px; +} +.la-ball-fall.la-3x { + width: 162px; + height: 54px; +} +.la-ball-fall.la-3x > div { + width: 30px; + height: 30px; + margin: 12px; +} +/* + * Animation + */ +@-webkit-keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + transform: translateY(-145%); + } + 10% { + opacity: .5; + } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); + } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); + } + 90% { + opacity: .5; + } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + transform: translateY(145%); + } +} +@-moz-keyframes ball-fall { + 0% { + opacity: 0; + -moz-transform: translateY(-145%); + transform: translateY(-145%); + } + 10% { + opacity: .5; + } + 20% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); + } + 80% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); + } + 90% { + opacity: .5; + } + 100% { + opacity: 0; + -moz-transform: translateY(145%); + transform: translateY(145%); + } +} +@-o-keyframes ball-fall { + 0% { + opacity: 0; + -o-transform: translateY(-145%); + transform: translateY(-145%); + } + 10% { + opacity: .5; + } + 20% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); + } + 80% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); + } + 90% { + opacity: .5; + } + 100% { + opacity: 0; + -o-transform: translateY(145%); + transform: translateY(145%); + } +} +@keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + -moz-transform: translateY(-145%); + -o-transform: translateY(-145%); + transform: translateY(-145%); + } + 10% { + opacity: .5; + } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); + } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); + } + 90% { + opacity: .5; + } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + -moz-transform: translateY(145%); + -o-transform: translateY(145%); + transform: translateY(145%); + } +} diff --git a/node_modules/sweetalert/dev/modules/default-params.js b/node_modules/sweetalert/dev/modules/default-params.js new file mode 100644 index 0000000..a919acd --- /dev/null +++ b/node_modules/sweetalert/dev/modules/default-params.js @@ -0,0 +1,26 @@ +var defaultParams = { + title: '', + text: '', + type: null, + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + closeOnConfirm: true, + closeOnCancel: true, + confirmButtonText: 'OK', + confirmButtonColor: '#8CD4F5', + cancelButtonText: 'Cancel', + imageUrl: null, + imageSize: null, + timer: null, + customClass: '', + html: false, + animation: true, + allowEscapeKey: true, + inputType: 'text', + inputPlaceholder: '', + inputValue: '', + showLoaderOnConfirm: false +}; + +export default defaultParams; diff --git a/node_modules/sweetalert/dev/modules/handle-click.js b/node_modules/sweetalert/dev/modules/handle-click.js new file mode 100644 index 0000000..b303237 --- /dev/null +++ b/node_modules/sweetalert/dev/modules/handle-click.js @@ -0,0 +1,128 @@ +import { colorLuminance } from './utils'; +import { getModal } from './handle-swal-dom'; +import { hasClass, isDescendant } from './handle-dom'; + + +/* + * User clicked on "Confirm"/"OK" or "Cancel" + */ +var handleButton = function(event, params, modal) { + var e = event || window.event; + var target = e.target || e.srcElement; + + var targetedConfirm = target.className.indexOf('confirm') !== -1; + var targetedOverlay = target.className.indexOf('sweet-overlay') !== -1; + var modalIsVisible = hasClass(modal, 'visible'); + var doneFunctionExists = (params.doneFunction && modal.getAttribute('data-has-done-function') === 'true'); + + // Since the user can change the background-color of the confirm button programmatically, + // we must calculate what the color should be on hover/active + var normalColor, hoverColor, activeColor; + if (targetedConfirm && params.confirmButtonColor) { + normalColor = params.confirmButtonColor; + hoverColor = colorLuminance(normalColor, -0.04); + activeColor = colorLuminance(normalColor, -0.14); + } + + function shouldSetConfirmButtonColor(color) { + if (targetedConfirm && params.confirmButtonColor) { + target.style.backgroundColor = color; + } + } + + switch (e.type) { + case 'mouseover': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'mouseout': + shouldSetConfirmButtonColor(normalColor); + break; + + case 'mousedown': + shouldSetConfirmButtonColor(activeColor); + break; + + case 'mouseup': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'focus': + let $confirmButton = modal.querySelector('button.confirm'); + let $cancelButton = modal.querySelector('button.cancel'); + + if (targetedConfirm) { + $cancelButton.style.boxShadow = 'none'; + } else { + $confirmButton.style.boxShadow = 'none'; + } + break; + + case 'click': + let clickedOnModal = (modal === target); + let clickedOnModalChild = isDescendant(modal, target); + + // Ignore click outside if allowOutsideClick is false + if (!clickedOnModal && !clickedOnModalChild && modalIsVisible && !params.allowOutsideClick) { + break; + } + + if (targetedConfirm && doneFunctionExists && modalIsVisible) { + handleConfirm(modal, params); + } else if (doneFunctionExists && modalIsVisible || targetedOverlay) { + handleCancel(modal, params); + } else if (isDescendant(modal, target) && target.tagName === 'BUTTON') { + sweetAlert.close(); + } + break; + } +}; + +/* + * User clicked on "Confirm"/"OK" + */ +var handleConfirm = function(modal, params) { + var callbackValue = true; + + if (hasClass(modal, 'show-input')) { + callbackValue = modal.querySelector('input').value; + + if (!callbackValue) { + callbackValue = ''; + } + } + + params.doneFunction(callbackValue); + + if (params.closeOnConfirm) { + sweetAlert.close(); + } + // Disable cancel and confirm button if the parameter is true + if (params.showLoaderOnConfirm) { + sweetAlert.disableButtons(); + } +}; + +/* + * User clicked on "Cancel" + */ +var handleCancel = function(modal, params) { + // Check if callback function expects a parameter (to track cancel actions) + var functionAsStr = String(params.doneFunction).replace(/\s/g, ''); + var functionHandlesCancel = functionAsStr.substring(0, 9) === 'function(' && functionAsStr.substring(9, 10) !== ')'; + + if (functionHandlesCancel) { + params.doneFunction(false); + } + + if (params.closeOnCancel) { + sweetAlert.close(); + } +}; + + +export default { + handleButton, + handleConfirm, + handleCancel +}; diff --git a/node_modules/sweetalert/dev/modules/handle-dom.js b/node_modules/sweetalert/dev/modules/handle-dom.js new file mode 100644 index 0000000..bd31c6e --- /dev/null +++ b/node_modules/sweetalert/dev/modules/handle-dom.js @@ -0,0 +1,161 @@ +var hasClass = function(elem, className) { + return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); +}; + +var addClass = function(elem, className) { + if (!hasClass(elem, className)) { + elem.className += ' ' + className; + } +}; + +var removeClass = function(elem, className) { + var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; + if (hasClass(elem, className)) { + while (newClass.indexOf(' ' + className + ' ') >= 0) { + newClass = newClass.replace(' ' + className + ' ', ' '); + } + elem.className = newClass.replace(/^\s+|\s+$/g, ''); + } +}; + +var escapeHtml = function(str) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; +}; + +var _show = function(elem) { + elem.style.opacity = ''; + elem.style.display = 'block'; +}; + +var show = function(elems) { + if (elems && !elems.length) { + return _show(elems); + } + for (var i = 0; i < elems.length; ++i) { + _show(elems[i]); + } +}; + +var _hide = function(elem) { + elem.style.opacity = ''; + elem.style.display = 'none'; +}; + +var hide = function(elems) { + if (elems && !elems.length) { + return _hide(elems); + } + for (var i = 0; i < elems.length; ++i) { + _hide(elems[i]); + } +}; + +var isDescendant = function(parent, child) { + var node = child.parentNode; + while (node !== null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; +}; + +var getTopMargin = function(elem) { + elem.style.left = '-9999px'; + elem.style.display = 'block'; + + var height = elem.clientHeight, + padding; + if (typeof getComputedStyle !== "undefined") { // IE 8 + padding = parseInt(getComputedStyle(elem).getPropertyValue('padding-top'), 10); + } else { + padding = parseInt(elem.currentStyle.padding); + } + + elem.style.left = ''; + elem.style.display = 'none'; + return ('-' + parseInt((height + padding) / 2) + 'px'); +}; + +var fadeIn = function(elem, interval) { + if (+elem.style.opacity < 1) { + interval = interval || 16; + elem.style.opacity = 0; + elem.style.display = 'block'; + var last = +new Date(); + var tick = function() { + elem.style.opacity = +elem.style.opacity + (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity < 1) { + setTimeout(tick, interval); + } + }; + tick(); + } + elem.style.display = 'block'; //fallback IE8 +}; + +var fadeOut = function(elem, interval) { + interval = interval || 16; + elem.style.opacity = 1; + var last = +new Date(); + var tick = function() { + elem.style.opacity = +elem.style.opacity - (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity > 0) { + setTimeout(tick, interval); + } else { + elem.style.display = 'none'; + } + }; + tick(); +}; + +var fireClick = function(node) { + // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/ + // Then fixed for today's Chrome browser. + if (typeof MouseEvent === 'function') { + // Up-to-date approach + var mevt = new MouseEvent('click', { + view: window, + bubbles: false, + cancelable: true + }); + node.dispatchEvent(mevt); + } else if ( document.createEvent ) { + // Fallback + var evt = document.createEvent('MouseEvents'); + evt.initEvent('click', false, false); + node.dispatchEvent(evt); + } else if (document.createEventObject) { + node.fireEvent('onclick') ; + } else if (typeof node.onclick === 'function' ) { + node.onclick(); + } +}; + +var stopEventPropagation = function(e) { + // In particular, make sure the space bar doesn't scroll the main window. + if (typeof e.stopPropagation === 'function') { + e.stopPropagation(); + e.preventDefault(); + } else if (window.event && window.event.hasOwnProperty('cancelBubble')) { + window.event.cancelBubble = true; + } +}; + +export { + hasClass, addClass, removeClass, + escapeHtml, + _show, show, _hide, hide, + isDescendant, + getTopMargin, + fadeIn, fadeOut, + fireClick, + stopEventPropagation +}; diff --git a/node_modules/sweetalert/dev/modules/handle-key.js b/node_modules/sweetalert/dev/modules/handle-key.js new file mode 100644 index 0000000..b6cc75c --- /dev/null +++ b/node_modules/sweetalert/dev/modules/handle-key.js @@ -0,0 +1,73 @@ +import { stopEventPropagation, fireClick } from './handle-dom'; +import { setFocusStyle } from './handle-swal-dom'; + + +var handleKeyDown = function(event, params, modal) { + var e = event || window.event; + var keyCode = e.keyCode || e.which; + + var $okButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + var $modalButtons = modal.querySelectorAll('button[tabindex]'); + + + if ([9, 13, 32, 27].indexOf(keyCode) === -1) { + // Don't do work on keys we don't care about. + return; + } + + var $targetElement = e.target || e.srcElement; + + var btnIndex = -1; // Find the button - note, this is a nodelist, not an array. + for (var i = 0; i < $modalButtons.length; i++) { + if ($targetElement === $modalButtons[i]) { + btnIndex = i; + break; + } + } + + if (keyCode === 9) { + // TAB + if (btnIndex === -1) { + // No button focused. Jump to the confirm button. + $targetElement = $okButton; + } else { + // Cycle to the next button + if (btnIndex === $modalButtons.length - 1) { + $targetElement = $modalButtons[0]; + } else { + $targetElement = $modalButtons[btnIndex + 1]; + } + } + + stopEventPropagation(e); + $targetElement.focus(); + + if (params.confirmButtonColor) { + setFocusStyle($targetElement, params.confirmButtonColor); + } + } else { + if (keyCode === 13) { + if ($targetElement.tagName === 'INPUT') { + $targetElement = $okButton; + $okButton.focus(); + } + + if (btnIndex === -1) { + // ENTER/SPACE clicked outside of a button. + $targetElement = $okButton; + } else { + // Do nothing - let the browser handle it. + $targetElement = undefined; + } + } else if (keyCode === 27 && params.allowEscapeKey === true) { + $targetElement = $cancelButton; + fireClick($targetElement, e); + } else { + // Fallback - let the browser handle it. + $targetElement = undefined; + } + } +}; + +export default handleKeyDown; diff --git a/node_modules/sweetalert/dev/modules/handle-swal-dom.js b/node_modules/sweetalert/dev/modules/handle-swal-dom.js new file mode 100644 index 0000000..ac148ea --- /dev/null +++ b/node_modules/sweetalert/dev/modules/handle-swal-dom.js @@ -0,0 +1,148 @@ +import { hexToRgb } from './utils'; +import { removeClass, getTopMargin, fadeIn, show, addClass } from './handle-dom'; +import defaultParams from './default-params'; + +var modalClass = '.sweet-alert'; +var overlayClass = '.sweet-overlay'; + +/* + * Add modal + overlay to DOM + */ +import injectedHTML from './injected-html'; + +var sweetAlertInitialize = function() { + var sweetWrap = document.createElement('div'); + sweetWrap.innerHTML = injectedHTML; + + // Append elements to body + while (sweetWrap.firstChild) { + document.body.appendChild(sweetWrap.firstChild); + } +}; + +/* + * Get DOM element of modal + */ +var getModal = function() { + var $modal = document.querySelector(modalClass); + + if (!$modal) { + sweetAlertInitialize(); + $modal = getModal(); + } + + return $modal; +}; + +/* + * Get DOM element of input (in modal) + */ +var getInput = function() { + var $modal = getModal(); + if ($modal) { + return $modal.querySelector('input'); + } +}; + +/* + * Get DOM element of overlay + */ +var getOverlay = function() { + return document.querySelector(overlayClass); +}; + +/* + * Add box-shadow style to button (depending on its chosen bg-color) + */ +var setFocusStyle = function($button, bgColor) { + var rgbColor = hexToRgb(bgColor); + $button.style.boxShadow = '0 0 2px rgba(' + rgbColor + ', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)'; +}; + +/* + * Animation when opening modal + */ +var openModal = function(callback) { + var $modal = getModal(); + fadeIn(getOverlay(), 10); + show($modal); + addClass($modal, 'showSweetAlert'); + removeClass($modal, 'hideSweetAlert'); + + window.previousActiveElement = document.activeElement; + var $okButton = $modal.querySelector('button.confirm'); + $okButton.focus(); + + setTimeout(function () { + addClass($modal, 'visible'); + }, 500); + + var timer = $modal.getAttribute('data-timer'); + + if (timer !== 'null' && timer !== '') { + var timerCallback = callback; + $modal.timeout = setTimeout(function() { + var doneFunctionExists = ((timerCallback || null) && $modal.getAttribute('data-has-done-function') === 'true'); + if (doneFunctionExists) { + timerCallback(null); + } + else { + sweetAlert.close(); + } + }, timer); + } +}; + +/* + * Reset the styling of the input + * (for example if errors have been shown) + */ +var resetInput = function() { + var $modal = getModal(); + var $input = getInput(); + + removeClass($modal, 'show-input'); + $input.value = defaultParams.inputValue; + $input.setAttribute('type', defaultParams.inputType); + $input.setAttribute('placeholder', defaultParams.inputPlaceholder); + + resetInputError(); +}; + + +var resetInputError = function(event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + removeClass($errorContainer, 'show'); +}; + + +/* + * Set "margin-top"-property on modal based on its computed height + */ +var fixVerticalPosition = function() { + var $modal = getModal(); + $modal.style.marginTop = getTopMargin(getModal()); +}; + + +export { + sweetAlertInitialize, + getModal, + getOverlay, + getInput, + setFocusStyle, + openModal, + resetInput, + resetInputError, + fixVerticalPosition +}; diff --git a/node_modules/sweetalert/dev/modules/injected-html.js b/node_modules/sweetalert/dev/modules/injected-html.js new file mode 100644 index 0000000..b0776fc --- /dev/null +++ b/node_modules/sweetalert/dev/modules/injected-html.js @@ -0,0 +1,69 @@ +var injectedHTML = + + // Dark overlay + `
` + + + // Modal + `
` + + + // Error icon + `
+ + + + +
` + + + // Warning icon + `
+ + +
` + + + // Info icon + `
` + + + // Success icon + `
+ + + +
+
+
` + + + `
` + + + // Title, text and input + `

Title

+

Text

+
+ +
+
` + + + // Input errors + `
+
!
+

Not valid!

+
` + + + // Cancel and confirm buttons + `
+ +
+ ` + + + // Loading animation + `
+
+
+
+
+
+
` + + + // End of modal + `
`; + +export default injectedHTML; diff --git a/node_modules/sweetalert/dev/modules/set-params.js b/node_modules/sweetalert/dev/modules/set-params.js new file mode 100644 index 0000000..b3a797b --- /dev/null +++ b/node_modules/sweetalert/dev/modules/set-params.js @@ -0,0 +1,221 @@ +var alertTypes = ['error', 'warning', 'info', 'success', 'input', 'prompt']; + +import { + isIE8 +} from './utils'; + +import { + getModal, + getInput, + setFocusStyle +} from './handle-swal-dom'; + +import { + hasClass, addClass, removeClass, + escapeHtml, + _show, show, _hide, hide +} from './handle-dom'; + + +/* + * Set type, text and actions on modal + */ +var setParameters = function(params) { + var modal = getModal(); + + var $title = modal.querySelector('h2'); + var $text = modal.querySelector('p'); + var $cancelBtn = modal.querySelector('button.cancel'); + var $confirmBtn = modal.querySelector('button.confirm'); + + /* + * Title + */ + $title.innerHTML = params.html ? params.title : escapeHtml(params.title).split('\n').join('
'); + + /* + * Text + */ + $text.innerHTML = params.html ? params.text : escapeHtml(params.text || '').split('\n').join('
'); + if (params.text) show($text); + + /* + * Custom class + */ + if (params.customClass) { + addClass(modal, params.customClass); + modal.setAttribute('data-custom-class', params.customClass); + } else { + // Find previously set classes and remove them + let customClass = modal.getAttribute('data-custom-class'); + removeClass(modal, customClass); + modal.setAttribute('data-custom-class', ''); + } + + /* + * Icon + */ + hide(modal.querySelectorAll('.sa-icon')); + + if (params.type && !isIE8()) { + + let validType = false; + + for (let i = 0; i < alertTypes.length; i++) { + if (params.type === alertTypes[i]) { + validType = true; + break; + } + } + + if (!validType) { + logStr('Unknown alert type: ' + params.type); + return false; + } + + let typesWithIcons = ['success', 'error', 'warning', 'info']; + let $icon; + + if (typesWithIcons.indexOf(params.type) !== -1) { + $icon = modal.querySelector('.sa-icon.' + 'sa-' + params.type); + show($icon); + } + + let $input = getInput(); + + // Animate icon + switch (params.type) { + + case 'success': + addClass($icon, 'animate'); + addClass($icon.querySelector('.sa-tip'), 'animateSuccessTip'); + addClass($icon.querySelector('.sa-long'), 'animateSuccessLong'); + break; + + case 'error': + addClass($icon, 'animateErrorIcon'); + addClass($icon.querySelector('.sa-x-mark'), 'animateXMark'); + break; + + case 'warning': + addClass($icon, 'pulseWarning'); + addClass($icon.querySelector('.sa-body'), 'pulseWarningIns'); + addClass($icon.querySelector('.sa-dot'), 'pulseWarningIns'); + break; + + case 'input': + case 'prompt': + $input.setAttribute('type', params.inputType); + $input.value = params.inputValue; + $input.setAttribute('placeholder', params.inputPlaceholder); + addClass(modal, 'show-input'); + setTimeout(function () { + $input.focus(); + $input.addEventListener('keyup', swal.resetInputError); + }, 400); + break; + } + } + + /* + * Custom image + */ + if (params.imageUrl) { + let $customIcon = modal.querySelector('.sa-icon.sa-custom'); + + $customIcon.style.backgroundImage = 'url(' + params.imageUrl + ')'; + show($customIcon); + + let _imgWidth = 80; + let _imgHeight = 80; + + if (params.imageSize) { + let dimensions = params.imageSize.toString().split('x'); + let imgWidth = dimensions[0]; + let imgHeight = dimensions[1]; + + if (!imgWidth || !imgHeight) { + logStr('Parameter imageSize expects value with format WIDTHxHEIGHT, got ' + params.imageSize); + } else { + _imgWidth = imgWidth; + _imgHeight = imgHeight; + } + } + + $customIcon.setAttribute('style', $customIcon.getAttribute('style') + 'width:' + _imgWidth + 'px; height:' + _imgHeight + 'px'); + } + + /* + * Show cancel button? + */ + modal.setAttribute('data-has-cancel-button', params.showCancelButton); + if (params.showCancelButton) { + $cancelBtn.style.display = 'inline-block'; + } else { + hide($cancelBtn); + } + + /* + * Show confirm button? + */ + modal.setAttribute('data-has-confirm-button', params.showConfirmButton); + if (params.showConfirmButton) { + $confirmBtn.style.display = 'inline-block'; + } else { + hide($confirmBtn); + } + + /* + * Custom text on cancel/confirm buttons + */ + if (params.cancelButtonText) { + $cancelBtn.innerHTML = escapeHtml(params.cancelButtonText); + } + if (params.confirmButtonText) { + $confirmBtn.innerHTML = escapeHtml(params.confirmButtonText); + } + + /* + * Custom color on confirm button + */ + if (params.confirmButtonColor) { + // Set confirm button to selected background color + $confirmBtn.style.backgroundColor = params.confirmButtonColor; + + // Set the confirm button color to the loading ring + $confirmBtn.style.borderLeftColor = params.confirmLoadingButtonColor; + $confirmBtn.style.borderRightColor = params.confirmLoadingButtonColor; + + // Set box-shadow to default focused button + setFocusStyle($confirmBtn, params.confirmButtonColor); + } + + /* + * Allow outside click + */ + modal.setAttribute('data-allow-outside-click', params.allowOutsideClick); + + /* + * Callback function + */ + var hasDoneFunction = params.doneFunction ? true : false; + modal.setAttribute('data-has-done-function', hasDoneFunction); + + /* + * Animation + */ + if (!params.animation) { + modal.setAttribute('data-animation', 'none'); + } else if (typeof params.animation === 'string') { + modal.setAttribute('data-animation', params.animation); // Custom animation + } else { + modal.setAttribute('data-animation', 'pop'); + } + + /* + * Timer + */ + modal.setAttribute('data-timer', params.timer); +}; + +export default setParameters; diff --git a/node_modules/sweetalert/dev/modules/utils.js b/node_modules/sweetalert/dev/modules/utils.js new file mode 100644 index 0000000..ce6944e --- /dev/null +++ b/node_modules/sweetalert/dev/modules/utils.js @@ -0,0 +1,71 @@ +/* + * Allow user to pass their own params + */ +var extend = function(a, b) { + for (var key in b) { + if (b.hasOwnProperty(key)) { + a[key] = b[key]; + } + } + return a; +}; + +/* + * Convert HEX codes to RGB values (#000000 -> rgb(0,0,0)) + */ +var hexToRgb = function(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) : null; +}; + +/* + * Check if the user is using Internet Explorer 8 (for fallbacks) + */ +var isIE8 = function() { + return (window.attachEvent && !window.addEventListener); +}; + +/* + * IE compatible logging for developers + */ +var logStr = function(string) { + if (window.console) { + // IE... + window.console.log('SweetAlert: ' + string); + } +}; + +/* + * Set hover, active and focus-states for buttons + * (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color) + */ +var colorLuminance = function(hex, lum) { + // Validate hex string + hex = String(hex).replace(/[^0-9a-f]/gi, ''); + if (hex.length < 6) { + hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; + } + lum = lum || 0; + + // Convert to decimal and change luminosity + var rgb = '#'; + var c; + var i; + + for (i = 0; i < 3; i++) { + c = parseInt(hex.substr(i * 2, 2), 16); + c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16); + rgb += ('00' + c).substr(c.length); + } + + return rgb; +}; + + +export { + extend, + hexToRgb, + isIE8, + logStr, + colorLuminance +}; diff --git a/node_modules/sweetalert/dev/sweetalert.es6.js b/node_modules/sweetalert/dev/sweetalert.es6.js new file mode 100644 index 0000000..ea69eef --- /dev/null +++ b/node_modules/sweetalert/dev/sweetalert.es6.js @@ -0,0 +1,311 @@ +// SweetAlert +// 2014-2015 (c) - Tristan Edwards +// github.com/t4t5/sweetalert + +/* + * jQuery-like functions for manipulating the DOM + */ +import { + hasClass, addClass, removeClass, + escapeHtml, + _show, show, _hide, hide, + isDescendant, + getTopMargin, + fadeIn, fadeOut, + fireClick, + stopEventPropagation +} from './modules/handle-dom'; + +/* + * Handy utilities + */ +import { + extend, + hexToRgb, + isIE8, + logStr, + colorLuminance +} from './modules/utils'; + +/* + * Handle sweetAlert's DOM elements + */ +import { + sweetAlertInitialize, + getModal, + getOverlay, + getInput, + setFocusStyle, + openModal, + resetInput, + fixVerticalPosition +} from './modules/handle-swal-dom'; + + +// Handle button events and keyboard events +import { handleButton, handleConfirm, handleCancel } from './modules/handle-click'; +import handleKeyDown from './modules/handle-key'; + + +// Default values +import defaultParams from './modules/default-params'; +import setParameters from './modules/set-params'; + +/* + * Remember state in cases where opening and handling a modal will fiddle with it. + * (We also use window.previousActiveElement as a global variable) + */ +var previousWindowKeyDown; +var lastFocusedButton; + + +/* + * Global sweetAlert function + * (this is what the user calls) + */ +var sweetAlert, swal; + +export default sweetAlert = swal = function() { + var customizations = arguments[0]; + + addClass(document.body, 'stop-scrolling'); + resetInput(); + + /* + * Use argument if defined or default value from params object otherwise. + * Supports the case where a default value is boolean true and should be + * overridden by a corresponding explicit argument which is boolean false. + */ + function argumentOrDefault(key) { + var args = customizations; + return (args[key] === undefined) ? defaultParams[key] : args[key]; + } + + if (customizations === undefined) { + logStr('SweetAlert expects at least 1 attribute!'); + return false; + } + + var params = extend({}, defaultParams); + + switch (typeof customizations) { + + // Ex: swal("Hello", "Just testing", "info"); + case 'string': + params.title = customizations; + params.text = arguments[1] || ''; + params.type = arguments[2] || ''; + break; + + // Ex: swal({ title:"Hello", text: "Just testing", type: "info" }); + case 'object': + if (customizations.title === undefined) { + logStr('Missing "title" argument!'); + return false; + } + + params.title = customizations.title; + + for (let customName in defaultParams) { + params[customName] = argumentOrDefault(customName); + } + + // Show "Confirm" instead of "OK" if cancel button is visible + params.confirmButtonText = params.showCancelButton ? 'Confirm' : defaultParams.confirmButtonText; + params.confirmButtonText = argumentOrDefault('confirmButtonText'); + + // Callback function when clicking on "OK"/"Cancel" + params.doneFunction = arguments[1] || null; + + break; + + default: + logStr('Unexpected type of argument! Expected "string" or "object", got ' + typeof customizations); + return false; + + } + + setParameters(params); + fixVerticalPosition(); + openModal(arguments[1]); + + // Modal interactions + var modal = getModal(); + + + /* + * Make sure all modal buttons respond to all events + */ + var $buttons = modal.querySelectorAll('button'); + var buttonEvents = ['onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'onfocus']; + var onButtonEvent = (e) => handleButton(e, params, modal); + + for (let btnIndex = 0; btnIndex < $buttons.length; btnIndex++) { + for (let evtIndex = 0; evtIndex < buttonEvents.length; evtIndex++) { + let btnEvt = buttonEvents[evtIndex]; + $buttons[btnIndex][btnEvt] = onButtonEvent; + } + } + + // Clicking outside the modal dismisses it (if allowed by user) + getOverlay().onclick = onButtonEvent; + + previousWindowKeyDown = window.onkeydown; + + var onKeyEvent = (e) => handleKeyDown(e, params, modal); + window.onkeydown = onKeyEvent; + + window.onfocus = function () { + // When the user has focused away and focused back from the whole window. + setTimeout(function () { + // Put in a timeout to jump out of the event sequence. + // Calling focus() in the event sequence confuses things. + if (lastFocusedButton !== undefined) { + lastFocusedButton.focus(); + lastFocusedButton = undefined; + } + }, 0); + }; + + // Show alert with enabled buttons always + swal.enableButtons(); +}; + + + +/* + * Set default params for each popup + * @param {Object} userParams + */ +sweetAlert.setDefaults = swal.setDefaults = function(userParams) { + if (!userParams) { + throw new Error('userParams is required'); + } + if (typeof userParams !== 'object') { + throw new Error('userParams has to be a object'); + } + + extend(defaultParams, userParams); +}; + + +/* + * Animation when closing modal + */ +sweetAlert.close = swal.close = function() { + var modal = getModal(); + + fadeOut(getOverlay(), 5); + fadeOut(modal, 5); + removeClass(modal, 'showSweetAlert'); + addClass(modal, 'hideSweetAlert'); + removeClass(modal, 'visible'); + + /* + * Reset icon animations + */ + var $successIcon = modal.querySelector('.sa-icon.sa-success'); + removeClass($successIcon, 'animate'); + removeClass($successIcon.querySelector('.sa-tip'), 'animateSuccessTip'); + removeClass($successIcon.querySelector('.sa-long'), 'animateSuccessLong'); + + var $errorIcon = modal.querySelector('.sa-icon.sa-error'); + removeClass($errorIcon, 'animateErrorIcon'); + removeClass($errorIcon.querySelector('.sa-x-mark'), 'animateXMark'); + + var $warningIcon = modal.querySelector('.sa-icon.sa-warning'); + removeClass($warningIcon, 'pulseWarning'); + removeClass($warningIcon.querySelector('.sa-body'), 'pulseWarningIns'); + removeClass($warningIcon.querySelector('.sa-dot'), 'pulseWarningIns'); + + // Reset custom class (delay so that UI changes aren't visible) + setTimeout(function() { + var customClass = modal.getAttribute('data-custom-class'); + removeClass(modal, customClass); + }, 300); + + // Make page scrollable again + removeClass(document.body, 'stop-scrolling'); + + // Reset the page to its previous state + window.onkeydown = previousWindowKeyDown; + if (window.previousActiveElement) { + window.previousActiveElement.focus(); + } + lastFocusedButton = undefined; + clearTimeout(modal.timeout); + + return true; +}; + + +/* + * Validation of the input field is done by user + * If something is wrong => call showInputError with errorMessage + */ +sweetAlert.showInputError = swal.showInputError = function(errorMessage) { + var modal = getModal(); + + var $errorIcon = modal.querySelector('.sa-input-error'); + addClass($errorIcon, 'show'); + + var $errorContainer = modal.querySelector('.sa-error-container'); + addClass($errorContainer, 'show'); + + $errorContainer.querySelector('p').innerHTML = errorMessage; + + setTimeout(function() { + sweetAlert.enableButtons(); + }, 1); + + modal.querySelector('input').focus(); +}; + + +/* + * Reset input error DOM elements + */ +sweetAlert.resetInputError = swal.resetInputError = function(event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + removeClass($errorContainer, 'show'); +}; + +/* + * Disable confirm and cancel buttons + */ +sweetAlert.disableButtons = swal.disableButtons = function(event) { + var modal = getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = true; + $cancelButton.disabled = true; +}; + +/* + * Enable confirm and cancel buttons + */ +sweetAlert.enableButtons = swal.enableButtons = function(event) { + var modal = getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = false; + $cancelButton.disabled = false; +}; + +if (typeof window !== 'undefined') { + // The 'handle-click' module requires + // that 'sweetAlert' was set as global. + window.sweetAlert = window.swal = sweetAlert; +} else { + logStr('SweetAlert is a frontend module!'); +} diff --git a/node_modules/sweetalert/dev/sweetalert.scss b/node_modules/sweetalert/dev/sweetalert.scss new file mode 100644 index 0000000..1b6bf35 --- /dev/null +++ b/node_modules/sweetalert/dev/sweetalert.scss @@ -0,0 +1,648 @@ +// SweetAlert +// 2014-2015 (c) - Tristan Edwards +// github.com/t4t5/sweetalert + + +body.stop-scrolling { + height: 100%; + overflow: hidden; +} + +.sweet-overlay { + background-color: rgb(0, 0, 0); /* IE8 */ + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; /* IE8 */ + background-color: rgba(black, 0.4); + + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + + display: none; + z-index: 10000; +} + +.sweet-alert { + $width: 478px; + $padding: 17px; + + background-color: white; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + width: $width; + padding: $padding; + border-radius: 5px; + text-align: center; + + position: fixed; + left: 50%; + top: 50%; + margin-left: -($width/2 + $padding); + margin-top: -200px; + + overflow: hidden; + display: none; + z-index: 99999; + + @media all and (max-width: 540px) { + width: auto; + margin-left: 0; + margin-right: 0; + + left: 15px; + right: 15px; + } + + h2 { + color: #575757; + font-size: 30px; + text-align: center; + font-weight: 600; + text-transform: none; + position: relative; + margin: 25px 0; + padding: 0; + line-height: 40px; + display: block; + } + + p { + color: #797979; + font-size: 16px; + text-align: center; + font-weight: 300; + position: relative; + text-align: inherit; + float: none; + margin: 0; + padding: 0; + line-height: normal; + } + + fieldset { + border: none; + position: relative; + } + + .sa-error-container { + background-color: #f1f1f1; + margin-left: -17px; + margin-right: -17px; + overflow: hidden; + padding: 0 10px; + max-height: 0; + webkit-transition: padding 0.15s, max-height 0.15s; + transition: padding 0.15s, max-height 0.15s; + &.show { + padding: 10px 0; + max-height: 100px; + webkit-transition: padding 0.2s, max-height 0.2s; + transition: padding 0.25s, max-height 0.25s; + } + + .icon { + display: inline-block; + width: 24px; + height: 24px; + border-radius: 50%; + background-color: rgb(234, 125, 125); + color: white; + line-height: 24px; + text-align: center; + margin-right: 3px; + } + p { + display: inline-block; + } + } + + .sa-input-error { + position: absolute; + top: 29px; + right: 26px; + width: 20px; + height: 20px; + opacity: 0; + -webkit-transform: scale(0.5); + transform: scale(0.5); + -webkit-transform-origin: 50% 50%; + transform-origin: 50% 50%; + -webkit-transition: all 0.1s; + transition: all 0.1s; + &::before, &::after { + content: ""; + width: 20px; + height: 6px; + background-color: #f06e57; + border-radius: 3px; + position: absolute; + top: 50%; + margin-top: -4px; + left: 50%; + margin-left: -9px; + } + &::before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + &::after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + } + &.show { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + } + + input { + width: 100%; + box-sizing: border-box; + border-radius: 3px; + border: 1px solid rgb(215, 215, 215); + height: 43px; + margin-top: 10px; + margin-bottom: 17px; + font-size: 18px; + box-shadow: inset 0px 1px 1px rgba(black, 0.06); + padding: 0 12px; + display: none; + -webkit-transition: all 0.3s; + transition: all 0.3s; + &:focus { + outline: none; + box-shadow: 0px 0px 3px rgb(196, 230, 245); + border: 1px solid rgb(180, 219, 237); + &::-moz-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; + } + &:-ms-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; + } + &::-webkit-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; + } + } + &::-moz-placeholder { + color: lighten(#575757, 40); + } + &:-ms-input-placeholder { + color: lighten(#575757, 40); + } + &::-webkit-input-placeholder { + color: lighten(#575757, 40); + } + } + &.show-input input { + display: block; + } + + .sa-confirm-button-container { + display: inline-block; + position: relative; + } + + .la-ball-fall { + position: absolute; + left: 50%; + top: 50%; + margin-left: -27px; + margin-top: 4px; + opacity: 0; + visibility: hidden; + } + + button { + $btnBlue: #8CD4F5; + $btnGray: #C1C1C1; + + background-color: $btnBlue; + color: white; + border: none; + box-shadow: none; + font-size: 17px; + font-weight: 500; + -webkit-border-radius: 4px; + border-radius: 5px; + padding: 10px 32px; + margin: 26px 5px 0 5px; + cursor: pointer; + &:focus { + outline: none; + box-shadow: 0 0 2px rgba(128, 179, 235, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.05); + } + &:hover { + background-color: darken($btnBlue, 3%); + } + &:active { + background-color: darken($btnBlue, 10%); + } + &.cancel { + background-color: $btnGray; + &:hover { + background-color: darken($btnGray, 3%); + } + &:active { + background-color: darken($btnGray, 10%); + } + // Cancel button should keep the same style + &:focus { + box-shadow: rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important; + } + } + + &[disabled] { + opacity: .6; + cursor: default; + } + + &.confirm[disabled] { + color: transparent; + ~ .la-ball-fall { + opacity: 1; + visibility: visible; + transition-delay: 0s; + } + } + + // Removes selection outline in Firefox + &::-moz-focus-inner { + border: 0; + } + } + + // Only show focus-style when there is multiple choice of actions + &[data-has-cancel-button=false] button { + box-shadow: none !important; + } + + &[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 40px; + } + + .sa-icon { + $red: #F27474; + $orange: #F8BB86; + $blue: #C9DAE1; + $green: #A5DC86; + + width: 80px; + height: 80px; + border: 4px solid gray; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + margin: 20px auto; + padding: 0; + position: relative; + box-sizing: content-box; + + &.sa-error { + border-color: $red; + + .sa-x-mark { + position: relative; + display: block; + } + + .sa-line { + position: absolute; + height: 5px; + width: 47px; + background-color: $red; + display: block; + top: 37px; + border-radius: 2px; + + &.sa-left { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + left: 17px; + } + &.sa-right { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + right: 16px; + } + } + } + &.sa-warning { + border-color: $orange; + + .sa-body { // Exclamation mark body + position: absolute; + width: 5px; + height: 47px; + left: 50%; + top: 10px; + -webkit-border-radius: 2px; + border-radius: 2px; + margin-left: -2px; + background-color: $orange; + } + .sa-dot { // Exclamation mark dot + position: absolute; + width: 7px; + height: 7px; + -webkit-border-radius: 50%; + border-radius: 50%; + margin-left: -3px; + left: 50%; + bottom: 10px; + background-color: $orange; + } + } + &.sa-info { + border-color: $blue; + + &::before { // i-letter body + content: ""; + position: absolute; + width: 5px; + height: 29px; + left: 50%; + bottom: 17px; + border-radius: 2px; + margin-left: -2px; + background-color: $blue; + } + &::after { // i-letter dot + content: ""; + position: absolute; + width: 7px; + height: 7px; + border-radius: 50%; + margin-left: -3px; + top: 19px; + background-color: $blue; + } + } + &.sa-success { + border-color: $green; + + &::before, &::after { // Emulate moving circular line + content: ''; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + position: absolute; + width: 60px; + height: 120px; + background: white; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + } + &::before { + -webkit-border-radius: 120px 0 0 120px; + border-radius: 120px 0 0 120px; + top: -7px; + left: -33px; + + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 60px 60px; + transform-origin: 60px 60px; + } + &::after { + -webkit-border-radius: 0 120px 120px 0; + border-radius: 0 120px 120px 0; + top: -11px; + left: 30px; + + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 0px 60px; + transform-origin: 0px 60px; + } + + .sa-placeholder { // Ring + width: 80px; + height: 80px; + border: 4px solid rgba($green, 0.2); + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + box-sizing: content-box; + + position: absolute; + left: -4px; + top: -4px; + z-index: 2; + } + + .sa-fix { // Hide corners left from animation + width: 5px; + height: 90px; + background-color: white; + + position: absolute; + left: 28px; + top: 8px; + z-index: 1; + + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + + .sa-line { + height: 5px; + background-color: $green; + display: block; + border-radius: 2px; + + position: absolute; + z-index: 2; + + &.sa-tip { + width: 25px; + + left: 14px; + top: 46px; + + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + } + &.sa-long { + width: 47px; + + right: 8px; + top: 38px; + + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + } + } + &.sa-custom { + background-size: contain; + border-radius: 0; + border: none; + background-position: center center; + background-repeat: no-repeat; + } + } + +} + +/* + * Animations + */ + +@mixin keyframes($animation-name) { + @-webkit-keyframes #{$animation-name} { + @content; + } + @keyframes #{$animation-name} { + @content; + } +} +@mixin animation($str) { + -webkit-animation: #{$str}; + animation: #{$str}; +} + + +// Modal animation + +@include keyframes(showSweetAlert) { + 0% { transform: scale(0.7); -webkit-transform: scale(0.7); } + 45% { transform: scale(1.05); -webkit-transform: scale(1.05); } + 80% { transform: scale(0.95); -webkit-transform: scale(0.95); } + 100% { transform: scale(1); -webkit-transform: scale(1); } +} +@include keyframes(hideSweetAlert) { + 0% { transform: scale(1); -webkit-transform: scale(1); } + 100% { transform: scale(0.5); -webkit-transform: scale(0.5); } +} + +@include keyframes(slideFromTop) { + 0% { top: 0%; } + 100% { top: 50%; } +} +@include keyframes(slideToTop) { + 0% { top: 50%; } + 100% { top: 0%; } +} + +@include keyframes(slideFromBottom) { + 0% { top: 70%; } + 100% { top: 50%; } +} +@include keyframes(slideToBottom) { + 0% { top: 50%; } + 100% { top: 70%; } +} + +.showSweetAlert { + &[data-animation=pop] { + @include animation('showSweetAlert 0.3s'); + } + &[data-animation=none] { + @include animation('none'); + } + &[data-animation=slide-from-top] { + @include animation('slideFromTop 0.3s'); + } + &[data-animation=slide-from-bottom] { + @include animation('slideFromBottom 0.3s'); + } +} + +.hideSweetAlert { + &[data-animation=pop] { + @include animation('hideSweetAlert 0.2s'); + } + &[data-animation=none] { + @include animation('none'); + } + &[data-animation=slide-from-top] { + @include animation('slideToTop 0.4s'); + } + &[data-animation=slide-from-bottom] { + @include animation('slideToBottom 0.3s'); + } +} + + + +// Success icon animation + +@include keyframes(animateSuccessTip) { + 0% { width: 0; left: 1px; top: 19px; } + 54% { width: 0; left: 1px; top: 19px; } + 70% { width: 50px; left: -8px; top: 37px; } + 84% { width: 17px; left: 21px; top: 48px; } + 100% { width: 25px; left: 14px; top: 45px; } +} +@include keyframes(animateSuccessLong) { + 0% { width: 0; right: 46px; top: 54px; } + 65% { width: 0; right: 46px; top: 54px; } + 84% { width: 55px; right: 0px; top: 35px; } + 100% { width: 47px; right: 8px; top: 38px; } +} +@include keyframes(rotatePlaceholder) { + 0% { transform: rotate(-45deg); -webkit-transform: rotate(-45deg); } + 5% { transform: rotate(-45deg); -webkit-transform: rotate(-45deg); } + 12% { transform: rotate(-405deg); -webkit-transform: rotate(-405deg); } + 100% { transform: rotate(-405deg); -webkit-transform: rotate(-405deg); } +} + +.animateSuccessTip { + @include animation('animateSuccessTip 0.75s'); +} +.animateSuccessLong { + @include animation('animateSuccessLong 0.75s'); +} +.sa-icon.sa-success.animate::after { + @include animation('rotatePlaceholder 4.25s ease-in'); +} + + +// Error icon animation + +@include keyframes(animateErrorIcon) { + 0% { transform: rotateX(100deg); -webkit-transform: rotateX(100deg); opacity: 0; } + 100% { transform: rotateX(0deg); -webkit-transform: rotateX(0deg); opacity: 1; } +} +.animateErrorIcon { + @include animation('animateErrorIcon 0.5s'); +} +@include keyframes(animateXMark) { + 0% { transform: scale(0.4); -webkit-transform: scale(0.4); margin-top: 26px; opacity: 0; } + 50% { transform: scale(0.4); -webkit-transform: scale(0.4); margin-top: 26px; opacity: 0; } + 80% { transform: scale(1.15); -webkit-transform: scale(1.15); margin-top: -6px; } + 100% { transform: scale(1); -webkit-transform: scale(1); margin-top: 0; opacity: 1; } +} +.animateXMark { + @include animation('animateXMark 0.5s'); +} + +@include keyframes(pulseWarning) { + 0% { border-color: #F8D486; } + 100% { border-color: #F8BB86; } +} +.pulseWarning { + @include animation('pulseWarning 0.75s infinite alternate'); +} + +@include keyframes(pulseWarningIns) { + 0% { background-color: #F8D486; } + 100% { background-color: #F8BB86; } +} +.pulseWarningIns { + @include animation('pulseWarningIns 0.75s infinite alternate'); +} + +@include keyframes(rotate-loading) { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} diff --git a/node_modules/sweetalert/dist/sweetalert-dev.js b/node_modules/sweetalert/dist/sweetalert-dev.js new file mode 100644 index 0000000..7e294b8 --- /dev/null +++ b/node_modules/sweetalert/dist/sweetalert-dev.js @@ -0,0 +1,1285 @@ +;(function(window, document, undefined) { + "use strict"; + + (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o call showInputError with errorMessage + */ +sweetAlert.showInputError = swal.showInputError = function (errorMessage) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + var $errorIcon = modal.querySelector('.sa-input-error'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass($errorIcon, 'show'); + + var $errorContainer = modal.querySelector('.sa-error-container'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass($errorContainer, 'show'); + + $errorContainer.querySelector('p').innerHTML = errorMessage; + + setTimeout(function () { + sweetAlert.enableButtons(); + }, 1); + + modal.querySelector('input').focus(); +}; + +/* + * Reset input error DOM elements + */ +sweetAlert.resetInputError = swal.resetInputError = function (event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorContainer, 'show'); +}; + +/* + * Disable confirm and cancel buttons + */ +sweetAlert.disableButtons = swal.disableButtons = function (event) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = true; + $cancelButton.disabled = true; +}; + +/* + * Enable confirm and cancel buttons + */ +sweetAlert.enableButtons = swal.enableButtons = function (event) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = false; + $cancelButton.disabled = false; +}; + +if (typeof window !== 'undefined') { + // The 'handle-click' module requires + // that 'sweetAlert' was set as global. + window.sweetAlert = window.swal = sweetAlert; +} else { + _extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('SweetAlert is a frontend module!'); +} +module.exports = exports['default']; + +},{"./modules/default-params":2,"./modules/handle-click":3,"./modules/handle-dom":4,"./modules/handle-key":5,"./modules/handle-swal-dom":6,"./modules/set-params":8,"./modules/utils":9}],2:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var defaultParams = { + title: '', + text: '', + type: null, + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + closeOnConfirm: true, + closeOnCancel: true, + confirmButtonText: 'OK', + confirmButtonColor: '#8CD4F5', + cancelButtonText: 'Cancel', + imageUrl: null, + imageSize: null, + timer: null, + customClass: '', + html: false, + animation: true, + allowEscapeKey: true, + inputType: 'text', + inputPlaceholder: '', + inputValue: '', + showLoaderOnConfirm: false +}; + +exports['default'] = defaultParams; +module.exports = exports['default']; + +},{}],3:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _colorLuminance = require('./utils'); + +var _getModal = require('./handle-swal-dom'); + +var _hasClass$isDescendant = require('./handle-dom'); + +/* + * User clicked on "Confirm"/"OK" or "Cancel" + */ +var handleButton = function handleButton(event, params, modal) { + var e = event || window.event; + var target = e.target || e.srcElement; + + var targetedConfirm = target.className.indexOf('confirm') !== -1; + var targetedOverlay = target.className.indexOf('sweet-overlay') !== -1; + var modalIsVisible = _hasClass$isDescendant.hasClass(modal, 'visible'); + var doneFunctionExists = params.doneFunction && modal.getAttribute('data-has-done-function') === 'true'; + + // Since the user can change the background-color of the confirm button programmatically, + // we must calculate what the color should be on hover/active + var normalColor, hoverColor, activeColor; + if (targetedConfirm && params.confirmButtonColor) { + normalColor = params.confirmButtonColor; + hoverColor = _colorLuminance.colorLuminance(normalColor, -0.04); + activeColor = _colorLuminance.colorLuminance(normalColor, -0.14); + } + + function shouldSetConfirmButtonColor(color) { + if (targetedConfirm && params.confirmButtonColor) { + target.style.backgroundColor = color; + } + } + + switch (e.type) { + case 'mouseover': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'mouseout': + shouldSetConfirmButtonColor(normalColor); + break; + + case 'mousedown': + shouldSetConfirmButtonColor(activeColor); + break; + + case 'mouseup': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'focus': + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + + if (targetedConfirm) { + $cancelButton.style.boxShadow = 'none'; + } else { + $confirmButton.style.boxShadow = 'none'; + } + break; + + case 'click': + var clickedOnModal = modal === target; + var clickedOnModalChild = _hasClass$isDescendant.isDescendant(modal, target); + + // Ignore click outside if allowOutsideClick is false + if (!clickedOnModal && !clickedOnModalChild && modalIsVisible && !params.allowOutsideClick) { + break; + } + + if (targetedConfirm && doneFunctionExists && modalIsVisible) { + handleConfirm(modal, params); + } else if (doneFunctionExists && modalIsVisible || targetedOverlay) { + handleCancel(modal, params); + } else if (_hasClass$isDescendant.isDescendant(modal, target) && target.tagName === 'BUTTON') { + sweetAlert.close(); + } + break; + } +}; + +/* + * User clicked on "Confirm"/"OK" + */ +var handleConfirm = function handleConfirm(modal, params) { + var callbackValue = true; + + if (_hasClass$isDescendant.hasClass(modal, 'show-input')) { + callbackValue = modal.querySelector('input').value; + + if (!callbackValue) { + callbackValue = ''; + } + } + + params.doneFunction(callbackValue); + + if (params.closeOnConfirm) { + sweetAlert.close(); + } + // Disable cancel and confirm button if the parameter is true + if (params.showLoaderOnConfirm) { + sweetAlert.disableButtons(); + } +}; + +/* + * User clicked on "Cancel" + */ +var handleCancel = function handleCancel(modal, params) { + // Check if callback function expects a parameter (to track cancel actions) + var functionAsStr = String(params.doneFunction).replace(/\s/g, ''); + var functionHandlesCancel = functionAsStr.substring(0, 9) === 'function(' && functionAsStr.substring(9, 10) !== ')'; + + if (functionHandlesCancel) { + params.doneFunction(false); + } + + if (params.closeOnCancel) { + sweetAlert.close(); + } +}; + +exports['default'] = { + handleButton: handleButton, + handleConfirm: handleConfirm, + handleCancel: handleCancel +}; +module.exports = exports['default']; + +},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],4:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var hasClass = function hasClass(elem, className) { + return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); +}; + +var addClass = function addClass(elem, className) { + if (!hasClass(elem, className)) { + elem.className += ' ' + className; + } +}; + +var removeClass = function removeClass(elem, className) { + var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; + if (hasClass(elem, className)) { + while (newClass.indexOf(' ' + className + ' ') >= 0) { + newClass = newClass.replace(' ' + className + ' ', ' '); + } + elem.className = newClass.replace(/^\s+|\s+$/g, ''); + } +}; + +var escapeHtml = function escapeHtml(str) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; +}; + +var _show = function _show(elem) { + elem.style.opacity = ''; + elem.style.display = 'block'; +}; + +var show = function show(elems) { + if (elems && !elems.length) { + return _show(elems); + } + for (var i = 0; i < elems.length; ++i) { + _show(elems[i]); + } +}; + +var _hide = function _hide(elem) { + elem.style.opacity = ''; + elem.style.display = 'none'; +}; + +var hide = function hide(elems) { + if (elems && !elems.length) { + return _hide(elems); + } + for (var i = 0; i < elems.length; ++i) { + _hide(elems[i]); + } +}; + +var isDescendant = function isDescendant(parent, child) { + var node = child.parentNode; + while (node !== null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; +}; + +var getTopMargin = function getTopMargin(elem) { + elem.style.left = '-9999px'; + elem.style.display = 'block'; + + var height = elem.clientHeight, + padding; + if (typeof getComputedStyle !== 'undefined') { + // IE 8 + padding = parseInt(getComputedStyle(elem).getPropertyValue('padding-top'), 10); + } else { + padding = parseInt(elem.currentStyle.padding); + } + + elem.style.left = ''; + elem.style.display = 'none'; + return '-' + parseInt((height + padding) / 2) + 'px'; +}; + +var fadeIn = function fadeIn(elem, interval) { + if (+elem.style.opacity < 1) { + interval = interval || 16; + elem.style.opacity = 0; + elem.style.display = 'block'; + var last = +new Date(); + var tick = (function (_tick) { + function tick() { + return _tick.apply(this, arguments); + } + + tick.toString = function () { + return _tick.toString(); + }; + + return tick; + })(function () { + elem.style.opacity = +elem.style.opacity + (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity < 1) { + setTimeout(tick, interval); + } + }); + tick(); + } + elem.style.display = 'block'; //fallback IE8 +}; + +var fadeOut = function fadeOut(elem, interval) { + interval = interval || 16; + elem.style.opacity = 1; + var last = +new Date(); + var tick = (function (_tick2) { + function tick() { + return _tick2.apply(this, arguments); + } + + tick.toString = function () { + return _tick2.toString(); + }; + + return tick; + })(function () { + elem.style.opacity = +elem.style.opacity - (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity > 0) { + setTimeout(tick, interval); + } else { + elem.style.display = 'none'; + } + }); + tick(); +}; + +var fireClick = function fireClick(node) { + // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/ + // Then fixed for today's Chrome browser. + if (typeof MouseEvent === 'function') { + // Up-to-date approach + var mevt = new MouseEvent('click', { + view: window, + bubbles: false, + cancelable: true + }); + node.dispatchEvent(mevt); + } else if (document.createEvent) { + // Fallback + var evt = document.createEvent('MouseEvents'); + evt.initEvent('click', false, false); + node.dispatchEvent(evt); + } else if (document.createEventObject) { + node.fireEvent('onclick'); + } else if (typeof node.onclick === 'function') { + node.onclick(); + } +}; + +var stopEventPropagation = function stopEventPropagation(e) { + // In particular, make sure the space bar doesn't scroll the main window. + if (typeof e.stopPropagation === 'function') { + e.stopPropagation(); + e.preventDefault(); + } else if (window.event && window.event.hasOwnProperty('cancelBubble')) { + window.event.cancelBubble = true; + } +}; + +exports.hasClass = hasClass; +exports.addClass = addClass; +exports.removeClass = removeClass; +exports.escapeHtml = escapeHtml; +exports._show = _show; +exports.show = show; +exports._hide = _hide; +exports.hide = hide; +exports.isDescendant = isDescendant; +exports.getTopMargin = getTopMargin; +exports.fadeIn = fadeIn; +exports.fadeOut = fadeOut; +exports.fireClick = fireClick; +exports.stopEventPropagation = stopEventPropagation; + +},{}],5:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _stopEventPropagation$fireClick = require('./handle-dom'); + +var _setFocusStyle = require('./handle-swal-dom'); + +var handleKeyDown = function handleKeyDown(event, params, modal) { + var e = event || window.event; + var keyCode = e.keyCode || e.which; + + var $okButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + var $modalButtons = modal.querySelectorAll('button[tabindex]'); + + if ([9, 13, 32, 27].indexOf(keyCode) === -1) { + // Don't do work on keys we don't care about. + return; + } + + var $targetElement = e.target || e.srcElement; + + var btnIndex = -1; // Find the button - note, this is a nodelist, not an array. + for (var i = 0; i < $modalButtons.length; i++) { + if ($targetElement === $modalButtons[i]) { + btnIndex = i; + break; + } + } + + if (keyCode === 9) { + // TAB + if (btnIndex === -1) { + // No button focused. Jump to the confirm button. + $targetElement = $okButton; + } else { + // Cycle to the next button + if (btnIndex === $modalButtons.length - 1) { + $targetElement = $modalButtons[0]; + } else { + $targetElement = $modalButtons[btnIndex + 1]; + } + } + + _stopEventPropagation$fireClick.stopEventPropagation(e); + $targetElement.focus(); + + if (params.confirmButtonColor) { + _setFocusStyle.setFocusStyle($targetElement, params.confirmButtonColor); + } + } else { + if (keyCode === 13) { + if ($targetElement.tagName === 'INPUT') { + $targetElement = $okButton; + $okButton.focus(); + } + + if (btnIndex === -1) { + // ENTER/SPACE clicked outside of a button. + $targetElement = $okButton; + } else { + // Do nothing - let the browser handle it. + $targetElement = undefined; + } + } else if (keyCode === 27 && params.allowEscapeKey === true) { + $targetElement = $cancelButton; + _stopEventPropagation$fireClick.fireClick($targetElement, e); + } else { + // Fallback - let the browser handle it. + $targetElement = undefined; + } + } +}; + +exports['default'] = handleKeyDown; +module.exports = exports['default']; + +},{"./handle-dom":4,"./handle-swal-dom":6}],6:[function(require,module,exports){ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _hexToRgb = require('./utils'); + +var _removeClass$getTopMargin$fadeIn$show$addClass = require('./handle-dom'); + +var _defaultParams = require('./default-params'); + +var _defaultParams2 = _interopRequireWildcard(_defaultParams); + +/* + * Add modal + overlay to DOM + */ + +var _injectedHTML = require('./injected-html'); + +var _injectedHTML2 = _interopRequireWildcard(_injectedHTML); + +var modalClass = '.sweet-alert'; +var overlayClass = '.sweet-overlay'; + +var sweetAlertInitialize = function sweetAlertInitialize() { + var sweetWrap = document.createElement('div'); + sweetWrap.innerHTML = _injectedHTML2['default']; + + // Append elements to body + while (sweetWrap.firstChild) { + document.body.appendChild(sweetWrap.firstChild); + } +}; + +/* + * Get DOM element of modal + */ +var getModal = (function (_getModal) { + function getModal() { + return _getModal.apply(this, arguments); + } + + getModal.toString = function () { + return _getModal.toString(); + }; + + return getModal; +})(function () { + var $modal = document.querySelector(modalClass); + + if (!$modal) { + sweetAlertInitialize(); + $modal = getModal(); + } + + return $modal; +}); + +/* + * Get DOM element of input (in modal) + */ +var getInput = function getInput() { + var $modal = getModal(); + if ($modal) { + return $modal.querySelector('input'); + } +}; + +/* + * Get DOM element of overlay + */ +var getOverlay = function getOverlay() { + return document.querySelector(overlayClass); +}; + +/* + * Add box-shadow style to button (depending on its chosen bg-color) + */ +var setFocusStyle = function setFocusStyle($button, bgColor) { + var rgbColor = _hexToRgb.hexToRgb(bgColor); + $button.style.boxShadow = '0 0 2px rgba(' + rgbColor + ', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)'; +}; + +/* + * Animation when opening modal + */ +var openModal = function openModal(callback) { + var $modal = getModal(); + _removeClass$getTopMargin$fadeIn$show$addClass.fadeIn(getOverlay(), 10); + _removeClass$getTopMargin$fadeIn$show$addClass.show($modal); + _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'showSweetAlert'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'hideSweetAlert'); + + window.previousActiveElement = document.activeElement; + var $okButton = $modal.querySelector('button.confirm'); + $okButton.focus(); + + setTimeout(function () { + _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'visible'); + }, 500); + + var timer = $modal.getAttribute('data-timer'); + + if (timer !== 'null' && timer !== '') { + var timerCallback = callback; + $modal.timeout = setTimeout(function () { + var doneFunctionExists = (timerCallback || null) && $modal.getAttribute('data-has-done-function') === 'true'; + if (doneFunctionExists) { + timerCallback(null); + } else { + sweetAlert.close(); + } + }, timer); + } +}; + +/* + * Reset the styling of the input + * (for example if errors have been shown) + */ +var resetInput = function resetInput() { + var $modal = getModal(); + var $input = getInput(); + + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'show-input'); + $input.value = _defaultParams2['default'].inputValue; + $input.setAttribute('type', _defaultParams2['default'].inputType); + $input.setAttribute('placeholder', _defaultParams2['default'].inputPlaceholder); + + resetInputError(); +}; + +var resetInputError = function resetInputError(event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($errorContainer, 'show'); +}; + +/* + * Set "margin-top"-property on modal based on its computed height + */ +var fixVerticalPosition = function fixVerticalPosition() { + var $modal = getModal(); + $modal.style.marginTop = _removeClass$getTopMargin$fadeIn$show$addClass.getTopMargin(getModal()); +}; + +exports.sweetAlertInitialize = sweetAlertInitialize; +exports.getModal = getModal; +exports.getOverlay = getOverlay; +exports.getInput = getInput; +exports.setFocusStyle = setFocusStyle; +exports.openModal = openModal; +exports.resetInput = resetInput; +exports.resetInputError = resetInputError; +exports.fixVerticalPosition = fixVerticalPosition; + +},{"./default-params":2,"./handle-dom":4,"./injected-html":7,"./utils":9}],7:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var injectedHTML = + +// Dark overlay +"
" + + +// Modal +"
" + + +// Error icon +"
\n \n \n \n \n
" + + +// Warning icon +"
\n \n \n
" + + +// Info icon +"
" + + +// Success icon +"
\n \n \n\n
\n
\n
" + "
" + + +// Title, text and input +"

Title

\n

Text

\n
\n \n
\n
" + + +// Input errors +"
\n
!
\n

Not valid!

\n
" + + +// Cancel and confirm buttons +"
\n \n
\n " + + +// Loading animation +"
\n
\n
\n
\n
\n
\n
" + + +// End of modal +"
"; + +exports["default"] = injectedHTML; +module.exports = exports["default"]; + +},{}],8:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _isIE8 = require('./utils'); + +var _getModal$getInput$setFocusStyle = require('./handle-swal-dom'); + +var _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide = require('./handle-dom'); + +var alertTypes = ['error', 'warning', 'info', 'success', 'input', 'prompt']; + +/* + * Set type, text and actions on modal + */ +var setParameters = function setParameters(params) { + var modal = _getModal$getInput$setFocusStyle.getModal(); + + var $title = modal.querySelector('h2'); + var $text = modal.querySelector('p'); + var $cancelBtn = modal.querySelector('button.cancel'); + var $confirmBtn = modal.querySelector('button.confirm'); + + /* + * Title + */ + $title.innerHTML = params.html ? params.title : _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.title).split('\n').join('
'); + + /* + * Text + */ + $text.innerHTML = params.html ? params.text : _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.text || '').split('\n').join('
'); + if (params.text) _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($text); + + /* + * Custom class + */ + if (params.customClass) { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass(modal, params.customClass); + modal.setAttribute('data-custom-class', params.customClass); + } else { + // Find previously set classes and remove them + var customClass = modal.getAttribute('data-custom-class'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.removeClass(modal, customClass); + modal.setAttribute('data-custom-class', ''); + } + + /* + * Icon + */ + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide(modal.querySelectorAll('.sa-icon')); + + if (params.type && !_isIE8.isIE8()) { + var _ret = (function () { + + var validType = false; + + for (var i = 0; i < alertTypes.length; i++) { + if (params.type === alertTypes[i]) { + validType = true; + break; + } + } + + if (!validType) { + logStr('Unknown alert type: ' + params.type); + return { + v: false + }; + } + + var typesWithIcons = ['success', 'error', 'warning', 'info']; + var $icon = undefined; + + if (typesWithIcons.indexOf(params.type) !== -1) { + $icon = modal.querySelector('.sa-icon.' + 'sa-' + params.type); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($icon); + } + + var $input = _getModal$getInput$setFocusStyle.getInput(); + + // Animate icon + switch (params.type) { + + case 'success': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'animate'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-tip'), 'animateSuccessTip'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-long'), 'animateSuccessLong'); + break; + + case 'error': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'animateErrorIcon'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-x-mark'), 'animateXMark'); + break; + + case 'warning': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'pulseWarning'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-body'), 'pulseWarningIns'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-dot'), 'pulseWarningIns'); + break; + + case 'input': + case 'prompt': + $input.setAttribute('type', params.inputType); + $input.value = params.inputValue; + $input.setAttribute('placeholder', params.inputPlaceholder); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass(modal, 'show-input'); + setTimeout(function () { + $input.focus(); + $input.addEventListener('keyup', swal.resetInputError); + }, 400); + break; + } + })(); + + if (typeof _ret === 'object') { + return _ret.v; + } + } + + /* + * Custom image + */ + if (params.imageUrl) { + var $customIcon = modal.querySelector('.sa-icon.sa-custom'); + + $customIcon.style.backgroundImage = 'url(' + params.imageUrl + ')'; + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($customIcon); + + var _imgWidth = 80; + var _imgHeight = 80; + + if (params.imageSize) { + var dimensions = params.imageSize.toString().split('x'); + var imgWidth = dimensions[0]; + var imgHeight = dimensions[1]; + + if (!imgWidth || !imgHeight) { + logStr('Parameter imageSize expects value with format WIDTHxHEIGHT, got ' + params.imageSize); + } else { + _imgWidth = imgWidth; + _imgHeight = imgHeight; + } + } + + $customIcon.setAttribute('style', $customIcon.getAttribute('style') + 'width:' + _imgWidth + 'px; height:' + _imgHeight + 'px'); + } + + /* + * Show cancel button? + */ + modal.setAttribute('data-has-cancel-button', params.showCancelButton); + if (params.showCancelButton) { + $cancelBtn.style.display = 'inline-block'; + } else { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide($cancelBtn); + } + + /* + * Show confirm button? + */ + modal.setAttribute('data-has-confirm-button', params.showConfirmButton); + if (params.showConfirmButton) { + $confirmBtn.style.display = 'inline-block'; + } else { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide($confirmBtn); + } + + /* + * Custom text on cancel/confirm buttons + */ + if (params.cancelButtonText) { + $cancelBtn.innerHTML = _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.cancelButtonText); + } + if (params.confirmButtonText) { + $confirmBtn.innerHTML = _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.confirmButtonText); + } + + /* + * Custom color on confirm button + */ + if (params.confirmButtonColor) { + // Set confirm button to selected background color + $confirmBtn.style.backgroundColor = params.confirmButtonColor; + + // Set the confirm button color to the loading ring + $confirmBtn.style.borderLeftColor = params.confirmLoadingButtonColor; + $confirmBtn.style.borderRightColor = params.confirmLoadingButtonColor; + + // Set box-shadow to default focused button + _getModal$getInput$setFocusStyle.setFocusStyle($confirmBtn, params.confirmButtonColor); + } + + /* + * Allow outside click + */ + modal.setAttribute('data-allow-outside-click', params.allowOutsideClick); + + /* + * Callback function + */ + var hasDoneFunction = params.doneFunction ? true : false; + modal.setAttribute('data-has-done-function', hasDoneFunction); + + /* + * Animation + */ + if (!params.animation) { + modal.setAttribute('data-animation', 'none'); + } else if (typeof params.animation === 'string') { + modal.setAttribute('data-animation', params.animation); // Custom animation + } else { + modal.setAttribute('data-animation', 'pop'); + } + + /* + * Timer + */ + modal.setAttribute('data-timer', params.timer); +}; + +exports['default'] = setParameters; +module.exports = exports['default']; + +},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],9:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +/* + * Allow user to pass their own params + */ +var extend = function extend(a, b) { + for (var key in b) { + if (b.hasOwnProperty(key)) { + a[key] = b[key]; + } + } + return a; +}; + +/* + * Convert HEX codes to RGB values (#000000 -> rgb(0,0,0)) + */ +var hexToRgb = function hexToRgb(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) : null; +}; + +/* + * Check if the user is using Internet Explorer 8 (for fallbacks) + */ +var isIE8 = function isIE8() { + return window.attachEvent && !window.addEventListener; +}; + +/* + * IE compatible logging for developers + */ +var logStr = function logStr(string) { + if (window.console) { + // IE... + window.console.log('SweetAlert: ' + string); + } +}; + +/* + * Set hover, active and focus-states for buttons + * (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color) + */ +var colorLuminance = function colorLuminance(hex, lum) { + // Validate hex string + hex = String(hex).replace(/[^0-9a-f]/gi, ''); + if (hex.length < 6) { + hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; + } + lum = lum || 0; + + // Convert to decimal and change luminosity + var rgb = '#'; + var c; + var i; + + for (i = 0; i < 3; i++) { + c = parseInt(hex.substr(i * 2, 2), 16); + c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16); + rgb += ('00' + c).substr(c.length); + } + + return rgb; +}; + +exports.extend = extend; +exports.hexToRgb = hexToRgb; +exports.isIE8 = isIE8; +exports.logStr = logStr; +exports.colorLuminance = colorLuminance; + +},{}]},{},[1]) +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvVHJpc3Rhbi9kZXYvU3dlZXRBbGVydC9kZXYvc3dlZXRhbGVydC5lczYuanMiLCIvVXNlcnMvVHJpc3Rhbi9kZXYvU3dlZXRBbGVydC9kZXYvbW9kdWxlcy9kZWZhdWx0LXBhcmFtcy5qcyIsIi9Vc2Vycy9UcmlzdGFuL2Rldi9Td2VldEFsZXJ0L2Rldi9tb2R1bGVzL2hhbmRsZS1jbGljay5qcyIsIi9Vc2Vycy9UcmlzdGFuL2Rldi9Td2VldEFsZXJ0L2Rldi9tb2R1bGVzL2hhbmRsZS1kb20uanMiLCIvVXNlcnMvVHJpc3Rhbi9kZXYvU3dlZXRBbGVydC9kZXYvbW9kdWxlcy9oYW5kbGUta2V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A9IGZ1bmN0aW9uKGhleCwgbHVtKSB7XG4gIC8vIFZhbGlkYXRlIGhleCBzdHJpbmdcbiAgaGV4ID0gU3RyaW5nKGhleCkucmVwbGFjZSgvW14wLTlhLWZdL2dpLCAnJyk7XG4gIGlmIChoZXgubGVuZ3RoIDwgNikge1xuICAgIGhleCA9IGhleFswXSArIGhleFswXSArIGhleFsxXSArIGhleFsxXSArIGhleFsyXSArIGhleFsyXTtcbiAgfVxuICBsdW0gPSBsdW0gfHwgMDtcblxuICAvLyBDb252ZXJ0IHRvIGRlY2ltYWwgYW5kIGNoYW5nZSBsdW1pbm9zaXR5XG4gIHZhciByZ2IgPSAnIyc7XG4gIHZhciBjO1xuICB2YXIgaTtcblxuICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKSB7XG4gICAgYyA9IHBhcnNlSW50KGhleC5zdWJzdHIoaSAqIDIsIDIpLCAxNik7XG4gICAgYyA9IE1hdGgucm91bmQoTWF0aC5taW4oTWF0aC5tYXgoMCwgYyArIGMgKiBsdW0pLCAyNTUpKS50b1N0cmluZygxNik7XG4gICAgcmdiICs9ICgnMDAnICsgYykuc3Vic3RyKGMubGVuZ3RoKTtcbiAgfVxuXG4gIHJldHVybiByZ2I7XG59O1xuXG5cbmV4cG9ydCB7XG4gIGV4dGVuZCxcbiAgaGV4VG9SZ2IsXG4gIGlzSUU4LFxuICBsb2dTdHIsXG4gIGNvbG9yTHVtaW5hbmNlXG59O1xuIl19 + + + /* + * Use SweetAlert with RequireJS + */ + + if (typeof define === 'function' && define.amd) { + define(function () { + return sweetAlert; + }); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = sweetAlert; + } + +})(window, document); \ No newline at end of file diff --git a/node_modules/sweetalert/dist/sweetalert.css b/node_modules/sweetalert/dist/sweetalert.css new file mode 100644 index 0000000..76f159d --- /dev/null +++ b/node_modules/sweetalert/dist/sweetalert.css @@ -0,0 +1,932 @@ +body.stop-scrolling { + height: 100%; + overflow: hidden; } + +.sweet-overlay { + background-color: black; + /* IE8 */ + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + /* IE8 */ + background-color: rgba(0, 0, 0, 0.4); + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: none; + z-index: 10000; } + +.sweet-alert { + background-color: white; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + width: 478px; + padding: 17px; + border-radius: 5px; + text-align: center; + position: fixed; + left: 50%; + top: 50%; + margin-left: -256px; + margin-top: -200px; + overflow: hidden; + display: none; + z-index: 99999; } + @media all and (max-width: 540px) { + .sweet-alert { + width: auto; + margin-left: 0; + margin-right: 0; + left: 15px; + right: 15px; } } + .sweet-alert h2 { + color: #575757; + font-size: 30px; + text-align: center; + font-weight: 600; + text-transform: none; + position: relative; + margin: 25px 0; + padding: 0; + line-height: 40px; + display: block; } + .sweet-alert p { + color: #797979; + font-size: 16px; + text-align: center; + font-weight: 300; + position: relative; + text-align: inherit; + float: none; + margin: 0; + padding: 0; + line-height: normal; } + .sweet-alert fieldset { + border: none; + position: relative; } + .sweet-alert .sa-error-container { + background-color: #f1f1f1; + margin-left: -17px; + margin-right: -17px; + overflow: hidden; + padding: 0 10px; + max-height: 0; + webkit-transition: padding 0.15s, max-height 0.15s; + transition: padding 0.15s, max-height 0.15s; } + .sweet-alert .sa-error-container.show { + padding: 10px 0; + max-height: 100px; + webkit-transition: padding 0.2s, max-height 0.2s; + transition: padding 0.25s, max-height 0.25s; } + .sweet-alert .sa-error-container .icon { + display: inline-block; + width: 24px; + height: 24px; + border-radius: 50%; + background-color: #ea7d7d; + color: white; + line-height: 24px; + text-align: center; + margin-right: 3px; } + .sweet-alert .sa-error-container p { + display: inline-block; } + .sweet-alert .sa-input-error { + position: absolute; + top: 29px; + right: 26px; + width: 20px; + height: 20px; + opacity: 0; + -webkit-transform: scale(0.5); + transform: scale(0.5); + -webkit-transform-origin: 50% 50%; + transform-origin: 50% 50%; + -webkit-transition: all 0.1s; + transition: all 0.1s; } + .sweet-alert .sa-input-error::before, .sweet-alert .sa-input-error::after { + content: ""; + width: 20px; + height: 6px; + background-color: #f06e57; + border-radius: 3px; + position: absolute; + top: 50%; + margin-top: -4px; + left: 50%; + margin-left: -9px; } + .sweet-alert .sa-input-error::before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-input-error::after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-input-error.show { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); } + .sweet-alert input { + width: 100%; + box-sizing: border-box; + border-radius: 3px; + border: 1px solid #d7d7d7; + height: 43px; + margin-top: 10px; + margin-bottom: 17px; + font-size: 18px; + box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.06); + padding: 0 12px; + display: none; + -webkit-transition: all 0.3s; + transition: all 0.3s; } + .sweet-alert input:focus { + outline: none; + box-shadow: 0px 0px 3px #c4e6f5; + border: 1px solid #b4dbed; } + .sweet-alert input:focus::-moz-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input:focus:-ms-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input:focus::-webkit-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input::-moz-placeholder { + color: #bdbdbd; } + .sweet-alert input:-ms-input-placeholder { + color: #bdbdbd; } + .sweet-alert input::-webkit-input-placeholder { + color: #bdbdbd; } + .sweet-alert.show-input input { + display: block; } + .sweet-alert .sa-confirm-button-container { + display: inline-block; + position: relative; } + .sweet-alert .la-ball-fall { + position: absolute; + left: 50%; + top: 50%; + margin-left: -27px; + margin-top: 4px; + opacity: 0; + visibility: hidden; } + .sweet-alert button { + background-color: #8CD4F5; + color: white; + border: none; + box-shadow: none; + font-size: 17px; + font-weight: 500; + -webkit-border-radius: 4px; + border-radius: 5px; + padding: 10px 32px; + margin: 26px 5px 0 5px; + cursor: pointer; } + .sweet-alert button:focus { + outline: none; + box-shadow: 0 0 2px rgba(128, 179, 235, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.05); } + .sweet-alert button:hover { + background-color: #7ecff4; } + .sweet-alert button:active { + background-color: #5dc2f1; } + .sweet-alert button.cancel { + background-color: #C1C1C1; } + .sweet-alert button.cancel:hover { + background-color: #b9b9b9; } + .sweet-alert button.cancel:active { + background-color: #a8a8a8; } + .sweet-alert button.cancel:focus { + box-shadow: rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important; } + .sweet-alert button[disabled] { + opacity: .6; + cursor: default; } + .sweet-alert button.confirm[disabled] { + color: transparent; } + .sweet-alert button.confirm[disabled] ~ .la-ball-fall { + opacity: 1; + visibility: visible; + transition-delay: 0s; } + .sweet-alert button::-moz-focus-inner { + border: 0; } + .sweet-alert[data-has-cancel-button=false] button { + box-shadow: none !important; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 40px; } + .sweet-alert .sa-icon { + width: 80px; + height: 80px; + border: 4px solid gray; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + margin: 20px auto; + padding: 0; + position: relative; + box-sizing: content-box; } + .sweet-alert .sa-icon.sa-error { + border-color: #F27474; } + .sweet-alert .sa-icon.sa-error .sa-x-mark { + position: relative; + display: block; } + .sweet-alert .sa-icon.sa-error .sa-line { + position: absolute; + height: 5px; + width: 47px; + background-color: #F27474; + display: block; + top: 37px; + border-radius: 2px; } + .sweet-alert .sa-icon.sa-error .sa-line.sa-left { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + left: 17px; } + .sweet-alert .sa-icon.sa-error .sa-line.sa-right { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + right: 16px; } + .sweet-alert .sa-icon.sa-warning { + border-color: #F8BB86; } + .sweet-alert .sa-icon.sa-warning .sa-body { + position: absolute; + width: 5px; + height: 47px; + left: 50%; + top: 10px; + -webkit-border-radius: 2px; + border-radius: 2px; + margin-left: -2px; + background-color: #F8BB86; } + .sweet-alert .sa-icon.sa-warning .sa-dot { + position: absolute; + width: 7px; + height: 7px; + -webkit-border-radius: 50%; + border-radius: 50%; + margin-left: -3px; + left: 50%; + bottom: 10px; + background-color: #F8BB86; } + .sweet-alert .sa-icon.sa-info { + border-color: #C9DAE1; } + .sweet-alert .sa-icon.sa-info::before { + content: ""; + position: absolute; + width: 5px; + height: 29px; + left: 50%; + bottom: 17px; + border-radius: 2px; + margin-left: -2px; + background-color: #C9DAE1; } + .sweet-alert .sa-icon.sa-info::after { + content: ""; + position: absolute; + width: 7px; + height: 7px; + border-radius: 50%; + margin-left: -3px; + top: 19px; + background-color: #C9DAE1; } + .sweet-alert .sa-icon.sa-success { + border-color: #A5DC86; } + .sweet-alert .sa-icon.sa-success::before, .sweet-alert .sa-icon.sa-success::after { + content: ''; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + position: absolute; + width: 60px; + height: 120px; + background: white; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-icon.sa-success::before { + -webkit-border-radius: 120px 0 0 120px; + border-radius: 120px 0 0 120px; + top: -7px; + left: -33px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 60px 60px; + transform-origin: 60px 60px; } + .sweet-alert .sa-icon.sa-success::after { + -webkit-border-radius: 0 120px 120px 0; + border-radius: 0 120px 120px 0; + top: -11px; + left: 30px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 0px 60px; + transform-origin: 0px 60px; } + .sweet-alert .sa-icon.sa-success .sa-placeholder { + width: 80px; + height: 80px; + border: 4px solid rgba(165, 220, 134, 0.2); + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + box-sizing: content-box; + position: absolute; + left: -4px; + top: -4px; + z-index: 2; } + .sweet-alert .sa-icon.sa-success .sa-fix { + width: 5px; + height: 90px; + background-color: white; + position: absolute; + left: 28px; + top: 8px; + z-index: 1; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-icon.sa-success .sa-line { + height: 5px; + background-color: #A5DC86; + display: block; + border-radius: 2px; + position: absolute; + z-index: 2; } + .sweet-alert .sa-icon.sa-success .sa-line.sa-tip { + width: 25px; + left: 14px; + top: 46px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-icon.sa-success .sa-line.sa-long { + width: 47px; + right: 8px; + top: 38px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-icon.sa-custom { + background-size: contain; + border-radius: 0; + border: none; + background-position: center center; + background-repeat: no-repeat; } + +/* + * Animations + */ +@-webkit-keyframes showSweetAlert { + 0% { + transform: scale(0.7); + -webkit-transform: scale(0.7); } + 45% { + transform: scale(1.05); + -webkit-transform: scale(1.05); } + 80% { + transform: scale(0.95); + -webkit-transform: scale(0.95); } + 100% { + transform: scale(1); + -webkit-transform: scale(1); } } + +@keyframes showSweetAlert { + 0% { + transform: scale(0.7); + -webkit-transform: scale(0.7); } + 45% { + transform: scale(1.05); + -webkit-transform: scale(1.05); } + 80% { + transform: scale(0.95); + -webkit-transform: scale(0.95); } + 100% { + transform: scale(1); + -webkit-transform: scale(1); } } + +@-webkit-keyframes hideSweetAlert { + 0% { + transform: scale(1); + -webkit-transform: scale(1); } + 100% { + transform: scale(0.5); + -webkit-transform: scale(0.5); } } + +@keyframes hideSweetAlert { + 0% { + transform: scale(1); + -webkit-transform: scale(1); } + 100% { + transform: scale(0.5); + -webkit-transform: scale(0.5); } } + +@-webkit-keyframes slideFromTop { + 0% { + top: 0%; } + 100% { + top: 50%; } } + +@keyframes slideFromTop { + 0% { + top: 0%; } + 100% { + top: 50%; } } + +@-webkit-keyframes slideToTop { + 0% { + top: 50%; } + 100% { + top: 0%; } } + +@keyframes slideToTop { + 0% { + top: 50%; } + 100% { + top: 0%; } } + +@-webkit-keyframes slideFromBottom { + 0% { + top: 70%; } + 100% { + top: 50%; } } + +@keyframes slideFromBottom { + 0% { + top: 70%; } + 100% { + top: 50%; } } + +@-webkit-keyframes slideToBottom { + 0% { + top: 50%; } + 100% { + top: 70%; } } + +@keyframes slideToBottom { + 0% { + top: 50%; } + 100% { + top: 70%; } } + +.showSweetAlert[data-animation=pop] { + -webkit-animation: showSweetAlert 0.3s; + animation: showSweetAlert 0.3s; } + +.showSweetAlert[data-animation=none] { + -webkit-animation: none; + animation: none; } + +.showSweetAlert[data-animation=slide-from-top] { + -webkit-animation: slideFromTop 0.3s; + animation: slideFromTop 0.3s; } + +.showSweetAlert[data-animation=slide-from-bottom] { + -webkit-animation: slideFromBottom 0.3s; + animation: slideFromBottom 0.3s; } + +.hideSweetAlert[data-animation=pop] { + -webkit-animation: hideSweetAlert 0.2s; + animation: hideSweetAlert 0.2s; } + +.hideSweetAlert[data-animation=none] { + -webkit-animation: none; + animation: none; } + +.hideSweetAlert[data-animation=slide-from-top] { + -webkit-animation: slideToTop 0.4s; + animation: slideToTop 0.4s; } + +.hideSweetAlert[data-animation=slide-from-bottom] { + -webkit-animation: slideToBottom 0.3s; + animation: slideToBottom 0.3s; } + +@-webkit-keyframes animateSuccessTip { + 0% { + width: 0; + left: 1px; + top: 19px; } + 54% { + width: 0; + left: 1px; + top: 19px; } + 70% { + width: 50px; + left: -8px; + top: 37px; } + 84% { + width: 17px; + left: 21px; + top: 48px; } + 100% { + width: 25px; + left: 14px; + top: 45px; } } + +@keyframes animateSuccessTip { + 0% { + width: 0; + left: 1px; + top: 19px; } + 54% { + width: 0; + left: 1px; + top: 19px; } + 70% { + width: 50px; + left: -8px; + top: 37px; } + 84% { + width: 17px; + left: 21px; + top: 48px; } + 100% { + width: 25px; + left: 14px; + top: 45px; } } + +@-webkit-keyframes animateSuccessLong { + 0% { + width: 0; + right: 46px; + top: 54px; } + 65% { + width: 0; + right: 46px; + top: 54px; } + 84% { + width: 55px; + right: 0px; + top: 35px; } + 100% { + width: 47px; + right: 8px; + top: 38px; } } + +@keyframes animateSuccessLong { + 0% { + width: 0; + right: 46px; + top: 54px; } + 65% { + width: 0; + right: 46px; + top: 54px; } + 84% { + width: 55px; + right: 0px; + top: 35px; } + 100% { + width: 47px; + right: 8px; + top: 38px; } } + +@-webkit-keyframes rotatePlaceholder { + 0% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 5% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 12% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } + 100% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } } + +@keyframes rotatePlaceholder { + 0% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 5% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 12% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } + 100% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } } + +.animateSuccessTip { + -webkit-animation: animateSuccessTip 0.75s; + animation: animateSuccessTip 0.75s; } + +.animateSuccessLong { + -webkit-animation: animateSuccessLong 0.75s; + animation: animateSuccessLong 0.75s; } + +.sa-icon.sa-success.animate::after { + -webkit-animation: rotatePlaceholder 4.25s ease-in; + animation: rotatePlaceholder 4.25s ease-in; } + +@-webkit-keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg); + -webkit-transform: rotateX(100deg); + opacity: 0; } + 100% { + transform: rotateX(0deg); + -webkit-transform: rotateX(0deg); + opacity: 1; } } + +@keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg); + -webkit-transform: rotateX(100deg); + opacity: 0; } + 100% { + transform: rotateX(0deg); + -webkit-transform: rotateX(0deg); + opacity: 1; } } + +.animateErrorIcon { + -webkit-animation: animateErrorIcon 0.5s; + animation: animateErrorIcon 0.5s; } + +@-webkit-keyframes animateXMark { + 0% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 50% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 80% { + transform: scale(1.15); + -webkit-transform: scale(1.15); + margin-top: -6px; } + 100% { + transform: scale(1); + -webkit-transform: scale(1); + margin-top: 0; + opacity: 1; } } + +@keyframes animateXMark { + 0% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 50% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 80% { + transform: scale(1.15); + -webkit-transform: scale(1.15); + margin-top: -6px; } + 100% { + transform: scale(1); + -webkit-transform: scale(1); + margin-top: 0; + opacity: 1; } } + +.animateXMark { + -webkit-animation: animateXMark 0.5s; + animation: animateXMark 0.5s; } + +@-webkit-keyframes pulseWarning { + 0% { + border-color: #F8D486; } + 100% { + border-color: #F8BB86; } } + +@keyframes pulseWarning { + 0% { + border-color: #F8D486; } + 100% { + border-color: #F8BB86; } } + +.pulseWarning { + -webkit-animation: pulseWarning 0.75s infinite alternate; + animation: pulseWarning 0.75s infinite alternate; } + +@-webkit-keyframes pulseWarningIns { + 0% { + background-color: #F8D486; } + 100% { + background-color: #F8BB86; } } + +@keyframes pulseWarningIns { + 0% { + background-color: #F8D486; } + 100% { + background-color: #F8BB86; } } + +.pulseWarningIns { + -webkit-animation: pulseWarningIns 0.75s infinite alternate; + animation: pulseWarningIns 0.75s infinite alternate; } + +@-webkit-keyframes rotate-loading { + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); } } + +@keyframes rotate-loading { + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); } } + +/* Internet Explorer 9 has some special quirks that are fixed here */ +/* The icons are not animated. */ +/* This file is automatically merged into sweet-alert.min.js through Gulp */ +/* Error icon */ +.sweet-alert .sa-icon.sa-error .sa-line.sa-left { + -ms-transform: rotate(45deg) \9; } + +.sweet-alert .sa-icon.sa-error .sa-line.sa-right { + -ms-transform: rotate(-45deg) \9; } + +/* Success icon */ +.sweet-alert .sa-icon.sa-success { + border-color: transparent\9; } + +.sweet-alert .sa-icon.sa-success .sa-line.sa-tip { + -ms-transform: rotate(45deg) \9; } + +.sweet-alert .sa-icon.sa-success .sa-line.sa-long { + -ms-transform: rotate(-45deg) \9; } + +/*! + * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/) + * Copyright 2015 Daniel Cardoso <@DanielCardoso> + * Licensed under MIT + */ +.la-ball-fall, +.la-ball-fall > div { + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +.la-ball-fall { + display: block; + font-size: 0; + color: #fff; } + +.la-ball-fall.la-dark { + color: #333; } + +.la-ball-fall > div { + display: inline-block; + float: none; + background-color: currentColor; + border: 0 solid currentColor; } + +.la-ball-fall { + width: 54px; + height: 18px; } + +.la-ball-fall > div { + width: 10px; + height: 10px; + margin: 4px; + border-radius: 100%; + opacity: 0; + -webkit-animation: ball-fall 1s ease-in-out infinite; + -moz-animation: ball-fall 1s ease-in-out infinite; + -o-animation: ball-fall 1s ease-in-out infinite; + animation: ball-fall 1s ease-in-out infinite; } + +.la-ball-fall > div:nth-child(1) { + -webkit-animation-delay: -200ms; + -moz-animation-delay: -200ms; + -o-animation-delay: -200ms; + animation-delay: -200ms; } + +.la-ball-fall > div:nth-child(2) { + -webkit-animation-delay: -100ms; + -moz-animation-delay: -100ms; + -o-animation-delay: -100ms; + animation-delay: -100ms; } + +.la-ball-fall > div:nth-child(3) { + -webkit-animation-delay: 0ms; + -moz-animation-delay: 0ms; + -o-animation-delay: 0ms; + animation-delay: 0ms; } + +.la-ball-fall.la-sm { + width: 26px; + height: 8px; } + +.la-ball-fall.la-sm > div { + width: 4px; + height: 4px; + margin: 2px; } + +.la-ball-fall.la-2x { + width: 108px; + height: 36px; } + +.la-ball-fall.la-2x > div { + width: 20px; + height: 20px; + margin: 8px; } + +.la-ball-fall.la-3x { + width: 162px; + height: 54px; } + +.la-ball-fall.la-3x > div { + width: 30px; + height: 30px; + margin: 12px; } + +/* + * Animation + */ +@-webkit-keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + transform: translateY(145%); } } + +@-moz-keyframes ball-fall { + 0% { + opacity: 0; + -moz-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -moz-transform: translateY(145%); + transform: translateY(145%); } } + +@-o-keyframes ball-fall { + 0% { + opacity: 0; + -o-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -o-transform: translateY(145%); + transform: translateY(145%); } } + +@keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + -moz-transform: translateY(-145%); + -o-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + -moz-transform: translateY(145%); + -o-transform: translateY(145%); + transform: translateY(145%); } } diff --git a/node_modules/sweetalert/dist/sweetalert.min.js b/node_modules/sweetalert/dist/sweetalert.min.js new file mode 100644 index 0000000..5c997b4 --- /dev/null +++ b/node_modules/sweetalert/dist/sweetalert.min.js @@ -0,0 +1 @@ +!function(e,t,n){"use strict";!function o(e,t,n){function a(s,l){if(!t[s]){if(!e[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return a(n?n:t)},c,c.exports,o,e,t,n)}return t[s].exports}for(var r="function"==typeof require&&require,s=0;s=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},i=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},u=function(e){e.style.opacity="",e.style.display="block"},c=function(e){if(e&&!e.length)return u(e);for(var t=0;t0?setTimeout(o,t):e.style.display="none"});o()},h=function(n){if("function"==typeof MouseEvent){var o=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent("MouseEvents");a.initEvent("click",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},b=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};a.hasClass=r,a.addClass=s,a.removeClass=l,a.escapeHtml=i,a._show=u,a.show=c,a._hide=d,a.hide=f,a.isDescendant=p,a.getTopMargin=m,a.fadeIn=v,a.fadeOut=y,a.fireClick=h,a.stopEventPropagation=b},{}],5:[function(t,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=t("./handle-dom"),s=t("./handle-swal-dom"),l=function(t,o,a){var l=t||e.event,i=l.keyCode||l.which,u=a.querySelector("button.confirm"),c=a.querySelector("button.cancel"),d=a.querySelectorAll("button[tabindex]");if(-1!==[9,13,32,27].indexOf(i)){for(var f=l.target||l.srcElement,p=-1,m=0;m"),i.innerHTML=e.html?e.text:s.escapeHtml(e.text||"").split("\n").join("
"),e.text&&s.show(i),e.customClass)s.addClass(t,e.customClass),t.setAttribute("data-custom-class",e.customClass);else{var d=t.getAttribute("data-custom-class");s.removeClass(t,d),t.setAttribute("data-custom-class","")}if(s.hide(t.querySelectorAll(".sa-icon")),e.type&&!a.isIE8()){var f=function(){for(var o=!1,a=0;ao;o++)n=parseInt(e.substr(2*o,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),a+=("00"+n).substr(n.length);return a};o.extend=a,o.hexToRgb=r,o.isIE8=s,o.logStr=l,o.colorLuminance=i},{}]},{},[1]),"function"==typeof define&&define.amd?define(function(){return sweetAlert}):"undefined"!=typeof module&&module.exports&&(module.exports=sweetAlert)}(window,document); \ No newline at end of file diff --git a/node_modules/sweetalert/example/example.css b/node_modules/sweetalert/example/example.css new file mode 100644 index 0000000..c9bbe7a --- /dev/null +++ b/node_modules/sweetalert/example/example.css @@ -0,0 +1,442 @@ +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300); +@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700); +body { + background-color: #f2f4f6; + font-family: 'Open Sans', sans-serif; + text-align: center; } + +h1 { + background-image: url("images/logo_big.png"); + background-image: -webkit-image-set(url("images/logo_big.png") 1x, url("images/logo_big@2x.png") 2x); + width: 385px; + height: 81px; + text-indent: -9999px; + white-space: nowrap; + margin: 50px auto; } + @media all and (max-width: 420px) { + h1 { + width: 300px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; } } + @media all and (max-width: 330px) { + h1 { + width: 250px; } } + +h2 { + font-size: 20px; + color: #A9B2BC; + line-height: 25px; + text-transform: uppercase; + font-weight: 300; + text-align: center; + display: block; } + +h3 { + font-size: 28px; + color: #C7CCD1; + text-transform: uppercase; + font-family: 'Open Sans Condensed', sans-serif; + margin-top: 100px; + text-align: center; + position: relative; } + h3#download-section { + margin-top: 50px; + padding-top: 40px; } + h3::after { + content: ""; + background-color: #e2e5e8; + height: 4px; + width: 700px; + left: 50%; + margin-left: -350px; + position: absolute; + margin-top: -50px; + border-radius: 2px; } + @media all and (max-width: 740px) { + h3::after { + width: auto; + left: 20px; + right: 20px; + margin-left: 0; } } + +a { + text-decoration: none; } + +p { + max-width: 826px; + margin: 30px auto; + font-size: 17px; + font-weight: 300; + color: #848D94; + line-height: 25px; + text-align: left; } + p.center { + text-align: center; } + p strong { + color: #8A8F94; + font-weight: 600; } + p a { + color: #9ECADF; + font-weight: 600; } + p a:hover { + text-decoration: underline; } + p a.twitter { + color: #5eaade; } + p a.dribbble { + color: #f26798; } + p a.github { + color: #323131; } + +button, .button { + background-color: #AEDEF4; + color: white; + border: none; + box-shadow: none; + font-size: 17px; + font-weight: 500; + font-weight: 600; + border-radius: 3px; + padding: 15px 35px; + margin: 26px 5px 0 5px; + cursor: pointer; } + button:focus, .button:focus { + outline: none; } + button:hover, .button:hover { + background-color: #a1d9f2; } + button:active, .button:active { + background-color: #81ccee; } + button.cancel, .button.cancel { + background-color: #D0D0D0; } + button.cancel:hover, .button.cancel:hover { + background-color: #c8c8c8; } + button.cancel:active, .button.cancel:active { + background-color: #b6b6b6; } + button.download, .button.download { + position: fixed; + right: 30px; + top: 0; + background-color: rgba(255, 255, 255, 0.9); + color: #ABCADA; + font-weight: 500; + text-transform: uppercase; + z-index: 3; } + @media all and (max-width: 1278px) { + button.download, .button.download { + display: none; } } + +.center-container { + max-width: 700px; + margin: 70px auto; } + +pre { + background-color: #49483e; + color: #f8f8f2; + padding: 10px; + border-radius: 5px; + white-space: pre-line; + text-align: left; + font-size: 14px; + max-width: 600px; } + pre .str { + color: #e6db74; } + pre .func { + color: #66d9ef; } + pre .val { + color: #a381ff; } + pre .tag { + color: #e92772; } + pre .attr { + color: #a6e22d; } + pre .arg { + color: #fd9720; } + +.showcase { + background-color: #eceef0; + padding: 20px; + display: inline-block; + width: 383px; + vertical-align: top; + position: relative; } + @media all and (max-width: 865px) { + .showcase { + margin: 5px auto; + padding: 46px 20px; } } + @media all and (max-width: 440px) { + .showcase { + width: auto; } } + .showcase h4 { + font-size: 16px; + color: #BCBCBC; + line-height: 22px; + margin: 0 auto; + font-weight: 400; } + .showcase.sweet h4 { + width: 117px; + height: 25px; + margin-top: -3px; + text-indent: -9999px; + background-image: url("images/logo_small.png"); + background-image: -webkit-image-set(url("images/logo_small.png") 1x, url("images/logo_small@2x.png") 2x); } + .showcase h5 { + margin-bottom: -7px; + text-align: left; + font-weight: 500; + text-transform: uppercase; + color: #c2c2c2; } + .showcase button { + margin-bottom: 10px; } + .showcase .vs-icon { + background-image: url("images/vs_icon.png"); + background-image: -webkit-image-set(url("images/vs_icon.png") 1x, url("images/vs_icon@2x.png") 2x); + width: 69px; + height: 69px; + position: absolute; + right: -34px; + top: 60px; + z-index: 2; } + @media all and (max-width: 865px) { + .showcase .vs-icon { + margin: 5px auto; + right: auto; + left: 50%; + margin-left: -35px; + top: auto; + bottom: -35px; } } + +ul.examples { + list-style-type: none; + width: 700px; + margin: 0 auto; + text-align: left; + padding-left: 0; } + @media all and (max-width: 758px) { + ul.examples { + width: auto; } } + ul.examples li { + padding-left: 0; } + ul.examples .ui, ul.examples pre { + display: inline-block; + vertical-align: top; } + @media all and (max-width: 758px) { + ul.examples .ui, ul.examples pre { + display: block; + max-width: none; + margin: 0 auto; } } + ul.examples .ui { + width: 300px; + text-align: center; } + ul.examples .ui button { + margin-top: 12px; } + ul.examples .ui p { + text-align: center; + margin-bottom: 0; } + ul.examples pre { + max-width: 370px; + margin-top: 67px; } + @media all and (max-width: 758px) { + ul.examples pre { + margin-top: 16px !important; + margin-bottom: 60px; } } + ul.examples .warning pre { + margin-top: 93px; } + +ol { + max-width: 700px; + margin: 70px auto; + list-style-position: inside; + padding-left: 0; } + ol li { + color: #A7ADB2; } + ol li p { + margin-bottom: 10px; } + +table { + width: 700px; + font-size: 14px; + color: #8a8f94; + margin: 10px auto; + text-align: left; + border-collapse: collapse; } + @media all and (max-width: 750px) { + table { + width: auto; + margin: 10px 20px; } } + table th { + background-color: white; + padding: 9px; + color: #acb9be; + font-weight: 400; + text-align: center; + position: relative; } + table th .border-left, table th .border-right { + position: absolute; + background-color: white; + border-radius: 50%; + top: 0; + left: -17px; + width: 37px; + height: 37px; } + table th .border-right { + left: auto; + right: -17px; } + @media all and (max-width: 750px) { + table th:nth-child(2) { + display: none; } } + table td { + padding: 10px 20px; + vertical-align: top; } + table td:first-child { + padding-left: 0px; } + table td:last-child { + padding-right: 0px; } + @media all and (max-width: 750px) { + table td:nth-child(2) { + display: none; } } + @media all and (max-width: 360px) { + table td { + padding: 10px 4px; } + table td b { + font-size: 13px; } } + +footer { + margin-top: 100px; + padding-bottom: 30px; + color: #9A999F; + display: inline-block; + position: relative; + color: gray; + font-weight: 400; + color: #93a1aa; + font-weight: 300; } + footer .te-logo { + text-indent: -99999px; + background-size: contain; + background-repeat: no-repeat; + background-position: center center; + height: 16px; + width: 16px; + display: inline-block; + margin-right: 5px; + background-image: url("images/te-logo-small.svg"); + position: absolute; + left: -22px; + top: 3px; } + +.sweet-alert.twitter { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 15px; + padding-top: 55px; + text-align: right; + border-radius: 6px; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.11), 0px 6px 30px rgba(0, 0, 0, 0.14); } + .sweet-alert.twitter ~ .sweet-overlay { + background: rgba(41, 47, 51, 0.9); } + .sweet-alert.twitter h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 40px; + line-height: 40px; + font-size: 16px; + font-weight: 400; + color: #8899a6; + margin: 0; + color: #66757f; + border-bottom: 1px solid #e1e8ed; } + .sweet-alert.twitter p { + display: block; + text-align: center; + color: #66757f; + font-weight: 400; + font-size: 13px; + margin-top: 7px; } + .sweet-alert.twitter .sa-button-container { + background-color: #f5f8fa; + border-top: 1px solid #e1e8ed; + box-shadow: 0px -1px 0px white; + margin: -15px; + margin-top: 0; } + .sweet-alert.twitter[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; } + .sweet-alert.twitter[data-has-confirm-button=false][data-has-cancel-button=false] .sa-button-container { + display: none; } + .sweet-alert.twitter button { + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3); + margin: 17px 0px; + border-radius: 4px; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; } + .sweet-alert.twitter button:focus, .sweet-alert.twitter button.cancel:focus { + box-shadow: none !important; } + .sweet-alert.twitter button:focus::before, .sweet-alert.twitter button.cancel:focus::before { + content: ""; + position: absolute; + left: -5px; + top: -5px; + right: -5px; + bottom: -5px; + border: 2px solid #a5b0b4; + border-radius: 8px; } + .sweet-alert.twitter button.confirm { + background-color: #55acee !important; + background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#0C000000)"; + border: 1px solid #3b88c3; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15); + margin-right: 15px; } + .sweet-alert.twitter button.confirm:hover { + background-color: #55acee; + background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.15)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#26000000)"; + border-color: #3b88c3; } + .sweet-alert.twitter button.cancel { + color: #66757e; + background-color: #f5f8fa; + background-image: linear-gradient(#fff, #f5f8fa); + text-shadow: 0px -1px 0px white; + margin-right: 9px; + border: 1px solid #e1e8ed; } + .sweet-alert.twitter button.cancel:hover, .sweet-alert.twitter button.cancel:focus:hover { + background-color: #e1e8ed; + background-image: linear-gradient(#fff, #e1e8ed); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(enabled=false)"; + border-color: #e1e8ed; } + .sweet-alert.twitter button.cancel:focus { + background: #fff; + border-color: #fff; } + .sweet-alert.twitter .sa-icon { + transform: scale(0.72); + margin-bottom: -2px; + margin-top: -10px; } + .sweet-alert.twitter input { + border: 1px solid #e1e8ed; + border-radius: 3px; + padding: 10px 7px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; } + .sweet-alert.twitter input:focus { + border-color: #94A1A6; + box-shadow: inset 0 0 0 1px rgba(77, 99, 107, 0.7); } + .sweet-alert.twitter fieldset .sa-input-error { + display: none; } + .sweet-alert.twitter .sa-error-container { + text-align: center; + border: none; + background-color: #fbedc0; + margin-bottom: 6px; } + .sweet-alert.twitter .sa-error-container.show { + border: 1px solid #f0e1b9; } + .sweet-alert.twitter .sa-error-container .icon { + display: none; } + .sweet-alert.twitter .sa-error-container p { + color: #292f33; + font-weight: 600; + margin-top: 0; } diff --git a/node_modules/sweetalert/example/example.scss b/node_modules/sweetalert/example/example.scss new file mode 100644 index 0000000..b915a10 --- /dev/null +++ b/node_modules/sweetalert/example/example.scss @@ -0,0 +1,580 @@ +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300); // Open Sans font +@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700); // Condensed + +@mixin retina-background($url, $type:png) { + background-image: url("#{$url}.#{$type}"); + background-image: -webkit-image-set(url("#{$url}.#{$type}") 1x, + url("#{$url}@2x.#{$type}") 2x); +} + +body { + background-color: #f2f4f6; + font-family: 'Open Sans', sans-serif; + text-align: center; +} + +h1 { + @include retina-background("images/logo_big"); + width: 385px; + height: 81px; + text-indent: -9999px; + white-space: nowrap; + margin: 50px auto; + @media all and (max-width: 420px) { + width: 300px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + } + @media all and (max-width: 330px) { + width: 250px; + } +} +h2 { + font-size: 20px; + color: #A9B2BC; + line-height: 25px; + text-transform: uppercase; + font-weight: 300; + text-align: center; + display: block; +} +h3 { + font-size: 28px; + color: #C7CCD1; + text-transform: uppercase; + font-family: 'Open Sans Condensed', sans-serif; + margin-top: 100px; + text-align: center; + position: relative; + &#download-section { + margin-top: 50px; + padding-top: 40px; + } + &::after { + content: ""; + background-color: #e2e5e8; + height: 4px; + width: 700px; + left: 50%; + margin-left: -350px; + position: absolute; + margin-top: -50px; + border-radius: 2px; + + @media all and (max-width: 740px) { + width: auto; + left: 20px; + right: 20px; + margin-left: 0; + } + } +} + +a { + text-decoration: none; +} + +p { + max-width: 826px; + margin: 30px auto; + font-size: 17px; + font-weight: 300; + color: #848D94; + line-height: 25px; + text-align: left; + &.center { + text-align: center; + } + + strong { + color: #8A8F94; + font-weight: 600; + } + a { + color: #9ECADF; + font-weight: 600; + &:hover { + text-decoration: underline; + } + &.twitter { + color: #5eaade; + } + &.dribbble { + color: #f26798; + } + &.github { + color: #323131; + } + } +} + +button, .button { + $btnBlue: #AEDEF4; + $btnGray: #D0D0D0; + + background-color: $btnBlue; + color: white; + border: none; + box-shadow: none; + font-size: 17px; + font-weight: 500; + font-weight: 600; + border-radius: 3px; + padding: 15px 35px; + margin: 26px 5px 0 5px; + cursor: pointer; + &:focus { + outline: none; + } + &:hover { + background-color: darken($btnBlue, 3%); + } + &:active { + background-color: darken($btnBlue, 10%); + } + &.cancel { + background-color: $btnGray; + &:hover { + background-color: darken($btnGray, 3%); + } + &:active { + background-color: darken($btnGray, 10%); + } + } + &.download { + position: fixed; + right: 30px; + top: 0; + background-color: rgba(white, 0.9); + color: #ABCADA; + font-weight: 500; + text-transform: uppercase; + z-index: 3; + + @media all and (max-width: 1278px) { + display: none; + } + } +} + +.center-container { + max-width: 700px; + margin: 70px auto; +} + +pre { + background-color: #49483e; + color: #f8f8f2; + padding: 10px; + border-radius: 5px; + white-space: pre-line; + text-align: left; + font-size: 14px; + max-width: 600px; + + .str { + color: #e6db74; + } + .func { + color: #66d9ef; + } + .val { + color: #a381ff; + } + .tag { + color: #e92772; + } + .attr { + color: #a6e22d; + } + .arg { + color: #fd9720; + } +} + +.showcase { + background-color: #eceef0; + padding: 20px; + display: inline-block; + width: 383px; + vertical-align: top; + position: relative; + + @media all and (max-width: 865px) { + margin: 5px auto; + padding: 46px 20px; + } + @media all and (max-width: 440px) { + width: auto; + } + + h4 { + font-size: 16px; + color: #BCBCBC; + line-height: 22px; + margin: 0 auto; + font-weight: 400; + } + &.sweet h4 { + width: 117px; + height: 25px; + margin-top: -3px; + text-indent: -9999px; + @include retina-background("images/logo_small"); + } + h5 { + margin-bottom: -7px; + text-align: left; + font-weight: 500; + text-transform: uppercase; + color: rgb(194, 194, 194); + } + + button { + margin-bottom: 10px; + } + + .vs-icon { + @include retina-background("images/vs_icon"); + width: 69px; + height: 69px; + position: absolute; + right: -34px; + top: 60px; + z-index: 2; + + @media all and (max-width: 865px) { + margin: 5px auto; + right: auto; + left: 50%; + margin-left: -35px; + top: auto; + bottom: -35px; + } + } +} + + +ul.examples { + list-style-type: none; + width: 700px; + margin: 0 auto; + text-align: left; + padding-left: 0; + @media all and (max-width: 758px) { + width: auto; + } + + li { + padding-left: 0; + } + + .ui, pre { + display: inline-block; + vertical-align: top; + + @media all and (max-width: 758px) { + display: block; + max-width: none; + margin: 0 auto; + } + } + .ui { + width: 300px; + text-align: center; + + button { + margin-top: 12px; + } + + p { + text-align: center; + margin-bottom: 0; + } + } + + pre { + max-width: 370px; + margin-top: 67px; + + @media all and (max-width: 758px) { + margin-top: 16px !important; + margin-bottom: 60px; + } + } + .warning pre { + margin-top: 93px; + } +} + + +ol { + max-width: 700px; + margin: 70px auto; + list-style-position: inside; + padding-left: 0; + + li { + color: #A7ADB2; + + p { + margin-bottom: 10px; + } + } +} + + +table { + width: 700px; + font-size: 14px; + color: #8a8f94; + margin: 10px auto; + text-align: left; + border-collapse: collapse; + @media all and (max-width: 750px) { + width: auto; + margin: 10px 20px; + } + + th { + background-color: white; + padding: 9px; + color: rgb(172, 185, 190); + font-weight: 400; + text-align: center; + position: relative; + .border-left, .border-right { + position: absolute; + background-color: white; + border-radius: 50%; + top: 0; + left: -17px; + width: 37px; + height: 37px; + } + .border-right { + left: auto; + right: -17px; + } + @media all and (max-width: 750px) { + &:nth-child(2) { + display: none; + } + } + } + + td { + padding: 10px 20px; + vertical-align: top; + &:first-child { + padding-left: 0px; + } + &:last-child { + padding-right: 0px; + } + @media all and (max-width: 750px) { + &:nth-child(2) { + display: none; + } + } + @media all and (max-width: 360px) { + padding: 10px 4px; + b { + font-size: 13px; + } + } + } +} + +footer { + margin-top: 100px; + padding-bottom: 30px; + color: #9A999F; + display: inline-block; + position: relative; + color: gray; + font-weight: 400; + color: rgb(147, 161, 170); + font-weight: 300; + + .te-logo { + text-indent: -99999px; + background-size: contain; + background-repeat: no-repeat; + background-position: center center; + height: 16px; + width: 16px; + display: inline-block; + margin-right: 5px; + background-image: url("images/te-logo-small.svg"); + position: absolute; + left: -22px; + top: 3px; + } +} + + +// Theme example (Twitter) +// Twitter Theme for SweetAlert +// By Tristan Edwards + +.sweet-alert.twitter { + $header-height: 40px; + $footer-height: 66px; + $text-color: #66757f; + $padding: 15px; + + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: $padding; + padding-top: $header-height + $padding; + text-align: right; // Align buttons + border-radius: 6px; + box-shadow: 0px 0px 0px 1px rgba(black, 0.11), 0px 6px 30px rgba(black, 0.14); + + ~ .sweet-overlay { + background: rgba(41,47,51,0.9); + } + + h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: $header-height; + line-height: $header-height; + font-size: 16px; + font-weight: 400; + color: #8899a6; + margin: 0; + color: $text-color; + border-bottom: 1px solid #e1e8ed; + } + + p { + display: block; + text-align: center; + color: #66757f; + font-weight: 400; + font-size: 13px; + margin-top: 7px; + } + + .sa-button-container { + background-color: #f5f8fa; + border-top: 1px solid #e1e8ed; + box-shadow: 0px -1px 0px white; + margin: -$padding; + margin-top: 0; + } + &[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; + .sa-button-container { + display: none; + } + } + + button { + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(black, 0.3); + margin: 17px 0px; + border-radius: 4px; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; + &:focus, &.cancel:focus { + box-shadow: none !important; + &::before { + content: ""; + position: absolute; + left: -5px; + top: -5px; + right: -5px; + bottom: -5px; + border: 2px solid #a5b0b4; + border-radius: 8px; + } + } + + &.confirm { + background-color: #55acee !important; + background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.05)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#0C000000)"; + border: 1px solid #3b88c3; + box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); + margin-right: $padding; + &:hover { + background-color: #55acee; + background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.15)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#26000000)"; + border-color: #3b88c3; + } + } + &.cancel { + color: #66757e; + background-color: #f5f8fa; + background-image: linear-gradient(#fff,#f5f8fa); + text-shadow: 0px -1px 0px white; + margin-right: 9px; + border: 1px solid #e1e8ed; + &:hover, &:focus:hover { + background-color: #e1e8ed; + background-image: linear-gradient(#fff,#e1e8ed); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(enabled=false)"; + border-color: #e1e8ed; + } + &:focus { + background: #fff; + border-color: #fff; + } + } + } + + .sa-icon { + transform: scale(0.72); + margin-bottom: -2px; + margin-top: -10px; + } + + input { + border: 1px solid #e1e8ed; + border-radius: 3px; + padding: 10px 7px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; + &:focus { + border-color: #94A1A6; + box-shadow: inset 0 0 0 1px rgba(77, 99, 107, 0.7); + } + } + + fieldset .sa-input-error { + display: none; + } + + .sa-error-container { + text-align: center; + border: none; + background-color: #fbedc0; + margin-bottom: 6px; + &.show { + border: 1px solid #f0e1b9; + } + + .icon { + display: none; + } + p { + color: #292f33; + font-weight: 600; + margin-top: 0; + } + } +} + + + diff --git a/node_modules/sweetalert/example/images/logo_big.png b/node_modules/sweetalert/example/images/logo_big.png new file mode 100644 index 0000000..115df19 Binary files /dev/null and b/node_modules/sweetalert/example/images/logo_big.png differ diff --git a/node_modules/sweetalert/example/images/logo_big@2x.png b/node_modules/sweetalert/example/images/logo_big@2x.png new file mode 100644 index 0000000..f2e9b8f Binary files /dev/null and b/node_modules/sweetalert/example/images/logo_big@2x.png differ diff --git a/node_modules/sweetalert/example/images/logo_small.png b/node_modules/sweetalert/example/images/logo_small.png new file mode 100644 index 0000000..710365f Binary files /dev/null and b/node_modules/sweetalert/example/images/logo_small.png differ diff --git a/node_modules/sweetalert/example/images/logo_small@2x.png b/node_modules/sweetalert/example/images/logo_small@2x.png new file mode 100644 index 0000000..151b7c0 Binary files /dev/null and b/node_modules/sweetalert/example/images/logo_small@2x.png differ diff --git a/node_modules/sweetalert/example/images/te-logo-small.svg b/node_modules/sweetalert/example/images/te-logo-small.svg new file mode 100644 index 0000000..88c8b6b --- /dev/null +++ b/node_modules/sweetalert/example/images/te-logo-small.svg @@ -0,0 +1,12 @@ + + + + te-logo-small + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/node_modules/sweetalert/example/images/thumbs-up.jpg b/node_modules/sweetalert/example/images/thumbs-up.jpg new file mode 100644 index 0000000..3e7c747 Binary files /dev/null and b/node_modules/sweetalert/example/images/thumbs-up.jpg differ diff --git a/node_modules/sweetalert/example/images/vs_icon.png b/node_modules/sweetalert/example/images/vs_icon.png new file mode 100644 index 0000000..2fbcb48 Binary files /dev/null and b/node_modules/sweetalert/example/images/vs_icon.png differ diff --git a/node_modules/sweetalert/example/images/vs_icon@2x.png b/node_modules/sweetalert/example/images/vs_icon@2x.png new file mode 100644 index 0000000..97c8fba Binary files /dev/null and b/node_modules/sweetalert/example/images/vs_icon@2x.png differ diff --git a/node_modules/sweetalert/gulpfile.js b/node_modules/sweetalert/gulpfile.js new file mode 100644 index 0000000..31f8c0a --- /dev/null +++ b/node_modules/sweetalert/gulpfile.js @@ -0,0 +1,108 @@ +var gulp = require('gulp'); + +var glob = require('glob'); +var path = require('path'); +var jshint = require('gulp-jshint'); +var sass = require('gulp-sass'); +var concat = require('gulp-concat'); +var uglify = require('gulp-uglify'); +var rename = require('gulp-rename'); +var minifyCSS = require('gulp-minify-css'); +var babelify = require('babelify'); +var browserify = require('browserify'); +var source = require('vinyl-source-stream'); +var buffer = require('vinyl-buffer'); +var wrap = require('gulp-wrap'); +var qunit = require('gulp-qunit'); +var babel = require('gulp-babel'); + +// Lint Task +gulp.task('lint', function() { + gulp.src('dev/sweetalert.es6.js') + .pipe(jshint()) + .pipe(jshint.reporter('default')); + + return gulp.src('dev/*/*.js') + .pipe(jshint()) + .pipe(jshint.reporter('default')); +}); + +// Compile Our Sass +gulp.task('sass', function() { + + gulp.src('example/example.scss') + .pipe(sass()) + .pipe(rename('example.css')) + .pipe(gulp.dest('example')); + + // (We don't use minifyCSS since it breaks the ie9 file for some reason) + gulp.src(['dev/sweetalert.scss', 'dev/ie9.css', 'dev/loader-animation.css']) + .pipe(sass()) + .pipe(concat('sweetalert.css')) + .pipe(gulp.dest('dist')); +}); + + +// Compile theme CSS +var themes = glob.sync('themes/*').map(function(themeDir) { + return path.basename(themeDir); +}); + +themes.forEach(function(name) { + gulp.task(name + '-theme', function() { + return gulp.src('themes/' + name + '/' + name + '.scss') + .pipe(sass()) // etc + .pipe(rename(name + '.css')) + .pipe(gulp.dest('themes/' + name)) + }); +}); + +gulp.task('themes', themes.map(function(name){ return name + '-theme'; })); + +// Compile ES5 CommonJS entry point +gulp.task('commonjs', function() { + gulp.src('./dev/sweetalert.es6.js') + .pipe(babel()) + .pipe(rename('sweetalert.js')) + .pipe(gulp.dest('lib')); + gulp.src('./dev/modules/*.js') + .pipe(babel()) + .pipe(gulp.dest('lib/modules')); +}); + +// Concatenate & Minify JS +gulp.task('scripts', function() { + return browserify({ + entries: './dev/sweetalert.es6.js', + debug: true + }) + .transform(babelify) + .bundle() + .pipe(source('sweetalert-dev.js')) + .pipe(wrap({ + src: './dev/gulpfile-wrap-template.js' + })) + .pipe(gulp.dest('dist')) // Developer version + + .pipe(rename('sweetalert.min.js')) + .pipe(buffer()) + .pipe(uglify()) + .pipe(gulp.dest('dist')); // User version +}); + +gulp.task('test', function() { + return gulp.src('./test/index.html') + .pipe(qunit({ + timeout: 20 + })); +}); + +// Watch Files For Changes +gulp.task('watch', function() { + gulp.watch(['dev/*.js', 'dev/*/*.js'], ['lint', 'scripts']); + gulp.watch(['dev/*.scss', 'dev/*.css'], ['sass']); + gulp.watch('themes/*/*.scss', ['themes']); +}); + +// Default Task +gulp.task('default', ['lint', 'sass', 'scripts', 'commonjs', 'watch', 'test']); diff --git a/node_modules/sweetalert/index.html b/node_modules/sweetalert/index.html new file mode 100644 index 0000000..5f2b6ff --- /dev/null +++ b/node_modules/sweetalert/index.html @@ -0,0 +1,584 @@ + + + + + + + + SweetAlert + + + + + + + + + + + + + +

Sweet Alert

+

A beautiful replacement for JavaScript's "Alert"

+ + + +

So... What does it do?

+

Here’s a comparison of a standard error message. The first one uses the built-in alert-function, while the second is using sweetAlert.

+ +
+

Normal alert

+ + +
Code:
+
alert("Oops... Something went wrong!");
+
+	
+ +
+
+ +
+

Sweet Alert

+ + +
Code:
+
sweetAlert("Oops...", "Something went wrong!", "error");
+
+ +

Pretty cool huh? SweetAlert automatically centers itself on the page and looks great no matter if you're using a desktop computer, mobile or tablet. It's even highly customizeable, as you can see below!

+ + + +

More examples

+ +

In these examples, we're using the shorthand function swal to call sweetAlert.

+ +
    + +
  • +
    +

    A basic message

    + +
    +
    swal("Here's a message!")
    +
  • + +
  • +
    +

    A title with a text under

    + +
    +
    swal("Here's a message!", "It's pretty, isn't it?")
    +
  • + +
  • +
    +

    A success message!

    + +
    +
    swal("Good job!", "You clicked the button!", "success")
    +
  • + +
  • +
    +

    A warning message, with a function attached to the "Confirm"-button...

    + +
    +
    swal({
    +  title: "Are you sure?",
    +  text: "You will not be able to recover this imaginary file!",
    +  type: "warning",
    +  showCancelButton: true,
    +  confirmButtonColor: "#DD6B55",
    +  confirmButtonText: "Yes, delete it!",
    +  closeOnConfirm: false
    +},
    +function(){
    +  swal("Deleted!", "Your imaginary file has been deleted.", "success");
    +});
    +
  • + +
  • +
    +

    ... and by passing a parameter, you can execute something else for "Cancel".

    + +
    +
    swal({
    +  title: "Are you sure?",
    +  text: "You will not be able to recover this imaginary file!",
    +  type: "warning",
    +  showCancelButton: true,
    +  confirmButtonColor: "#DD6B55",
    +  confirmButtonText: "Yes, delete it!",
    +  cancelButtonText: "No, cancel plx!",
    +  closeOnConfirm: false,
    +  closeOnCancel: false
    +},
    +function(isConfirm){
    +  if (isConfirm) {
    +    swal("Deleted!", "Your imaginary file has been deleted.", "success");
    +  } else {
    +	    swal("Cancelled", "Your imaginary file is safe :)", "error");
    +  }
    +});
    +
  • + +
  • +
    +

    A message with a custom icon

    + +
    +
    swal({
    +  title: "Sweet!",
    +  text: "Here's a custom image.",
    +  imageUrl: "images/thumbs-up.jpg"
    +});
    +
  • + +
  • +
    +

    An HTML message

    + +
    +
    swal({
    +  title: "HTML <small>Title</small>!",
    +  text: "A custom <span style="color:#F8BB86">html<span> message.",
    +  html: true
    +});
    +
  • + +
  • +
    +

    A message with auto close timer

    + +
    +
    swal({
    +  title: "Auto close alert!",
    +  text: "I will close in 2 seconds.",
    +  timer: 2000,
    +  showConfirmButton: false
    +});
    +
  • + + +
  • +
    +

    A replacement for the "prompt" function

    + +
    +
    swal({
    +  title: "An input!",
    +  text: "Write something interesting:",
    +  type: "input",
    +  showCancelButton: true,
    +  closeOnConfirm: false,
    +  animation: "slide-from-top",
    +  inputPlaceholder: "Write something"
    +},
    +function(inputValue){
    +  if (inputValue === false) return false;
    +  
    +  if (inputValue === "") {
    +    swal.showInputError("You need to write something!");
    +    return false
    +  }
    +  
    +  swal("Nice!", "You wrote: " + inputValue, "success");
    +});
    +
  • + +
  • +
    +

    With a loader (for AJAX request for example)

    + +
    +
    swal({
    +  title: "Ajax request example",
    +  text: "Submit to run ajax request",
    +  type: "info",
    +  showCancelButton: true,
    +  closeOnConfirm: false,
    +  showLoaderOnConfirm: true,
    +},
    +function(){
    +  setTimeout(function(){
    +    swal("Ajax request finished!");
    +  }, 2000);
    +});
    +
  • + +
  • +
    +

    You can also change the theme of SweetAlert!

    + +
    +
    <link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
    +			<link rel="stylesheet" type="text/css" href="themes/twitter.css">
    +
  • + +
+ + + +

Download & install

+ +
+

Method 1: Install through bower:

+
$ bower install sweetalert
+
+ +
+

Method 2: Install through NPM:

+
$ npm install sweetalert
+
+ +

Method 3: Download the sweetAlert CSS and JavaScript files.

+ +Download files + +
    +
  1. +

    Initialize the plugin by referencing the necessary files:

    +
    <script src="dist/sweetalert.min.js"></script>
    +<link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
    +
  2. + +
  3. +

    Call the sweetAlert-function after the page has loaded

    +
    swal({
    +  title: "Error!",
    +  text: "Here's my error message!",
    +  type: "error",
    +  confirmButtonText: "Cool"
    +});
    +
    +
  4. +
+ + + + +

Configuration

+ +

Here are the keys that you can use if you pass an object into sweetAlert:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Argument +
Default value +
+ Description +
titlenull (required)The title of the modal. It can either be added to the object under the key "title" or passed as the first parameter of the function.
textnullA description for the modal. It can either be added to the object under the key "text" or passed as the second parameter of the function.
typenullThe type of the modal. SweetAlert comes with 4 built-in types which will show a corresponding icon animation: "warning", "error", "success" and "info". You can also set it as "input" to get a prompt modal. It can either be put in the object under the key "type" or passed as the third parameter of the function.
allowEscapeKeytrueIf set to true, the user can dismiss the modal by pressing the Escape key.
customClassnullA custom CSS class for the modal. It can be added to the object under the key "customClass".
allowOutsideClickfalseIf set to true, the user can dismiss the modal by clicking outside it.
showCancelButtonfalseIf set to true, a "Cancel"-button will be shown, which the user can click on to dismiss the modal.
showConfirmButtontrueIf set to false, the "OK/Confirm"-button will be hidden. Make sure you set a timer or set allowOutsideClick to true when using this, in order not to annoy the user.
confirmButtonText"OK"Use this to change the text on the "Confirm"-button. If showCancelButton is set as true, the confirm button will automatically show "Confirm" instead of "OK".
confirmButtonColor"#AEDEF4"Use this to change the background color of the "Confirm"-button (must be a HEX value).
cancelButtonText"Cancel"Use this to change the text on the "Cancel"-button.
closeOnConfirmtrueSet to false if you want the modal to stay open even if the user presses the "Confirm"-button. This is especially useful if the function attached to the "Confirm"-button is another SweetAlert.
closeOnCanceltrueSame as closeOnConfirm, but for the cancel button.
imageUrlnullAdd a customized icon for the modal. Should contain a string with the path to the image.
imageSize"80x80"If imageUrl is set, you can specify imageSize to describes how big you want the icon to be in px. Pass in a string with two values separated by an "x". The first value is the width, the second is the height.
timernullAuto close timer of the modal. Set in ms (milliseconds).
htmlfalseIf set to true, will not escape title and text parameters. (Set to false if you're worried about XSS attacks.)
animationtrueIf set to false, the modal's animation will be disabled. Possible (string) values : pop (default when animation set to true), slide-from-top, slide-from-bottom
inputType"text"Change the type of the input field when using type: "input" (this can be useful if you want users to type in their password for example).
inputPlaceholdernullWhen using the input-type, you can specify a placeholder to help the user.
inputValuenullSpecify a default text value that you want your input to show when using type: "input"
showLoaderOnConfirmfalseSet to true to disable the buttons and show that something is loading.
+ + + +

Methods

+ +

SweetAlert also comes with some simple methods that you can call:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Function +
Example +
+ Description +
setDefaultsswal.setDefaults({ confirmButtonColor: '#0000' });If you end up using a lot of the same settings when calling SweetAlert, you can use setDefaults at the start of your program to set them once and for all!
closeswal.close();Close the currently open SweetAlert programatically.
showInputErrorswal.showInputError("Invalid email!");Show an error message after validating the input field, if the user's data is bad
enableButtons, disableButtonsswal.disableButtons();Disable or enable the user to click on the cancel and confirm buttons.
+ + + + +

Contribute

+

SweetAlert was created by Tristan Edwards, you can follow him on or Dribbble for updates and other cool projects!

+

Feel free to fork SweetAlert on GitHub if you have any features that you want to add!

+ + +
+ • +
+ + + + + + + + + diff --git a/node_modules/sweetalert/lib/modules/default-params.js b/node_modules/sweetalert/lib/modules/default-params.js new file mode 100644 index 0000000..8f07f2e --- /dev/null +++ b/node_modules/sweetalert/lib/modules/default-params.js @@ -0,0 +1,32 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var defaultParams = { + title: '', + text: '', + type: null, + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + closeOnConfirm: true, + closeOnCancel: true, + confirmButtonText: 'OK', + confirmButtonColor: '#8CD4F5', + cancelButtonText: 'Cancel', + imageUrl: null, + imageSize: null, + timer: null, + customClass: '', + html: false, + animation: true, + allowEscapeKey: true, + inputType: 'text', + inputPlaceholder: '', + inputValue: '', + showLoaderOnConfirm: false +}; + +exports['default'] = defaultParams; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/handle-click.js b/node_modules/sweetalert/lib/modules/handle-click.js new file mode 100644 index 0000000..67a59b0 --- /dev/null +++ b/node_modules/sweetalert/lib/modules/handle-click.js @@ -0,0 +1,135 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _colorLuminance = require('./utils'); + +var _getModal = require('./handle-swal-dom'); + +var _hasClass$isDescendant = require('./handle-dom'); + +/* + * User clicked on "Confirm"/"OK" or "Cancel" + */ +var handleButton = function handleButton(event, params, modal) { + var e = event || window.event; + var target = e.target || e.srcElement; + + var targetedConfirm = target.className.indexOf('confirm') !== -1; + var targetedOverlay = target.className.indexOf('sweet-overlay') !== -1; + var modalIsVisible = _hasClass$isDescendant.hasClass(modal, 'visible'); + var doneFunctionExists = params.doneFunction && modal.getAttribute('data-has-done-function') === 'true'; + + // Since the user can change the background-color of the confirm button programmatically, + // we must calculate what the color should be on hover/active + var normalColor, hoverColor, activeColor; + if (targetedConfirm && params.confirmButtonColor) { + normalColor = params.confirmButtonColor; + hoverColor = _colorLuminance.colorLuminance(normalColor, -0.04); + activeColor = _colorLuminance.colorLuminance(normalColor, -0.14); + } + + function shouldSetConfirmButtonColor(color) { + if (targetedConfirm && params.confirmButtonColor) { + target.style.backgroundColor = color; + } + } + + switch (e.type) { + case 'mouseover': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'mouseout': + shouldSetConfirmButtonColor(normalColor); + break; + + case 'mousedown': + shouldSetConfirmButtonColor(activeColor); + break; + + case 'mouseup': + shouldSetConfirmButtonColor(hoverColor); + break; + + case 'focus': + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + + if (targetedConfirm) { + $cancelButton.style.boxShadow = 'none'; + } else { + $confirmButton.style.boxShadow = 'none'; + } + break; + + case 'click': + var clickedOnModal = modal === target; + var clickedOnModalChild = _hasClass$isDescendant.isDescendant(modal, target); + + // Ignore click outside if allowOutsideClick is false + if (!clickedOnModal && !clickedOnModalChild && modalIsVisible && !params.allowOutsideClick) { + break; + } + + if (targetedConfirm && doneFunctionExists && modalIsVisible) { + handleConfirm(modal, params); + } else if (doneFunctionExists && modalIsVisible || targetedOverlay) { + handleCancel(modal, params); + } else if (_hasClass$isDescendant.isDescendant(modal, target) && target.tagName === 'BUTTON') { + sweetAlert.close(); + } + break; + } +}; + +/* + * User clicked on "Confirm"/"OK" + */ +var handleConfirm = function handleConfirm(modal, params) { + var callbackValue = true; + + if (_hasClass$isDescendant.hasClass(modal, 'show-input')) { + callbackValue = modal.querySelector('input').value; + + if (!callbackValue) { + callbackValue = ''; + } + } + + params.doneFunction(callbackValue); + + if (params.closeOnConfirm) { + sweetAlert.close(); + } + // Disable cancel and confirm button if the parameter is true + if (params.showLoaderOnConfirm) { + sweetAlert.disableButtons(); + } +}; + +/* + * User clicked on "Cancel" + */ +var handleCancel = function handleCancel(modal, params) { + // Check if callback function expects a parameter (to track cancel actions) + var functionAsStr = String(params.doneFunction).replace(/\s/g, ''); + var functionHandlesCancel = functionAsStr.substring(0, 9) === 'function(' && functionAsStr.substring(9, 10) !== ')'; + + if (functionHandlesCancel) { + params.doneFunction(false); + } + + if (params.closeOnCancel) { + sweetAlert.close(); + } +}; + +exports['default'] = { + handleButton: handleButton, + handleConfirm: handleConfirm, + handleCancel: handleCancel +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/handle-dom.js b/node_modules/sweetalert/lib/modules/handle-dom.js new file mode 100644 index 0000000..e8c22a5 --- /dev/null +++ b/node_modules/sweetalert/lib/modules/handle-dom.js @@ -0,0 +1,191 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var hasClass = function hasClass(elem, className) { + return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); +}; + +var addClass = function addClass(elem, className) { + if (!hasClass(elem, className)) { + elem.className += ' ' + className; + } +}; + +var removeClass = function removeClass(elem, className) { + var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; + if (hasClass(elem, className)) { + while (newClass.indexOf(' ' + className + ' ') >= 0) { + newClass = newClass.replace(' ' + className + ' ', ' '); + } + elem.className = newClass.replace(/^\s+|\s+$/g, ''); + } +}; + +var escapeHtml = function escapeHtml(str) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; +}; + +var _show = function _show(elem) { + elem.style.opacity = ''; + elem.style.display = 'block'; +}; + +var show = function show(elems) { + if (elems && !elems.length) { + return _show(elems); + } + for (var i = 0; i < elems.length; ++i) { + _show(elems[i]); + } +}; + +var _hide = function _hide(elem) { + elem.style.opacity = ''; + elem.style.display = 'none'; +}; + +var hide = function hide(elems) { + if (elems && !elems.length) { + return _hide(elems); + } + for (var i = 0; i < elems.length; ++i) { + _hide(elems[i]); + } +}; + +var isDescendant = function isDescendant(parent, child) { + var node = child.parentNode; + while (node !== null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; +}; + +var getTopMargin = function getTopMargin(elem) { + elem.style.left = '-9999px'; + elem.style.display = 'block'; + + var height = elem.clientHeight, + padding; + if (typeof getComputedStyle !== 'undefined') { + // IE 8 + padding = parseInt(getComputedStyle(elem).getPropertyValue('padding-top'), 10); + } else { + padding = parseInt(elem.currentStyle.padding); + } + + elem.style.left = ''; + elem.style.display = 'none'; + return '-' + parseInt((height + padding) / 2) + 'px'; +}; + +var fadeIn = function fadeIn(elem, interval) { + if (+elem.style.opacity < 1) { + interval = interval || 16; + elem.style.opacity = 0; + elem.style.display = 'block'; + var last = +new Date(); + var tick = (function (_tick) { + function tick() { + return _tick.apply(this, arguments); + } + + tick.toString = function () { + return _tick.toString(); + }; + + return tick; + })(function () { + elem.style.opacity = +elem.style.opacity + (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity < 1) { + setTimeout(tick, interval); + } + }); + tick(); + } + elem.style.display = 'block'; //fallback IE8 +}; + +var fadeOut = function fadeOut(elem, interval) { + interval = interval || 16; + elem.style.opacity = 1; + var last = +new Date(); + var tick = (function (_tick2) { + function tick() { + return _tick2.apply(this, arguments); + } + + tick.toString = function () { + return _tick2.toString(); + }; + + return tick; + })(function () { + elem.style.opacity = +elem.style.opacity - (new Date() - last) / 100; + last = +new Date(); + + if (+elem.style.opacity > 0) { + setTimeout(tick, interval); + } else { + elem.style.display = 'none'; + } + }); + tick(); +}; + +var fireClick = function fireClick(node) { + // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/ + // Then fixed for today's Chrome browser. + if (typeof MouseEvent === 'function') { + // Up-to-date approach + var mevt = new MouseEvent('click', { + view: window, + bubbles: false, + cancelable: true + }); + node.dispatchEvent(mevt); + } else if (document.createEvent) { + // Fallback + var evt = document.createEvent('MouseEvents'); + evt.initEvent('click', false, false); + node.dispatchEvent(evt); + } else if (document.createEventObject) { + node.fireEvent('onclick'); + } else if (typeof node.onclick === 'function') { + node.onclick(); + } +}; + +var stopEventPropagation = function stopEventPropagation(e) { + // In particular, make sure the space bar doesn't scroll the main window. + if (typeof e.stopPropagation === 'function') { + e.stopPropagation(); + e.preventDefault(); + } else if (window.event && window.event.hasOwnProperty('cancelBubble')) { + window.event.cancelBubble = true; + } +}; + +exports.hasClass = hasClass; +exports.addClass = addClass; +exports.removeClass = removeClass; +exports.escapeHtml = escapeHtml; +exports._show = _show; +exports.show = show; +exports._hide = _hide; +exports.hide = hide; +exports.isDescendant = isDescendant; +exports.getTopMargin = getTopMargin; +exports.fadeIn = fadeIn; +exports.fadeOut = fadeOut; +exports.fireClick = fireClick; +exports.stopEventPropagation = stopEventPropagation; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/handle-key.js b/node_modules/sweetalert/lib/modules/handle-key.js new file mode 100644 index 0000000..4869f9e --- /dev/null +++ b/node_modules/sweetalert/lib/modules/handle-key.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _stopEventPropagation$fireClick = require('./handle-dom'); + +var _setFocusStyle = require('./handle-swal-dom'); + +var handleKeyDown = function handleKeyDown(event, params, modal) { + var e = event || window.event; + var keyCode = e.keyCode || e.which; + + var $okButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + var $modalButtons = modal.querySelectorAll('button[tabindex]'); + + if ([9, 13, 32, 27].indexOf(keyCode) === -1) { + // Don't do work on keys we don't care about. + return; + } + + var $targetElement = e.target || e.srcElement; + + var btnIndex = -1; // Find the button - note, this is a nodelist, not an array. + for (var i = 0; i < $modalButtons.length; i++) { + if ($targetElement === $modalButtons[i]) { + btnIndex = i; + break; + } + } + + if (keyCode === 9) { + // TAB + if (btnIndex === -1) { + // No button focused. Jump to the confirm button. + $targetElement = $okButton; + } else { + // Cycle to the next button + if (btnIndex === $modalButtons.length - 1) { + $targetElement = $modalButtons[0]; + } else { + $targetElement = $modalButtons[btnIndex + 1]; + } + } + + _stopEventPropagation$fireClick.stopEventPropagation(e); + $targetElement.focus(); + + if (params.confirmButtonColor) { + _setFocusStyle.setFocusStyle($targetElement, params.confirmButtonColor); + } + } else { + if (keyCode === 13) { + if ($targetElement.tagName === 'INPUT') { + $targetElement = $okButton; + $okButton.focus(); + } + + if (btnIndex === -1) { + // ENTER/SPACE clicked outside of a button. + $targetElement = $okButton; + } else { + // Do nothing - let the browser handle it. + $targetElement = undefined; + } + } else if (keyCode === 27 && params.allowEscapeKey === true) { + $targetElement = $cancelButton; + _stopEventPropagation$fireClick.fireClick($targetElement, e); + } else { + // Fallback - let the browser handle it. + $targetElement = undefined; + } + } +}; + +exports['default'] = handleKeyDown; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/handle-swal-dom.js b/node_modules/sweetalert/lib/modules/handle-swal-dom.js new file mode 100644 index 0000000..1a18bea --- /dev/null +++ b/node_modules/sweetalert/lib/modules/handle-swal-dom.js @@ -0,0 +1,167 @@ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _hexToRgb = require('./utils'); + +var _removeClass$getTopMargin$fadeIn$show$addClass = require('./handle-dom'); + +var _defaultParams = require('./default-params'); + +var _defaultParams2 = _interopRequireWildcard(_defaultParams); + +/* + * Add modal + overlay to DOM + */ + +var _injectedHTML = require('./injected-html'); + +var _injectedHTML2 = _interopRequireWildcard(_injectedHTML); + +var modalClass = '.sweet-alert'; +var overlayClass = '.sweet-overlay'; + +var sweetAlertInitialize = function sweetAlertInitialize() { + var sweetWrap = document.createElement('div'); + sweetWrap.innerHTML = _injectedHTML2['default']; + + // Append elements to body + while (sweetWrap.firstChild) { + document.body.appendChild(sweetWrap.firstChild); + } +}; + +/* + * Get DOM element of modal + */ +var getModal = (function (_getModal) { + function getModal() { + return _getModal.apply(this, arguments); + } + + getModal.toString = function () { + return _getModal.toString(); + }; + + return getModal; +})(function () { + var $modal = document.querySelector(modalClass); + + if (!$modal) { + sweetAlertInitialize(); + $modal = getModal(); + } + + return $modal; +}); + +/* + * Get DOM element of input (in modal) + */ +var getInput = function getInput() { + var $modal = getModal(); + if ($modal) { + return $modal.querySelector('input'); + } +}; + +/* + * Get DOM element of overlay + */ +var getOverlay = function getOverlay() { + return document.querySelector(overlayClass); +}; + +/* + * Add box-shadow style to button (depending on its chosen bg-color) + */ +var setFocusStyle = function setFocusStyle($button, bgColor) { + var rgbColor = _hexToRgb.hexToRgb(bgColor); + $button.style.boxShadow = '0 0 2px rgba(' + rgbColor + ', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)'; +}; + +/* + * Animation when opening modal + */ +var openModal = function openModal(callback) { + var $modal = getModal(); + _removeClass$getTopMargin$fadeIn$show$addClass.fadeIn(getOverlay(), 10); + _removeClass$getTopMargin$fadeIn$show$addClass.show($modal); + _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'showSweetAlert'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'hideSweetAlert'); + + window.previousActiveElement = document.activeElement; + var $okButton = $modal.querySelector('button.confirm'); + $okButton.focus(); + + setTimeout(function () { + _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'visible'); + }, 500); + + var timer = $modal.getAttribute('data-timer'); + + if (timer !== 'null' && timer !== '') { + var timerCallback = callback; + $modal.timeout = setTimeout(function () { + var doneFunctionExists = (timerCallback || null) && $modal.getAttribute('data-has-done-function') === 'true'; + if (doneFunctionExists) { + timerCallback(null); + } else { + sweetAlert.close(); + } + }, timer); + } +}; + +/* + * Reset the styling of the input + * (for example if errors have been shown) + */ +var resetInput = function resetInput() { + var $modal = getModal(); + var $input = getInput(); + + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'show-input'); + $input.value = _defaultParams2['default'].inputValue; + $input.setAttribute('type', _defaultParams2['default'].inputType); + $input.setAttribute('placeholder', _defaultParams2['default'].inputPlaceholder); + + resetInputError(); +}; + +var resetInputError = function resetInputError(event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($errorContainer, 'show'); +}; + +/* + * Set "margin-top"-property on modal based on its computed height + */ +var fixVerticalPosition = function fixVerticalPosition() { + var $modal = getModal(); + $modal.style.marginTop = _removeClass$getTopMargin$fadeIn$show$addClass.getTopMargin(getModal()); +}; + +exports.sweetAlertInitialize = sweetAlertInitialize; +exports.getModal = getModal; +exports.getOverlay = getOverlay; +exports.getInput = getInput; +exports.setFocusStyle = setFocusStyle; +exports.openModal = openModal; +exports.resetInput = resetInput; +exports.resetInputError = resetInputError; +exports.fixVerticalPosition = fixVerticalPosition; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/injected-html.js b/node_modules/sweetalert/lib/modules/injected-html.js new file mode 100644 index 0000000..67623dc --- /dev/null +++ b/node_modules/sweetalert/lib/modules/injected-html.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var injectedHTML = + +// Dark overlay +"
" + + +// Modal +"
" + + +// Error icon +"
\n \n \n \n \n
" + + +// Warning icon +"
\n \n \n
" + + +// Info icon +"
" + + +// Success icon +"
\n \n \n\n
\n
\n
" + "
" + + +// Title, text and input +"

Title

\n

Text

\n
\n \n
\n
" + + +// Input errors +"
\n
!
\n

Not valid!

\n
" + + +// Cancel and confirm buttons +"
\n \n
\n " + + +// Loading animation +"
\n
\n
\n
\n
\n
\n
" + + +// End of modal +"
"; + +exports["default"] = injectedHTML; +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/set-params.js b/node_modules/sweetalert/lib/modules/set-params.js new file mode 100644 index 0000000..9aeea0e --- /dev/null +++ b/node_modules/sweetalert/lib/modules/set-params.js @@ -0,0 +1,225 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _isIE8 = require('./utils'); + +var _getModal$getInput$setFocusStyle = require('./handle-swal-dom'); + +var _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide = require('./handle-dom'); + +var alertTypes = ['error', 'warning', 'info', 'success', 'input', 'prompt']; + +/* + * Set type, text and actions on modal + */ +var setParameters = function setParameters(params) { + var modal = _getModal$getInput$setFocusStyle.getModal(); + + var $title = modal.querySelector('h2'); + var $text = modal.querySelector('p'); + var $cancelBtn = modal.querySelector('button.cancel'); + var $confirmBtn = modal.querySelector('button.confirm'); + + /* + * Title + */ + $title.innerHTML = params.html ? params.title : _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.title).split('\n').join('
'); + + /* + * Text + */ + $text.innerHTML = params.html ? params.text : _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.text || '').split('\n').join('
'); + if (params.text) _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($text); + + /* + * Custom class + */ + if (params.customClass) { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass(modal, params.customClass); + modal.setAttribute('data-custom-class', params.customClass); + } else { + // Find previously set classes and remove them + var customClass = modal.getAttribute('data-custom-class'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.removeClass(modal, customClass); + modal.setAttribute('data-custom-class', ''); + } + + /* + * Icon + */ + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide(modal.querySelectorAll('.sa-icon')); + + if (params.type && !_isIE8.isIE8()) { + var _ret = (function () { + + var validType = false; + + for (var i = 0; i < alertTypes.length; i++) { + if (params.type === alertTypes[i]) { + validType = true; + break; + } + } + + if (!validType) { + logStr('Unknown alert type: ' + params.type); + return { + v: false + }; + } + + var typesWithIcons = ['success', 'error', 'warning', 'info']; + var $icon = undefined; + + if (typesWithIcons.indexOf(params.type) !== -1) { + $icon = modal.querySelector('.sa-icon.' + 'sa-' + params.type); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($icon); + } + + var $input = _getModal$getInput$setFocusStyle.getInput(); + + // Animate icon + switch (params.type) { + + case 'success': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'animate'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-tip'), 'animateSuccessTip'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-long'), 'animateSuccessLong'); + break; + + case 'error': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'animateErrorIcon'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-x-mark'), 'animateXMark'); + break; + + case 'warning': + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon, 'pulseWarning'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-body'), 'pulseWarningIns'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass($icon.querySelector('.sa-dot'), 'pulseWarningIns'); + break; + + case 'input': + case 'prompt': + $input.setAttribute('type', params.inputType); + $input.value = params.inputValue; + $input.setAttribute('placeholder', params.inputPlaceholder); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.addClass(modal, 'show-input'); + setTimeout(function () { + $input.focus(); + $input.addEventListener('keyup', swal.resetInputError); + }, 400); + break; + } + })(); + + if (typeof _ret === 'object') { + return _ret.v; + } + } + + /* + * Custom image + */ + if (params.imageUrl) { + var $customIcon = modal.querySelector('.sa-icon.sa-custom'); + + $customIcon.style.backgroundImage = 'url(' + params.imageUrl + ')'; + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.show($customIcon); + + var _imgWidth = 80; + var _imgHeight = 80; + + if (params.imageSize) { + var dimensions = params.imageSize.toString().split('x'); + var imgWidth = dimensions[0]; + var imgHeight = dimensions[1]; + + if (!imgWidth || !imgHeight) { + logStr('Parameter imageSize expects value with format WIDTHxHEIGHT, got ' + params.imageSize); + } else { + _imgWidth = imgWidth; + _imgHeight = imgHeight; + } + } + + $customIcon.setAttribute('style', $customIcon.getAttribute('style') + 'width:' + _imgWidth + 'px; height:' + _imgHeight + 'px'); + } + + /* + * Show cancel button? + */ + modal.setAttribute('data-has-cancel-button', params.showCancelButton); + if (params.showCancelButton) { + $cancelBtn.style.display = 'inline-block'; + } else { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide($cancelBtn); + } + + /* + * Show confirm button? + */ + modal.setAttribute('data-has-confirm-button', params.showConfirmButton); + if (params.showConfirmButton) { + $confirmBtn.style.display = 'inline-block'; + } else { + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.hide($confirmBtn); + } + + /* + * Custom text on cancel/confirm buttons + */ + if (params.cancelButtonText) { + $cancelBtn.innerHTML = _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.cancelButtonText); + } + if (params.confirmButtonText) { + $confirmBtn.innerHTML = _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide.escapeHtml(params.confirmButtonText); + } + + /* + * Custom color on confirm button + */ + if (params.confirmButtonColor) { + // Set confirm button to selected background color + $confirmBtn.style.backgroundColor = params.confirmButtonColor; + + // Set the confirm button color to the loading ring + $confirmBtn.style.borderLeftColor = params.confirmLoadingButtonColor; + $confirmBtn.style.borderRightColor = params.confirmLoadingButtonColor; + + // Set box-shadow to default focused button + _getModal$getInput$setFocusStyle.setFocusStyle($confirmBtn, params.confirmButtonColor); + } + + /* + * Allow outside click + */ + modal.setAttribute('data-allow-outside-click', params.allowOutsideClick); + + /* + * Callback function + */ + var hasDoneFunction = params.doneFunction ? true : false; + modal.setAttribute('data-has-done-function', hasDoneFunction); + + /* + * Animation + */ + if (!params.animation) { + modal.setAttribute('data-animation', 'none'); + } else if (typeof params.animation === 'string') { + modal.setAttribute('data-animation', params.animation); // Custom animation + } else { + modal.setAttribute('data-animation', 'pop'); + } + + /* + * Timer + */ + modal.setAttribute('data-timer', params.timer); +}; + +exports['default'] = setParameters; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/modules/utils.js b/node_modules/sweetalert/lib/modules/utils.js new file mode 100644 index 0000000..fe1285a --- /dev/null +++ b/node_modules/sweetalert/lib/modules/utils.js @@ -0,0 +1,73 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +/* + * Allow user to pass their own params + */ +var extend = function extend(a, b) { + for (var key in b) { + if (b.hasOwnProperty(key)) { + a[key] = b[key]; + } + } + return a; +}; + +/* + * Convert HEX codes to RGB values (#000000 -> rgb(0,0,0)) + */ +var hexToRgb = function hexToRgb(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) : null; +}; + +/* + * Check if the user is using Internet Explorer 8 (for fallbacks) + */ +var isIE8 = function isIE8() { + return window.attachEvent && !window.addEventListener; +}; + +/* + * IE compatible logging for developers + */ +var logStr = function logStr(string) { + if (window.console) { + // IE... + window.console.log('SweetAlert: ' + string); + } +}; + +/* + * Set hover, active and focus-states for buttons + * (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color) + */ +var colorLuminance = function colorLuminance(hex, lum) { + // Validate hex string + hex = String(hex).replace(/[^0-9a-f]/gi, ''); + if (hex.length < 6) { + hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; + } + lum = lum || 0; + + // Convert to decimal and change luminosity + var rgb = '#'; + var c; + var i; + + for (i = 0; i < 3; i++) { + c = parseInt(hex.substr(i * 2, 2), 16); + c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16); + rgb += ('00' + c).substr(c.length); + } + + return rgb; +}; + +exports.extend = extend; +exports.hexToRgb = hexToRgb; +exports.isIE8 = isIE8; +exports.logStr = logStr; +exports.colorLuminance = colorLuminance; \ No newline at end of file diff --git a/node_modules/sweetalert/lib/sweetalert.js b/node_modules/sweetalert/lib/sweetalert.js new file mode 100644 index 0000000..3a7db98 --- /dev/null +++ b/node_modules/sweetalert/lib/sweetalert.js @@ -0,0 +1,303 @@ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +// SweetAlert +// 2014-2015 (c) - Tristan Edwards +// github.com/t4t5/sweetalert + +/* + * jQuery-like functions for manipulating the DOM + */ + +var _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation = require('./modules/handle-dom'); + +/* + * Handy utilities + */ + +var _extend$hexToRgb$isIE8$logStr$colorLuminance = require('./modules/utils'); + +/* + * Handle sweetAlert's DOM elements + */ + +var _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition = require('./modules/handle-swal-dom'); + +// Handle button events and keyboard events + +var _handleButton$handleConfirm$handleCancel = require('./modules/handle-click'); + +var _handleKeyDown = require('./modules/handle-key'); + +var _handleKeyDown2 = _interopRequireWildcard(_handleKeyDown); + +// Default values + +var _defaultParams = require('./modules/default-params'); + +var _defaultParams2 = _interopRequireWildcard(_defaultParams); + +var _setParameters = require('./modules/set-params'); + +var _setParameters2 = _interopRequireWildcard(_setParameters); + +/* + * Remember state in cases where opening and handling a modal will fiddle with it. + * (We also use window.previousActiveElement as a global variable) + */ +var previousWindowKeyDown; +var lastFocusedButton; + +/* + * Global sweetAlert function + * (this is what the user calls) + */ +var sweetAlert, swal; + +exports['default'] = sweetAlert = swal = function () { + var customizations = arguments[0]; + + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass(document.body, 'stop-scrolling'); + _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.resetInput(); + + /* + * Use argument if defined or default value from params object otherwise. + * Supports the case where a default value is boolean true and should be + * overridden by a corresponding explicit argument which is boolean false. + */ + function argumentOrDefault(key) { + var args = customizations; + return args[key] === undefined ? _defaultParams2['default'][key] : args[key]; + } + + if (customizations === undefined) { + _extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('SweetAlert expects at least 1 attribute!'); + return false; + } + + var params = _extend$hexToRgb$isIE8$logStr$colorLuminance.extend({}, _defaultParams2['default']); + + switch (typeof customizations) { + + // Ex: swal("Hello", "Just testing", "info"); + case 'string': + params.title = customizations; + params.text = arguments[1] || ''; + params.type = arguments[2] || ''; + break; + + // Ex: swal({ title:"Hello", text: "Just testing", type: "info" }); + case 'object': + if (customizations.title === undefined) { + _extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('Missing "title" argument!'); + return false; + } + + params.title = customizations.title; + + for (var customName in _defaultParams2['default']) { + params[customName] = argumentOrDefault(customName); + } + + // Show "Confirm" instead of "OK" if cancel button is visible + params.confirmButtonText = params.showCancelButton ? 'Confirm' : _defaultParams2['default'].confirmButtonText; + params.confirmButtonText = argumentOrDefault('confirmButtonText'); + + // Callback function when clicking on "OK"/"Cancel" + params.doneFunction = arguments[1] || null; + + break; + + default: + _extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('Unexpected type of argument! Expected "string" or "object", got ' + typeof customizations); + return false; + + } + + _setParameters2['default'](params); + _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.fixVerticalPosition(); + _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.openModal(arguments[1]); + + // Modal interactions + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + /* + * Make sure all modal buttons respond to all events + */ + var $buttons = modal.querySelectorAll('button'); + var buttonEvents = ['onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'onfocus']; + var onButtonEvent = function onButtonEvent(e) { + return _handleButton$handleConfirm$handleCancel.handleButton(e, params, modal); + }; + + for (var btnIndex = 0; btnIndex < $buttons.length; btnIndex++) { + for (var evtIndex = 0; evtIndex < buttonEvents.length; evtIndex++) { + var btnEvt = buttonEvents[evtIndex]; + $buttons[btnIndex][btnEvt] = onButtonEvent; + } + } + + // Clicking outside the modal dismisses it (if allowed by user) + _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getOverlay().onclick = onButtonEvent; + + previousWindowKeyDown = window.onkeydown; + + var onKeyEvent = function onKeyEvent(e) { + return _handleKeyDown2['default'](e, params, modal); + }; + window.onkeydown = onKeyEvent; + + window.onfocus = function () { + // When the user has focused away and focused back from the whole window. + setTimeout(function () { + // Put in a timeout to jump out of the event sequence. + // Calling focus() in the event sequence confuses things. + if (lastFocusedButton !== undefined) { + lastFocusedButton.focus(); + lastFocusedButton = undefined; + } + }, 0); + }; + + // Show alert with enabled buttons always + swal.enableButtons(); +}; + +/* + * Set default params for each popup + * @param {Object} userParams + */ +sweetAlert.setDefaults = swal.setDefaults = function (userParams) { + if (!userParams) { + throw new Error('userParams is required'); + } + if (typeof userParams !== 'object') { + throw new Error('userParams has to be a object'); + } + + _extend$hexToRgb$isIE8$logStr$colorLuminance.extend(_defaultParams2['default'], userParams); +}; + +/* + * Animation when closing modal + */ +sweetAlert.close = swal.close = function () { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.fadeOut(_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getOverlay(), 5); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.fadeOut(modal, 5); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass(modal, 'showSweetAlert'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass(modal, 'hideSweetAlert'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass(modal, 'visible'); + + /* + * Reset icon animations + */ + var $successIcon = modal.querySelector('.sa-icon.sa-success'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($successIcon, 'animate'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($successIcon.querySelector('.sa-tip'), 'animateSuccessTip'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($successIcon.querySelector('.sa-long'), 'animateSuccessLong'); + + var $errorIcon = modal.querySelector('.sa-icon.sa-error'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorIcon, 'animateErrorIcon'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorIcon.querySelector('.sa-x-mark'), 'animateXMark'); + + var $warningIcon = modal.querySelector('.sa-icon.sa-warning'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($warningIcon, 'pulseWarning'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($warningIcon.querySelector('.sa-body'), 'pulseWarningIns'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($warningIcon.querySelector('.sa-dot'), 'pulseWarningIns'); + + // Reset custom class (delay so that UI changes aren't visible) + setTimeout(function () { + var customClass = modal.getAttribute('data-custom-class'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass(modal, customClass); + }, 300); + + // Make page scrollable again + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass(document.body, 'stop-scrolling'); + + // Reset the page to its previous state + window.onkeydown = previousWindowKeyDown; + if (window.previousActiveElement) { + window.previousActiveElement.focus(); + } + lastFocusedButton = undefined; + clearTimeout(modal.timeout); + + return true; +}; + +/* + * Validation of the input field is done by user + * If something is wrong => call showInputError with errorMessage + */ +sweetAlert.showInputError = swal.showInputError = function (errorMessage) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + var $errorIcon = modal.querySelector('.sa-input-error'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass($errorIcon, 'show'); + + var $errorContainer = modal.querySelector('.sa-error-container'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass($errorContainer, 'show'); + + $errorContainer.querySelector('p').innerHTML = errorMessage; + + setTimeout(function () { + sweetAlert.enableButtons(); + }, 1); + + modal.querySelector('input').focus(); +}; + +/* + * Reset input error DOM elements + */ +sweetAlert.resetInputError = swal.resetInputError = function (event) { + // If press enter => ignore + if (event && event.keyCode === 13) { + return false; + } + + var $modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + + var $errorIcon = $modal.querySelector('.sa-input-error'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorIcon, 'show'); + + var $errorContainer = $modal.querySelector('.sa-error-container'); + _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass($errorContainer, 'show'); +}; + +/* + * Disable confirm and cancel buttons + */ +sweetAlert.disableButtons = swal.disableButtons = function (event) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = true; + $cancelButton.disabled = true; +}; + +/* + * Enable confirm and cancel buttons + */ +sweetAlert.enableButtons = swal.enableButtons = function (event) { + var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal(); + var $confirmButton = modal.querySelector('button.confirm'); + var $cancelButton = modal.querySelector('button.cancel'); + $confirmButton.disabled = false; + $cancelButton.disabled = false; +}; + +if (typeof window !== 'undefined') { + // The 'handle-click' module requires + // that 'sweetAlert' was set as global. + window.sweetAlert = window.swal = sweetAlert; +} else { + _extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('SweetAlert is a frontend module!'); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/sweetalert/package.json b/node_modules/sweetalert/package.json new file mode 100644 index 0000000..1f9effa --- /dev/null +++ b/node_modules/sweetalert/package.json @@ -0,0 +1,71 @@ +{ + "name": "sweetalert", + "version": "1.1.3", + "description": "A beautiful replacement for JavaScript's \"alert\"", + "main": "lib/sweetalert.js", + "directories": { + "example": "example" + }, + "scripts": { + "test": "gulp test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/t4t5/sweetalert.git" + }, + "keywords": [ + "sweetalert", + "alert", + "modal", + "popup" + ], + "author": { + "name": "Tristan Edwards", + "email": "tristan.edwards@me.com", + "url": "http://tristanedwards.me" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/t4t5/sweetalert/issues" + }, + "homepage": "http://tristanedwards.me/sweetalert", + "devDependencies": { + "babelify": "^6.0.2", + "browserify": "^9.0.8", + "glob": "^5.0.3", + "gulp": "^3.9.0", + "gulp-babel": "^5.2.1", + "gulp-concat": "^2.4.3", + "gulp-jshint": "^1.9.0", + "gulp-minify-css": "^0.3.13", + "gulp-qunit": "latest", + "gulp-rename": "^1.2.0", + "gulp-sass": "^2.0.1", + "gulp-uglify": "^1.0.2", + "gulp-wrap": "^0.11.0", + "path": "^0.11.14", + "vinyl-buffer": "^1.0.0", + "vinyl-source-stream": "^1.1.0" + }, + "gitHead": "3b9d8eb90268e0b1f8f58b2eba240631df0ad18f", + "_id": "sweetalert@1.1.3", + "_shasum": "d2c31ea492b22b6a8d887aea15989a238fc084ae", + "_from": "sweetalert@*", + "_npmVersion": "2.12.1", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "t4t5", + "email": "tristan.edwards@me.com" + }, + "maintainers": [ + { + "name": "t4t5", + "email": "tristan.edwards@me.com" + } + ], + "dist": { + "shasum": "d2c31ea492b22b6a8d887aea15989a238fc084ae", + "tarball": "http://registry.npmjs.org/sweetalert/-/sweetalert-1.1.3.tgz" + }, + "_resolved": "https://registry.npmjs.org/sweetalert/-/sweetalert-1.1.3.tgz" +} diff --git a/node_modules/sweetalert/sweetalert.gif b/node_modules/sweetalert/sweetalert.gif new file mode 100644 index 0000000..be45c38 Binary files /dev/null and b/node_modules/sweetalert/sweetalert.gif differ diff --git a/node_modules/sweetalert/test/index.html b/node_modules/sweetalert/test/index.html new file mode 100644 index 0000000..96789a8 --- /dev/null +++ b/node_modules/sweetalert/test/index.html @@ -0,0 +1,25 @@ + + + + + Tests + + + + +
+
+ + + + + + + + + + + + + + diff --git a/node_modules/sweetalert/test/tests.js b/node_modules/sweetalert/test/tests.js new file mode 100644 index 0000000..d5c29f6 --- /dev/null +++ b/node_modules/sweetalert/test/tests.js @@ -0,0 +1,141 @@ +// swal() sould add the modal to the DOM + make it visible +test("modal shows up", function() { + equal($('.sweet-alert').length, 0); + + swal("Hello world!"); + + ok($('.sweet-alert').is(':visible')); +}); + +// Clicking the confirm-button should dismiss the modal +test("dismiss modal with confirm-button", function(assert) { + var done = assert.async(); + swal("Dismiss me"); + + var $modal = $('.sweet-alert'); + $modal.find('button.confirm').click(); + + setTimeout(function() { + assert.ok($modal.is(':hidden')); + done(); + }, 500); +}); + +test("dismiss modal with esc-key", function(assert) { + var done = assert.async(); + swal("Dismiss me"); + + var $modal = $('.sweet-alert'); + $(document).trigger($.Event('keydown', { + keyCode: 27 + })); + + setTimeout(function() { + assert.ok($modal.is(':hidden')); + done(); + }, 500); +}); + +test("modals stays on with esc-key if allowEscapeKey is false", function(assert) { + var done = assert.async(); + swal({ + title: "Dismiss me", + allowEscapeKey: false + }); + + var $modal = $('.sweet-alert'); + $(document).trigger($.Event('keydown', { + keyCode: 27 + })); + + setTimeout(function() { + assert.ok($modal.is(':visible')); + done(); + }, 500); +}); + +/* + * Make sure that when using { showCancelButton: true }: + * - The cancel-button is visible on the modal + * - Clicking on it dismisses the modal + */ +test("cancel-button works", function(assert) { + var done = assert.async(); + swal({ + title: "Test", + showCancelButton: true + }); + + var $modal = $('.sweet-alert'); + var $cancelBtn = $modal.find('button.cancel'); + ok($cancelBtn.is(':visible')); + + $cancelBtn.click(); + + setTimeout(function() { + assert.ok($modal.is(':hidden')); + done(); + }, 500); +}); + +// Clicking the overlay should not dismiss the modal... +test("clicking the overlay does not dismiss modal", function(assert) { + var done = assert.async(); + swal("Test"); + + var $modal = $('.sweet-alert'); + $('.sweet-overlay').click(); + + setTimeout(function() { + assert.ok($modal.is(':visible')); + done(); + }, 500); +}); + + +// ...except if we pass allowOutsideClick: true +test("clicking the overlay (with allowOutsideClick option) dismisses modal", function(assert) { + var done = assert.async(); + swal({ + title: "Test", + allowOutsideClick: true + }); + + var $modal = $('.sweet-alert'); + $('.sweet-overlay').click(); + + setTimeout(function() { + assert.ok($modal.is(':hidden')); + done(); + }, 500); +}); + +test("timer works", function(assert) { + var done = assert.async(); + swal({ + title: "Timer test", + showConfirmButton: false, + timer: 500 + }); + + var $modal = $('.sweet-alert'); + assert.ok($modal.find('button.cancel, button.confirm').is(':hidden')); + + setTimeout(function() { + assert.ok($modal.is(':hidden')); + done(); + }, 1000); +}); + +test("prompt functionality works", function() { + swal({ + title: "Prompt test", + type: "input", + inputPlaceholder: "Placeholder text" + }); + + var $modal = $('.sweet-alert'); + + ok($modal.find('fieldset input').is(':visible')); + equal($modal.find('fieldset input').attr('placeholder'), "Placeholder text"); +}); diff --git a/node_modules/sweetalert/themes/facebook/facebook.css b/node_modules/sweetalert/themes/facebook/facebook.css new file mode 100644 index 0000000..4c81b56 --- /dev/null +++ b/node_modules/sweetalert/themes/facebook/facebook.css @@ -0,0 +1,111 @@ +.sweet-overlay { + border-radius: 3px; } + +.sweet-alert { + font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; + padding: 12px; + padding-top: 53px; + text-align: right; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.11), 0px 6px 30px rgba(0, 0, 0, 0.14); } + .sweet-alert h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 41px; + background-color: #f6f7f8; + margin: 0; + font-size: 15px; + text-align: left; + padding-left: 12px; + color: #131722; + border-bottom: 1px solid #e5e5e5; } + .sweet-alert p { + display: block; + text-align: center; + color: #131722; + font-weight: 400; + font-size: 15px; + margin-top: 7px; } + .sweet-alert .sa-button-container { + border-top: 1px solid #dcdee3; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] .sa-button-container { + display: none; } + .sweet-alert button { + font-size: 12px; + padding: 5px 10px; + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3); + font-weight: 500; + margin: 0; + margin-top: 12px; } + .sweet-alert button:focus, .sweet-alert button.cancel:focus { + box-shadow: 0 0 1px 2px rgba(88, 144, 255, 0.75), 0 1px 1px rgba(0, 0, 0, 0.15) !important; } + .sweet-alert button.confirm { + border: 1px solid #3d5586; + background-color: #47639c !important; + margin-left: 4px; } + .sweet-alert button.cancel { + color: #4e5664; + background-color: #fafbfb; + text-shadow: 0px -1px 0px white; + border: 1px solid #c5c6c8; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.04) !important; + font-weight: 600; } + .sweet-alert button.cancel:hover { + background-color: #fafbfb; } + .sweet-alert .sa-icon:not(.sa-custom) { + transform: scale(0.7); + margin-bottom: -10px; + margin-top: -10px; } + .sweet-alert input { + border: 1px solid #bdc7d8; + padding: 3px; + border-radius: 0; + box-shadow: none; + font-size: 15px; + height: 33px; + margin: 10px 0; } + .sweet-alert input:focus { + box-shadow: 0 0 1px 2px rgba(88, 144, 255, 0.75), 0 1px 1px rgba(0, 0, 0, 0.15) !important; } + .sweet-alert fieldset .sa-input-error { + display: none; } + .sweet-alert .sa-error-container { + text-align: center; + background-color: #fdebe8; + margin: 0; + border: none; } + .sweet-alert .sa-error-container.show { + margin: 14px; + margin-top: 0; + border: 1px solid #d5512d; } + .sweet-alert .sa-error-container .icon { + display: none; } + .sweet-alert .sa-error-container p { + color: #303b44; + margin-top: 3px; } + +@-webkit-keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } + +@keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } diff --git a/node_modules/sweetalert/themes/facebook/facebook.scss b/node_modules/sweetalert/themes/facebook/facebook.scss new file mode 100644 index 0000000..2ea546d --- /dev/null +++ b/node_modules/sweetalert/themes/facebook/facebook.scss @@ -0,0 +1,146 @@ +// Facebook Theme for SweetAlert +// By Tristan Edwards + +.sweet-overlay { + border-radius: 3px; +} + + +.sweet-alert { + $header-height: 41px; + $footer-height: 50px; + $text-color: #131722; + $fb-focus: 0 0 1px 2px rgba(88, 144, 255, .75), 0 1px 1px rgba(0, 0, 0, .15) !important; + $padding: 12px; + + font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; + padding: $padding; + padding-top: $header-height + $padding; + text-align: right; // Align buttons + box-shadow: 0px 0px 0px 1px rgba(black, 0.11), 0px 6px 30px rgba(black, 0.14); + + h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: $header-height; + background-color: #f6f7f8; + margin: 0; + font-size: 15px; + text-align: left; + padding-left: 12px; + color: $text-color; + border-bottom: 1px solid #e5e5e5; + } + + p { + display: block; + text-align: center; + color: #131722; + font-weight: 400; + font-size: 15px; + margin-top: 7px; + } + + .sa-button-container { + border-top: 1px solid #dcdee3; + } + &[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; + .sa-button-container { + display: none; + } + } + + button { + font-size: 12px; + padding: 5px 10px; + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(black, 0.3); + font-weight: 500; + margin: 0; + margin-top: $padding; + &:focus, &.cancel:focus { + box-shadow: $fb-focus; + } + + &.confirm { + border: 1px solid #3d5586; + background-color: #47639c !important; + margin-left: 4px; + } + &.cancel { + color: #4e5664; + background-color: #fafbfb; + text-shadow: 0px -1px 0px white; + border: 1px solid #c5c6c8; + box-shadow: 0px 1px 1px rgba(black, 0.04) !important; + font-weight: 600; + &:hover { + background-color: #fafbfb; + } + } + } + + .sa-icon:not(.sa-custom) { + transform: scale(0.7); + margin-bottom: -10px; + margin-top: -10px; + } + + input { + border: 1px solid #bdc7d8; + padding: 3px; + border-radius: 0; + box-shadow: none; + font-size: 15px; + height: 33px; + margin: 10px 0; + &:focus { + box-shadow: $fb-focus; + } + } + + fieldset .sa-input-error { + display: none; + } + + .sa-error-container { + text-align: center; + background-color: #fdebe8; + margin: 0; + border: none; + &.show { + margin: 14px; + margin-top: 0; + border: 1px solid #d5512d; + } + + .icon { + display: none; + } + p { + color: #303b44; + margin-top: 3px; + } + } +} + + +// Animations + +@mixin keyframes($animation-name) { + @-webkit-keyframes #{$animation-name} { + @content; + } + @keyframes #{$animation-name} { + @content; + } +} + +@include keyframes(animateErrorIcon) { + 0% { transform: rotateX(100deg), scale(0.5); -webkit-transform: rotateX(100deg), scale(0.5); opacity: 0; } + 100% { transform: rotateX(0deg), scale(0.5); -webkit-transform: rotateX(0deg), scale(0.5); opacity: 1; } +} \ No newline at end of file diff --git a/node_modules/sweetalert/themes/google/google.css b/node_modules/sweetalert/themes/google/google.css new file mode 100644 index 0000000..5e53a99 --- /dev/null +++ b/node_modules/sweetalert/themes/google/google.css @@ -0,0 +1,115 @@ +.sweet-overlay { + background: rgba(10, 10, 10, 0.6); } + +.sweet-alert { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 24px; + padding-top: 64px; + padding-bottom: 13px; + text-align: right; + border-radius: 0; + box-shadow: 0 0 14px rgba(0, 0, 0, 0.24), 0 14px 28px rgba(0, 0, 0, 0.48); } + .sweet-alert h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: auto; + font-weight: 400; + color: #212121; + margin: 20px 0; + font-size: 1.2em; + line-height: 1.25; + text-align: left; + padding: 0 24px; } + .sweet-alert p { + display: block; + text-align: center; + color: #212121; + font-weight: 400; + font-size: 14px; + margin: 20px 0; } + .sweet-alert button { + border-radius: 2px; + box-shadow: none !important; + background: none !important; + border-radius: 2px; + text-transform: uppercase; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; + margin-top: 0; } + .sweet-alert button:hover, .sweet-alert button:focus { + background-color: #f6f6f6 !important; } + .sweet-alert button.confirm { + color: #3c80f6; } + .sweet-alert button.cancel { + color: #757575; } + .sweet-alert button.cancel:focus { + box-shadow: none !important; } + .sweet-alert .sa-icon:not(.sa-custom) { + transform: scale(0.8); + margin-bottom: -10px; + margin-top: -10px; } + .sweet-alert input { + border: none; + border-radius: 0; + border-bottom: 1px solid #c9c9c9; + color: #212121; + margin-bottom: 8px; + padding: 1px; + padding-bottom: 8px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; } + .sweet-alert input:focus { + border: none; + border-bottom: 1px solid #3c80f6; + box-shadow: inset 0 -1px 0 #3c80f6; } + .sweet-alert fieldset { + padding: 0; } + .sweet-alert fieldset .sa-input-error { + display: none; } + .sweet-alert .sa-error-container { + display: none; + background: none; + height: auto; + padding: 0 24px; + margin: 0 -20px; + text-align: left; } + .sweet-alert .sa-error-container.show { + padding: 0 24px; + display: block; } + .sweet-alert .sa-error-container.show ~ fieldset input { + background: red; + border-bottom: 1px solid #d9453c; + box-shadow: inset 0 -1px 0 #d9453c; } + .sweet-alert .sa-error-container .icon { + display: none; } + .sweet-alert .sa-error-container p { + color: #d9453c; + margin-top: 0; } + +@-webkit-keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } + +@keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } diff --git a/node_modules/sweetalert/themes/google/google.scss b/node_modules/sweetalert/themes/google/google.scss new file mode 100644 index 0000000..86285d6 --- /dev/null +++ b/node_modules/sweetalert/themes/google/google.scss @@ -0,0 +1,148 @@ +// Google Theme for SweetAlert +// By Tristan Edwards + +.sweet-overlay { + background: rgba(10,10,10,.6); +} + + +.sweet-alert { + $header-height: 40px; + $footer-height: 66px; + $text-color: #212121; + $padding: 24px; + $error-color: #d9453c; + + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: $padding; + padding-top: $header-height + $padding; + padding-bottom: 13px; + text-align: right; // Align buttons + border-radius: 0; + box-shadow: 0 0 14px rgba(black, 0.24),0 14px 28px rgba(black, 0.48); + + h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: auto; + font-weight: 400; + color: $text-color; + margin: 20px 0; + font-size: 1.2em; + line-height: 1.25; + text-align: left; + padding: 0 $padding; + } + + p { + display: block; + text-align: center; + color: $text-color; + font-weight: 400; + font-size: 14px; + margin: 20px 0; + } + + button { + border-radius: 2px; + box-shadow: none !important; + background: none !important; + border-radius: 2px; + text-transform: uppercase; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; + margin-top: 0; + &:hover, &:focus { + background-color: #f6f6f6 !important; + } + + &.confirm { + color: #3c80f6; + } + &.cancel { + color: #757575; + &:focus { + box-shadow: none !important; + } + } + } + + .sa-icon:not(.sa-custom) { + transform: scale(0.8); + margin-bottom: -10px; + margin-top: -10px; + } + + input { + border: none; + border-radius: 0; + border-bottom: 1px solid #c9c9c9; + color: #212121; + margin-bottom: 8px; + padding: 1px; + padding-bottom: 8px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; + &:focus { + border: none; + border-bottom: 1px solid #3c80f6; + box-shadow: inset 0 -1px 0 #3c80f6; + } + } + + fieldset { + padding: 0; + .sa-input-error { + display: none; + } + } + + .sa-error-container { + display: none; + background: none; + height: auto; + padding: 0 $padding; + margin: 0 -20px; + text-align: left; + &.show { + padding: 0 $padding; + display: block; + ~ fieldset input { + background: red; + border-bottom: 1px solid $error-color; + box-shadow: inset 0 -1px 0 $error-color; + } + } + + .icon { + display: none; + } + p { + color: $error-color; + margin-top: 0; + } + } +} + + +// Animations + +@mixin keyframes($animation-name) { + @-webkit-keyframes #{$animation-name} { + @content; + } + @keyframes #{$animation-name} { + @content; + } +} + +@include keyframes(animateErrorIcon) { + 0% { transform: rotateX(100deg), scale(0.5); -webkit-transform: rotateX(100deg), scale(0.5); opacity: 0; } + 100% { transform: rotateX(0deg), scale(0.5); -webkit-transform: rotateX(0deg), scale(0.5); opacity: 1; } +} \ No newline at end of file diff --git a/node_modules/sweetalert/themes/twitter/twitter.css b/node_modules/sweetalert/themes/twitter/twitter.css new file mode 100644 index 0000000..062ded6 --- /dev/null +++ b/node_modules/sweetalert/themes/twitter/twitter.css @@ -0,0 +1,140 @@ +.sweet-overlay { + background: rgba(41, 47, 51, 0.9); } + +.sweet-alert { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 15px; + padding-top: 55px; + text-align: right; + border-radius: 6px; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.11), 0px 6px 30px rgba(0, 0, 0, 0.14); } + .sweet-alert h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 40px; + line-height: 40px; + font-size: 16px; + font-weight: 400; + color: #8899a6; + margin: 0; + color: #66757f; + border-bottom: 1px solid #e1e8ed; } + .sweet-alert p { + display: block; + text-align: center; + color: #66757f; + font-weight: 400; + font-size: 13px; + margin-top: 7px; } + .sweet-alert .sa-button-container { + background-color: #f5f8fa; + border-top: 1px solid #e1e8ed; + box-shadow: 0px -1px 0px white; + margin: -15px; + margin-top: 0; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] .sa-button-container { + display: none; } + .sweet-alert button { + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3); + margin: 17px 0px; + border-radius: 4px; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; } + .sweet-alert button:focus, .sweet-alert button.cancel:focus { + box-shadow: none !important; } + .sweet-alert button:focus::before, .sweet-alert button.cancel:focus::before { + content: ""; + position: absolute; + left: -5px; + top: -5px; + right: -5px; + bottom: -5px; + border: 2px solid #a5b0b4; + border-radius: 8px; } + .sweet-alert button.confirm { + background-color: #55acee !important; + background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#0C000000)"; + border: 1px solid #3b88c3; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15); + margin-right: 15px; } + .sweet-alert button.confirm:hover { + background-color: #55acee; + background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.15)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#26000000)"; + border-color: #3b88c3; } + .sweet-alert button.cancel { + color: #66757e; + background-color: #f5f8fa; + background-image: linear-gradient(#fff, #f5f8fa); + text-shadow: 0px -1px 0px white; + margin-right: 9px; + border: 1px solid #e1e8ed; } + .sweet-alert button.cancel:hover, .sweet-alert button.cancel:focus:hover { + background-color: #e1e8ed; + background-image: linear-gradient(#fff, #e1e8ed); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(enabled=false)"; + border-color: #e1e8ed; } + .sweet-alert button.cancel:focus { + background: #fff; + border-color: #fff; } + .sweet-alert .sa-icon:not(.sa-custom) { + transform: scale(0.72); + margin-bottom: -2px; + margin-top: -10px; } + .sweet-alert input { + border: 1px solid #e1e8ed; + border-radius: 3px; + padding: 10px 7px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; } + .sweet-alert input:focus { + border-color: #94A1A6; + box-shadow: inset 0 0 0 1px rgba(77, 99, 107, 0.7); } + .sweet-alert fieldset .sa-input-error { + display: none; } + .sweet-alert .sa-error-container { + text-align: center; + border: none; + background-color: #fbedc0; + margin-bottom: 6px; } + .sweet-alert .sa-error-container.show { + border: 1px solid #f0e1b9; } + .sweet-alert .sa-error-container .icon { + display: none; } + .sweet-alert .sa-error-container p { + color: #292f33; + font-weight: 600; + margin-top: 0; } + +@-webkit-keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } + +@keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg), scale(0.5); + -webkit-transform: rotateX(100deg), scale(0.5); + opacity: 0; } + + 100% { + transform: rotateX(0deg), scale(0.5); + -webkit-transform: rotateX(0deg), scale(0.5); + opacity: 1; } } diff --git a/node_modules/sweetalert/themes/twitter/twitter.scss b/node_modules/sweetalert/themes/twitter/twitter.scss new file mode 100644 index 0000000..2a7ec9f --- /dev/null +++ b/node_modules/sweetalert/themes/twitter/twitter.scss @@ -0,0 +1,177 @@ +// Twitter Theme for SweetAlert +// By Tristan Edwards + +.sweet-overlay { + background: rgba(41,47,51,0.9); +} + + +.sweet-alert { + $header-height: 40px; + $footer-height: 66px; + $text-color: #66757f; + $padding: 15px; + + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: $padding; + padding-top: $header-height + $padding; + text-align: right; // Align buttons + border-radius: 6px; + box-shadow: 0px 0px 0px 1px rgba(black, 0.11), 0px 6px 30px rgba(black, 0.14); + + h2 { + position: absolute; + top: 0; + left: 0; + right: 0; + height: $header-height; + line-height: $header-height; + font-size: 16px; + font-weight: 400; + color: #8899a6; + margin: 0; + color: $text-color; + border-bottom: 1px solid #e1e8ed; + } + + p { + display: block; + text-align: center; + color: #66757f; + font-weight: 400; + font-size: 13px; + margin-top: 7px; + } + + .sa-button-container { + background-color: #f5f8fa; + border-top: 1px solid #e1e8ed; + box-shadow: 0px -1px 0px white; + margin: -$padding; + margin-top: 0; + } + &[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 10px; + .sa-button-container { + display: none; + } + } + + button { + border-radius: 2px; + box-shadow: none !important; + text-shadow: 0px -1px 0px rgba(black, 0.3); + margin: 17px 0px; + border-radius: 4px; + font-size: 14px; + font-weight: 600; + padding: 8px 16px; + position: relative; + &:focus, &.cancel:focus { + box-shadow: none !important; + &::before { + content: ""; + position: absolute; + left: -5px; + top: -5px; + right: -5px; + bottom: -5px; + border: 2px solid #a5b0b4; + border-radius: 8px; + } + } + + &.confirm { + background-color: #55acee !important; + background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.05)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#0C000000)"; + border: 1px solid #3b88c3; + box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); + margin-right: $padding; + &:hover { + background-color: #55acee; + background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.15)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000, endColorstr=#26000000)"; + border-color: #3b88c3; + } + } + &.cancel { + color: #66757e; + background-color: #f5f8fa; + background-image: linear-gradient(#fff,#f5f8fa); + text-shadow: 0px -1px 0px white; + margin-right: 9px; + border: 1px solid #e1e8ed; + &:hover, &:focus:hover { + background-color: #e1e8ed; + background-image: linear-gradient(#fff,#e1e8ed); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(enabled=false)"; + border-color: #e1e8ed; + } + &:focus { + background: #fff; + border-color: #fff; + } + } + } + + .sa-icon:not(.sa-custom) { + transform: scale(0.72); + margin-bottom: -2px; + margin-top: -10px; + } + + input { + border: 1px solid #e1e8ed; + border-radius: 3px; + padding: 10px 7px; + height: auto; + box-shadow: none; + font-size: 13px; + margin: 10px 0; + &:focus { + border-color: #94A1A6; + box-shadow: inset 0 0 0 1px rgba(77, 99, 107, 0.7); + } + } + + fieldset .sa-input-error { + display: none; + } + + .sa-error-container { + text-align: center; + border: none; + background-color: #fbedc0; + margin-bottom: 6px; + &.show { + border: 1px solid #f0e1b9; + } + + .icon { + display: none; + } + p { + color: #292f33; + font-weight: 600; + margin-top: 0; + } + } +} + + +// Animations + +@mixin keyframes($animation-name) { + @-webkit-keyframes #{$animation-name} { + @content; + } + @keyframes #{$animation-name} { + @content; + } +} + +@include keyframes(animateErrorIcon) { + 0% { transform: rotateX(100deg), scale(0.5); -webkit-transform: rotateX(100deg), scale(0.5); opacity: 0; } + 100% { transform: rotateX(0deg), scale(0.5); -webkit-transform: rotateX(0deg), scale(0.5); opacity: 1; } +} \ No newline at end of file diff --git a/stylesheets/2048.css b/stylesheets/2048.css index 2a46a94..9a2b742 100644 --- a/stylesheets/2048.css +++ b/stylesheets/2048.css @@ -2,6 +2,16 @@ html { font: normal normal 30px/1 "Clear Sans", "Helvetica Neue", Arial, sans-serif; } +h1 { + text-align: center; + font-size: 80px; +} + +#score { + text-align: center; + font-size: 40px; +} + #gameboard { background: #bbada0; border-radius: 0.5rem; @@ -22,6 +32,7 @@ html { .tile { position: absolute; + text-align: center; top: 0; left: 0; transition: all 0.2s ease-in-out; @@ -59,3 +70,55 @@ html { .tile[data-val="512"] { background: #edc850; } .tile[data-val="1024"] { background: #edc53f; } .tile[data-val="2048"] { background: #edc22e; } +/* +.container { + width: 500px; + margin: 0 auto; +}*/ + +html, body { + color: #776e65; + font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif; + font-size: 18px; +} + +h1 { + font-size: 70px; +} + +.score-container, .best-container { + position: relative; + display: inline-block; + background: #bbada0; + padding: 15px 25px; + font-size: 25px; + height: 25px; + line-height: 47px; + font-weight: bold; + border-radius: 3px; + color: white; + margin-top: 8px; + text-align: center; +} + +.game-intro { + float: left; + line-height: 42px; + margin-bottom: 0; +} +.restart-button { + display: inline-block; + background: #8f7a66; + border-radius: 3px; + padding: 0 20px; + text-decoration: none; + color: #f9f6f2; + height: 40px; + line-height: 42px; + cursor: pointer; + display: block; + text-align: center; + margin: auto; + /*margin-left: 640px;*/ + width: 100px; +}