├── src
├── themes
│ ├── loading.gif
│ ├── flat-theme.css
│ ├── red-theme.css
│ ├── light-theme.css
│ ├── blue-theme.css
│ ├── dark-theme.css
│ ├── brown-theme.css
│ └── purple-theme.css
├── xsalert.js
└── jquery.min.js
└── README.md
/src/themes/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/frankeno/xsalert/HEAD/src/themes/loading.gif
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | # XSAlert
5 |
6 | ## An easy-to-use, responsive and customizable JavaScript (jQuery) Alert
7 |
8 | Check out Documentation and exampels at https://xsgames.co/xsalert
9 |
10 | ## Some examples:
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/themes/flat-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Flat Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --light-purple: #f06292;
24 | --brown: #8d6e63;
25 | --water: #4DB6A8;
26 | }
27 |
28 | /*--------------------
29 | General
30 | ---------------------*/
31 | hr { background: #777; }
32 |
33 | /*--------------------
34 | Overlay/Container
35 | ---------------------*/
36 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
37 | .xs-btn-container { width: 100%;text-align: center;}
38 |
39 | /*--------------------
40 | Positions
41 | ---------------------*/
42 | .xsalert-center { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 1rem; background: #ffffff; transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 0px; align-content: space-around;flex-wrap: wrap;align-items: stretch; }
43 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 0px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
44 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 0px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
45 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 0px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
46 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 0px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
47 |
48 |
49 | /*--------------------
50 | Title and Message
51 | ---------------------*/
52 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;color: #717171;}
53 | .xs-message { width: 100%; font-weight: 400; padding: 10px; margin: auto; text-align: center; color: #8b8b8b;}
54 | .xs-footer { width: 100%; font-weight: 400; padding: 10px; margin: auto; text-align: center; margin-top: 12px; }
55 | .xs-footer a { color: #818181;}
56 | .xs-footer a:hover { text-decoration: underline; }
57 |
58 | /*--------------------
59 | Buttons
60 | ---------------------*/
61 | .xs-ok-btn { cursor: pointer; background: #414141; border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--white); padding: 10px 10px;border-radius: 0;min-width: 100px; transition: .3s ease;margin-top: 20px;margin-right: 5px;}
62 | .xs-ok-btn:hover { background: #f1f1f1; color: #121212; }
63 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
64 | .xs-cancel-btn { cursor: pointer; background: #dadada; border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 0; min-width: 100px; margin-top: 20px;}
65 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
66 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 0; min-width: 100px; margin-top: 20px; margin-right: 8px;}
67 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
68 |
69 | /*--------------------
70 | Icons & Image
71 | ---------------------*/
72 | .xs-icon { width: 100%; text-align: center;}
73 | .xs-icon img { width: 80px; }
74 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 0;}
75 |
76 | /*--------------------
77 | Inputs
78 | ---------------------*/
79 | .xs-input { width: 92%; border: 1px solid #777; border-radius: 0; padding: 6px 10px; font-size: 14px;}
80 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 0; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
81 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 0;}
82 |
83 | /*--------------------
84 | Progress Bar
85 | ---------------------*/
86 | .xs-progress-bar { background: #607d8b; height: 7px; width: 98%; border-radius: 0;bottom: 4px;position: fixed;}
87 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
88 |
89 | /*--------------------
90 | Animations
91 | ---------------------*/
92 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
93 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
94 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
95 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
96 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
97 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
98 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
99 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
100 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
101 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
102 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
103 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
104 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
105 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
106 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
107 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
108 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
109 |
110 | /* Closing animation */
111 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
112 |
113 |
114 | /*--------------------
115 | Media Queries
116 | ---------------------*/
117 |
118 | /* Tablet */
119 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
120 | .xsalert-center { max-width: 70%;}
121 | .xsalert-top-right { max-width: 60%;}
122 | .xsalert-top-left { max-width: 60%;}
123 | .xsalert-bottom-right { max-width: 60%;}
124 | .xsalert-bottom-left { max-width: 60%;}
125 | }
126 |
127 | /* Tablet small screen*/
128 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
129 | .xsalert-center { max-width: 70%;}
130 | .xsalert-top-right { max-width: 60%;}
131 | .xsalert-top-left { max-width: 60%;}
132 | .xsalert-bottom-right { max-width: 60%;}
133 | .xsalert-bottom-left { max-width: 60%;}
134 | }
135 |
136 | /* Tablet Landscape */
137 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
138 | .xsalert-center { max-width: 40%;}
139 | }
140 |
141 | /* iPhone */
142 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
143 | .xsalert-center { max-width: 90%;}
144 | .xsalert-top-right { max-width: 70%;}
145 | .xsalert-top-right { max-width: 70%;}
146 | .xsalert-top-left { max-width: 70%;}
147 | .xsalert-bottom-right { max-width: 70%;}
148 | .xsalert-bottom-left { max-width: 70%;}
149 | }
150 |
151 | /* iPhone Landscape */
152 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
153 | .xsalert-center { max-width: 40%;}
154 | }
--------------------------------------------------------------------------------
/src/themes/red-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Red Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --light-purple: #f06292;
24 | --brown: #8d6e63;
25 | --water: #4DB6A8;
26 | --red: #dc3545;
27 | }
28 |
29 | /*--------------------
30 | General
31 | ---------------------*/
32 | hr { background: #777; }
33 |
34 | /*--------------------
35 | Overlay/Container
36 | ---------------------*/
37 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
38 | .xs-btn-container { width: 100%;text-align: center;}
39 |
40 | /*--------------------
41 | Positions
42 | ---------------------*/
43 | .xsalert-center {max-width: 32%;height: fit-content;position: fixed;top: 0;left: 0;right: 0;bottom: 0;display: flex;justify-content: center;padding: 1rem;background: var(--red);transition: all 0.4s ease-in;margin: auto;color: var(--white);border-radius: 12px;align-content: space-around;flex-wrap: wrap;align-items: stretch;}
44 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--red); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
45 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--red); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
46 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--red); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
47 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--red); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
48 |
49 |
50 | /*--------------------
51 | Title and Message
52 | ---------------------*/
53 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
54 | .xs-message {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;color: #f1f1f1;}
55 | .xs-footer {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;margin-top: 12px;}
56 | .xs-footer a { color: #ffffff; }
57 | .xs-footer a:hover { text-decoration: underline; }
58 |
59 | /*--------------------
60 | Buttons
61 | ---------------------*/
62 | .xs-ok-btn {cursor: pointer;background: #121212;border: none;outline: none;font-size: inherit;font-family: inherit;color: var(--white);padding: 10px 10px;border-radius: 8px;min-width: 100px;transition: .3s ease;margin-top: 20px;margin-right: 5px;}
63 | .xs-ok-btn:hover { background: #ffffff; color: var(--light-purple); }
64 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
65 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
66 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
67 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
68 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
69 |
70 | /*--------------------
71 | Icons & Image
72 | ---------------------*/
73 | .xs-icon { width: 100%; text-align: center;}
74 | .xs-icon img { width: 80px; }
75 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
76 |
77 | /*--------------------
78 | Inputs
79 | ---------------------*/
80 | .xs-input {width: 92%;border: 1px solid #121212;border-radius: 6px;padding: 6px 10px;font-size: 14px;background: #f9f0a3;}
81 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
82 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
83 |
84 | /*--------------------
85 | Progress Bar
86 | ---------------------*/
87 | .xs-progress-bar { background: #f9fafb; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
88 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
89 |
90 | /*--------------------
91 | Animations
92 | ---------------------*/
93 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
94 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
95 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
96 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
97 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
98 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
99 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
100 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
101 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
102 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
103 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
104 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
105 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
106 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
107 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
108 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
109 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
110 |
111 | /* Closing animation */
112 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
113 |
114 |
115 | /*--------------------
116 | Media Queries
117 | ---------------------*/
118 |
119 | /* Tablet */
120 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
121 | .xsalert-center { max-width: 70%;}
122 | .xsalert-top-right { max-width: 60%;}
123 | .xsalert-top-left { max-width: 60%;}
124 | .xsalert-bottom-right { max-width: 60%;}
125 | .xsalert-bottom-left { max-width: 60%;}
126 | }
127 |
128 | /* Tablet small screen*/
129 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
130 | .xsalert-center { max-width: 70%;}
131 | .xsalert-top-right { max-width: 60%;}
132 | .xsalert-top-left { max-width: 60%;}
133 | .xsalert-bottom-right { max-width: 60%;}
134 | .xsalert-bottom-left { max-width: 60%;}
135 | }
136 |
137 | /* Tablet Landscape */
138 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
139 | .xsalert-center { max-width: 40%;}
140 | }
141 |
142 | /* iPhone */
143 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
144 | .xsalert-center { max-width: 90%;}
145 | .xsalert-top-right { max-width: 70%;}
146 | .xsalert-top-right { max-width: 70%;}
147 | .xsalert-top-left { max-width: 70%;}
148 | .xsalert-bottom-right { max-width: 70%;}
149 | .xsalert-bottom-left { max-width: 70%;}
150 | }
151 |
152 | /* iPhone Landscape */
153 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
154 | .xsalert-center { max-width: 40%;}
155 | }
--------------------------------------------------------------------------------
/src/themes/light-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Light Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --light-purple: #f06292;
24 | --brown: #8d6e63;
25 | --water: #4DB6A8;
26 | }
27 |
28 | /*--------------------
29 | General
30 | ---------------------*/
31 | hr { background: #777; }
32 |
33 | /*--------------------
34 | Overlay/Container
35 | ---------------------*/
36 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
37 | .xs-btn-container { width: 100%;text-align: center;}
38 |
39 | /*--------------------
40 | Positions
41 | ---------------------*/
42 | .xsalert-center { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; }
43 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
44 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
45 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
46 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--white); transition: all 0.4s ease-in; margin: auto; color: var(--black); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
47 |
48 |
49 | /*--------------------
50 | Title and Message
51 | ---------------------*/
52 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
53 | .xs-message { width: 100%; font-weight: 400; padding: 10px; margin: auto; text-align: center; }
54 | .xs-footer { width: 100%; font-weight: 400; padding: 10px; margin: auto; text-align: center; margin-top: 12px; }
55 | .xs-footer a { text-decoration: none; }
56 | .xs-footer a:hover { text-decoration: underline; }
57 |
58 | /*--------------------
59 | Buttons
60 | ---------------------*/
61 | .xs-ok-btn { cursor: pointer; background: var(--black); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--white); padding: 10px 10px;border-radius: 8px;min-width: 100px; transition: .3s ease;margin-top: 20px;margin-right: 5px;}
62 | .xs-ok-btn:hover { background: #f1f1f1; color: #121212; }
63 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
64 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
65 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
66 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
67 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
68 |
69 | /*--------------------
70 | Icons & Image
71 | ---------------------*/
72 | .xs-icon { width: 100%; text-align: center;}
73 | .xs-icon img { width: 80px; }
74 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
75 |
76 | /*--------------------
77 | Inputs
78 | ---------------------*/
79 | .xs-input { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;}
80 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
81 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
82 |
83 | /*--------------------
84 | Progress Bar
85 | ---------------------*/
86 | .xs-progress-bar { background: #607d8b; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
87 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
88 |
89 | /*--------------------
90 | Animations
91 | ---------------------*/
92 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
93 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
94 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
95 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
96 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
97 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
98 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
99 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
100 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
101 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
102 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
103 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
104 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
105 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
106 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
107 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
108 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
109 |
110 | /* Closing animation */
111 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
112 |
113 |
114 | /*--------------------
115 | Media Queries
116 | ---------------------*/
117 |
118 | /* Tablet */
119 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
120 | .xsalert-center { max-width: 70%;}
121 | .xsalert-top-right { max-width: 60%;}
122 | .xsalert-top-left { max-width: 60%;}
123 | .xsalert-bottom-right { max-width: 60%;}
124 | .xsalert-bottom-left { max-width: 60%;}
125 | }
126 |
127 | /* Tablet small screen*/
128 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
129 | .xsalert-center { max-width: 70%;}
130 | .xsalert-top-right { max-width: 60%;}
131 | .xsalert-top-left { max-width: 60%;}
132 | .xsalert-bottom-right { max-width: 60%;}
133 | .xsalert-bottom-left { max-width: 60%;}
134 | }
135 |
136 | /* Tablet Landscape */
137 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
138 | .xsalert-center { max-width: 40%;}
139 | }
140 |
141 | /* iPhone */
142 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
143 | .xsalert-center { max-width: 90%;}
144 | .xsalert-top-right { max-width: 70%;}
145 | .xsalert-top-right { max-width: 70%;}
146 | .xsalert-top-left { max-width: 70%;}
147 | .xsalert-bottom-right { max-width: 70%;}
148 | .xsalert-bottom-left { max-width: 70%;}
149 | }
150 |
151 | /* iPhone Landscape */
152 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
153 | .xsalert-center { max-width: 40%;}
154 | }
--------------------------------------------------------------------------------
/src/themes/blue-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Blue Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --light-purple: #f06292;
24 | --brown: #8d6e63;
25 | --water: #4DB6A8;
26 | --red: #dc3545;
27 | }
28 |
29 | /*--------------------
30 | General
31 | ---------------------*/
32 | hr { background: #777; }
33 |
34 | /*--------------------
35 | Overlay/Container
36 | ---------------------*/
37 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
38 | .xs-btn-container { width: 100%;text-align: center;}
39 |
40 | /*--------------------
41 | Positions
42 | ---------------------*/
43 | .xsalert-center {max-width: 32%;height: fit-content;position: fixed;top: 0;left: 0;right: 0;bottom: 0;display: flex;justify-content: center;padding: 1rem;background: var(--blue);transition: all 0.4s ease-in;margin: auto;color: var(--white);border-radius: 12px;align-content: space-around;flex-wrap: wrap;align-items: stretch;}
44 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--blue); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
45 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--blue); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
46 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--blue); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
47 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--blue); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
48 |
49 |
50 | /*--------------------
51 | Title and Message
52 | ---------------------*/
53 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
54 | .xs-message {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;color: #f1f1f1;}
55 | .xs-footer {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;margin-top: 12px;}
56 | .xs-footer a { color: #ffffff; }
57 | .xs-footer a:hover { text-decoration: underline; }
58 |
59 | /*--------------------
60 | Buttons
61 | ---------------------*/
62 | .xs-ok-btn {cursor: pointer;background: #184e63;border: none;outline: none;font-size: inherit;font-family: inherit;color: var(--white);padding: 10px 10px;border-radius: 8px;min-width: 100px;transition: .3s ease;margin-top: 20px;margin-right: 5px;}
63 | .xs-ok-btn:hover { background: #ffffff; color: var(--light-purple); }
64 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
65 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
66 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
67 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
68 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
69 |
70 | /*--------------------
71 | Icons & Image
72 | ---------------------*/
73 | .xs-icon { width: 100%; text-align: center;}
74 | .xs-icon img { width: 80px; }
75 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
76 |
77 | /*--------------------
78 | Inputs
79 | ---------------------*/
80 | .xs-input {width: 92%;border: 1px solid #ffffff;border-radius: 6px;padding: 6px 10px;font-size: 14px;background: #e0e0e0;color: #121212;}
81 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
82 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
83 |
84 | /*--------------------
85 | Progress Bar
86 | ---------------------*/
87 | .xs-progress-bar { background: #f9fafb; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
88 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
89 |
90 | /*--------------------
91 | Animations
92 | ---------------------*/
93 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
94 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
95 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
96 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
97 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
98 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
99 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
100 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
101 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
102 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
103 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
104 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
105 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
106 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
107 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
108 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
109 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
110 |
111 | /* Closing animation */
112 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
113 |
114 |
115 | /*--------------------
116 | Media Queries
117 | ---------------------*/
118 |
119 | /* Tablet */
120 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
121 | .xsalert-center { max-width: 70%;}
122 | .xsalert-top-right { max-width: 60%;}
123 | .xsalert-top-left { max-width: 60%;}
124 | .xsalert-bottom-right { max-width: 60%;}
125 | .xsalert-bottom-left { max-width: 60%;}
126 | }
127 |
128 | /* Tablet small screen*/
129 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
130 | .xsalert-center { max-width: 70%;}
131 | .xsalert-top-right { max-width: 60%;}
132 | .xsalert-top-left { max-width: 60%;}
133 | .xsalert-bottom-right { max-width: 60%;}
134 | .xsalert-bottom-left { max-width: 60%;}
135 | }
136 |
137 | /* Tablet Landscape */
138 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
139 | .xsalert-center { max-width: 40%;}
140 | }
141 |
142 | /* iPhone */
143 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
144 | .xsalert-center { max-width: 90%;}
145 | .xsalert-top-right { max-width: 70%;}
146 | .xsalert-top-right { max-width: 70%;}
147 | .xsalert-top-left { max-width: 70%;}
148 | .xsalert-bottom-right { max-width: 70%;}
149 | .xsalert-bottom-left { max-width: 70%;}
150 | }
151 |
152 | /* iPhone Landscape */
153 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
154 | .xsalert-center { max-width: 40%;}
155 | }
--------------------------------------------------------------------------------
/src/themes/dark-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Red Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --light-purple: #f06292;
24 | --brown: #8d6e63;
25 | --water: #4DB6A8;
26 | }
27 |
28 | /*--------------------
29 | General
30 | ---------------------*/
31 | hr { background: #777; }
32 |
33 | /*--------------------
34 | Overlay/Container
35 | ---------------------*/
36 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
37 | .xs-btn-container { width: 100%;text-align: center;}
38 |
39 | /*--------------------
40 | Positions
41 | ---------------------*/
42 | .xsalert-center {max-width: 32%;height: fit-content;position: fixed;top: 0;left: 0;right: 0;bottom: 0;display: flex;justify-content: center;padding: 1rem;background: var(--black);transition: all 0.4s ease-in;margin: auto;color: var(--white);border-radius: 12px;align-content: space-around;flex-wrap: wrap;align-items: stretch;}
43 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--black); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
44 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--black); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
45 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--black); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
46 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--black); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
47 |
48 |
49 | /*--------------------
50 | Title and Message
51 | ---------------------*/
52 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
53 | .xs-message { width: 100%; font-weight: 400; padding: 10px; margin: auto; text-align: center; color: #cecece }
54 | .xs-footer {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;margin-top: 12px;}
55 | .xs-footer a { color: #ffffff; }
56 | .xs-footer a:hover { text-decoration: underline; }
57 |
58 | /*--------------------
59 | Buttons
60 | ---------------------*/
61 | .xs-ok-btn {cursor: pointer;background: var(--light-purple);border: none;outline: none;font-size: inherit;font-family: inherit;color: var(--white);padding: 10px 10px;border-radius: 8px;min-width: 100px;transition: .3s ease;margin-top: 20px;margin-right: 5px;}
62 | .xs-ok-btn:hover { background: #ffffff; color: var(--light-purple); }
63 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
64 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
65 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
66 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
67 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
68 |
69 | /*--------------------
70 | Icons & Image
71 | ---------------------*/
72 | .xs-icon { width: 100%; text-align: center;}
73 | .xs-icon img { width: 80px; }
74 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
75 |
76 | /*--------------------
77 | Inputs
78 | ---------------------*/
79 | .xs-input {width: 92%;border: 1px solid #f1f1f1;border-radius: 6px;padding: 6px 10px;font-size: 14px;background: transparent;color: #fff;}
80 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
81 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
82 |
83 | /*--------------------
84 | Progress Bar
85 | ---------------------*/
86 | .xs-progress-bar { background: #607d8b; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
87 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
88 |
89 | /*--------------------
90 | Animations
91 | ---------------------*/
92 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
93 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
94 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
95 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
96 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
97 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
98 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
99 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
100 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
101 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
102 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
103 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
104 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
105 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
106 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
107 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
108 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
109 |
110 | /* Closing animation */
111 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
112 |
113 |
114 | /*--------------------
115 | Media Queries
116 | ---------------------*/
117 |
118 | /* Tablet */
119 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
120 | .xsalert-center { max-width: 70%;}
121 | .xsalert-top-right { max-width: 60%;}
122 | .xsalert-top-left { max-width: 60%;}
123 | .xsalert-bottom-right { max-width: 60%;}
124 | .xsalert-bottom-left { max-width: 60%;}
125 | }
126 |
127 | /* Tablet small screen*/
128 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
129 | .xsalert-center { max-width: 70%;}
130 | .xsalert-top-right { max-width: 60%;}
131 | .xsalert-top-left { max-width: 60%;}
132 | .xsalert-bottom-right { max-width: 60%;}
133 | .xsalert-bottom-left { max-width: 60%;}
134 | }
135 |
136 | /* Tablet Landscape */
137 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
138 | .xsalert-center { max-width: 40%;}
139 | }
140 |
141 | /* iPhone */
142 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
143 | .xsalert-center { max-width: 90%;}
144 | .xsalert-top-right { max-width: 70%;}
145 | .xsalert-top-right { max-width: 70%;}
146 | .xsalert-top-left { max-width: 70%;}
147 | .xsalert-bottom-right { max-width: 70%;}
148 | .xsalert-bottom-left { max-width: 70%;}
149 | }
150 |
151 | /* iPhone Landscape */
152 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
153 | .xsalert-center { max-width: 40%;}
154 | }
--------------------------------------------------------------------------------
/src/themes/brown-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Brown Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --dark-purple: #5e3682;
24 | --light-purple: #f06292;
25 | --brown: #8d6e63;
26 | --water: #4DB6A8;
27 | --red: #dc3545;
28 | }
29 |
30 | /*--------------------
31 | General
32 | ---------------------*/
33 | hr { background: #777; }
34 |
35 | /*--------------------
36 | Overlay/Container
37 | ---------------------*/
38 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
39 | .xs-btn-container { width: 100%;text-align: center;}
40 |
41 | /*--------------------
42 | Positions
43 | ---------------------*/
44 | .xsalert-center {max-width: 32%;height: fit-content;position: fixed;top: 0;left: 0;right: 0;bottom: 0;display: flex;justify-content: center;padding: 1rem;background: var(--brown);transition: all 0.4s ease-in;margin: auto;color: var(--white);border-radius: 12px;align-content: space-around;flex-wrap: wrap;align-items: stretch;}
45 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--brown); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
46 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--brown); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
47 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--brown); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
48 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--brown); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
49 |
50 |
51 | /*--------------------
52 | Title and Message
53 | ---------------------*/
54 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
55 | .xs-message {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;color: #f1f1f1;}
56 | .xs-footer {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;margin-top: 12px;}
57 | .xs-footer a { color: #ffffff; }
58 | .xs-footer a:hover { text-decoration: underline; }
59 |
60 | /*--------------------
61 | Buttons
62 | ---------------------*/
63 | .xs-ok-btn {cursor: pointer;background: #1a1233;border: none;outline: none;font-size: inherit;font-family: inherit;color: var(--white);padding: 10px 10px;border-radius: 8px;min-width: 100px;transition: .3s ease;margin-top: 20px;margin-right: 5px;}
64 | .xs-ok-btn:hover { background: #ffffff; color: var(--light-purple); }
65 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
66 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
67 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
68 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
69 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
70 |
71 | /*--------------------
72 | Icons & Image
73 | ---------------------*/
74 | .xs-icon { width: 100%; text-align: center;}
75 | .xs-icon img { width: 80px; }
76 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
77 |
78 | /*--------------------
79 | Inputs
80 | ---------------------*/
81 | .xs-input {width: 92%;border: 1px solid #121212;border-radius: 6px;padding: 6px 10px;font-size: 14px;background: #4a352f;color: #fff;}
82 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
83 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
84 |
85 | /*--------------------
86 | Progress Bar
87 | ---------------------*/
88 | .xs-progress-bar { background: #f9fafb; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
89 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
90 |
91 | /*--------------------
92 | Animations
93 | ---------------------*/
94 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
95 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
96 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
97 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
98 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
99 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
100 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
101 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
102 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
103 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
104 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
105 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
106 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
107 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
108 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
109 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
110 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
111 |
112 | /* Closing animation */
113 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
114 |
115 |
116 | /*--------------------
117 | Media Queries
118 | ---------------------*/
119 |
120 | /* Tablet */
121 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
122 | .xsalert-center { max-width: 70%;}
123 | .xsalert-top-right { max-width: 60%;}
124 | .xsalert-top-left { max-width: 60%;}
125 | .xsalert-bottom-right { max-width: 60%;}
126 | .xsalert-bottom-left { max-width: 60%;}
127 | }
128 |
129 | /* Tablet small screen*/
130 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
131 | .xsalert-center { max-width: 70%;}
132 | .xsalert-top-right { max-width: 60%;}
133 | .xsalert-top-left { max-width: 60%;}
134 | .xsalert-bottom-right { max-width: 60%;}
135 | .xsalert-bottom-left { max-width: 60%;}
136 | }
137 |
138 | /* Tablet Landscape */
139 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
140 | .xsalert-center { max-width: 40%;}
141 | }
142 |
143 | /* iPhone */
144 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
145 | .xsalert-center { max-width: 90%;}
146 | .xsalert-top-right { max-width: 70%;}
147 | .xsalert-top-right { max-width: 70%;}
148 | .xsalert-top-left { max-width: 70%;}
149 | .xsalert-bottom-right { max-width: 70%;}
150 | .xsalert-bottom-left { max-width: 70%;}
151 | }
152 |
153 | /* iPhone Landscape */
154 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
155 | .xsalert-center { max-width: 40%;}
156 | }
--------------------------------------------------------------------------------
/src/themes/purple-theme.css:
--------------------------------------------------------------------------------
1 | /*-------------------------------------
2 | XSAlert - Purple Theme
3 | Made by Frank Eno - XSGames
4 | URL: https://xsgames.co/xsalert
5 | Twitter: @xsgames_
6 | --------------------------------------*/
7 |
8 | /*--------------------
9 | Colors
10 | ---------------------*/
11 | :root {
12 | --lightgray: #efefef;
13 | --blue: steelblue;
14 | --white: #ffffff;
15 | --black: #121212;
16 | --default: #ffeb3b;
17 | --green: #9ccc65;
18 | --orange: #ffc107;
19 | --blue: #00bcd4;
20 | --dark-orange: #ff5722;
21 | --gray: #b0bec5;
22 | --purple: #b39ddb;
23 | --dark-purple: #5e3682;
24 | --light-purple: #f06292;
25 | --brown: #8d6e63;
26 | --water: #4DB6A8;
27 | --red: #dc3545;
28 | }
29 |
30 | /*--------------------
31 | General
32 | ---------------------*/
33 | hr { background: #777; }
34 |
35 | /*--------------------
36 | Overlay/Container
37 | ---------------------*/
38 | .xsoverlay { width: 100%; height: 100%; position: fixed; background: rgba(0, 0, 0, 0.8); top: 0;bottom: 0;left: 0;right: 0; }
39 | .xs-btn-container { width: 100%;text-align: center;}
40 |
41 | /*--------------------
42 | Positions
43 | ---------------------*/
44 | .xsalert-center {max-width: 32%;height: fit-content;position: fixed;top: 0;left: 0;right: 0;bottom: 0;display: flex;justify-content: center;padding: 1rem;background: var(--dark-purple);transition: all 0.4s ease-in;margin: auto;color: var(--white);border-radius: 12px;align-content: space-around;flex-wrap: wrap;align-items: stretch;}
45 | .xsalert-top-left { max-width: 32%; height: fit-content; position: fixed; top: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--dark-purple); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-left: 20px;}
46 | .xsalert-top-right { max-width: 32%; height: fit-content; position: fixed; top: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--dark-purple); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-top: 20px;margin-right: 20px;}
47 | .xsalert-bottom-left { max-width: 32%; height: fit-content; position: fixed; bottom: 0; left: 0; display: flex; justify-content: center; padding: 1rem; background: var(--dark-purple); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;margin-left: 20px;}
48 | .xsalert-bottom-right { max-width: 32%; height: fit-content; position: fixed; bottom: 0; right: 0; display: flex; justify-content: center; padding: 1rem; background: var(--dark-purple); transition: all 0.4s ease-in; margin: auto; color: var(--white); border-radius: 12px; align-content: space-around;flex-wrap: wrap;align-items: stretch; margin-bottom: 20px;right: 20px;}
49 |
50 |
51 | /*--------------------
52 | Title and Message
53 | ---------------------*/
54 | .xs-title { width: 100%; font-weight: 600; padding: 10px; text-align: center; font-size: 32px;}
55 | .xs-message {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;color: #f1f1f1;}
56 | .xs-footer {width: 100%;font-weight: 400;padding: 10px;margin: auto;text-align: center;margin-top: 12px;}
57 | .xs-footer a { color: #ffffff; }
58 | .xs-footer a:hover { text-decoration: underline; }
59 |
60 | /*--------------------
61 | Buttons
62 | ---------------------*/
63 | .xs-ok-btn {cursor: pointer;background: #1a1233;border: none;outline: none;font-size: inherit;font-family: inherit;color: var(--white);padding: 10px 10px;border-radius: 8px;min-width: 100px;transition: .3s ease;margin-top: 20px;margin-right: 5px;}
64 | .xs-ok-btn:hover { background: #ffffff; color: var(--light-purple); }
65 | .xs-ok-btn:focus { border: 3px solid #aacef3; }
66 | .xs-cancel-btn { cursor: pointer; background: var(--lightgray); border: none; outline: none; font-size: inherit; font-family: inherit; color: var(--black); padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px;}
67 | .xs-cancel-btn:hover { background: #121212; color: #f1f1f1; }
68 | .xs-third-btn { cursor: pointer; background: var(--orange); border: none; outline: none; font-size: inherit; font-family: inherit; color: #121221; padding: 10px 10px; border-radius: 8px; min-width: 100px; margin-top: 20px; margin-right: 8px;}
69 | .xs-third-btn:hover { background: #121212; color: #f1f1f1; }
70 |
71 | /*--------------------
72 | Icons & Image
73 | ---------------------*/
74 | .xs-icon { width: 100%; text-align: center;}
75 | .xs-icon img { width: 80px; }
76 | .xs-image img { width: 100%;object-fit: cover; margin-top: 10px; border-radius: 10px;}
77 |
78 | /*--------------------
79 | Inputs
80 | ---------------------*/
81 | .xs-input {width: 92%;border: 1px solid #121212;border-radius: 6px;padding: 6px 10px;font-size: 14px;background: #33184e;color: #fff;}
82 | .xs-textarea { width: 92%; border: 1px solid #121212; border-radius: 6px; padding: 6px 10px; font-size: 14px;height: 80px; white-space: pre-wrap; }
83 | .xs-select { color: #121212; width: 90%;height: 38px;border-radius: 6px;}
84 |
85 | /*--------------------
86 | Progress Bar
87 | ---------------------*/
88 | .xs-progress-bar { background: #f9fafb; height: 7px; width: 98%; border-radius: 99px;bottom: 4px;position: fixed;}
89 | .xs-progress-icon { width: 40px; margin-bottom: 10px;}
90 |
91 | /*--------------------
92 | Animations
93 | ---------------------*/
94 | .scale-up-center{animation:scale-up-center 0.4s ease both; } @keyframes scale-up-center{ 0%{transform:scale(0)} 100%{transform:scale(1)} }
95 | .scale-up-top{animation:scale-up-top 0.4s ease both; } @keyframes scale-up-top{0%{transform:scale(0);transform-origin:center top}100%{transform:scale(1);transform-origin:center top}}
96 | .scale-up-bottom{animation:scale-up-bottom 0.4s ease both; } @keyframes scale-up-bottom{0%{transform:scale(0);transform-origin:center bottom}100%{transform:scale(1);transform-origin:center bottom}}
97 | .slide-top{animation:slide-top 0.4s ease both; } @keyframes slide-top{0%{transform:translateY(-2000px)}100%{transform:translateY(0px)}}
98 | .slide-bottom{animation:slide-bottom 0.4s ease both}@keyframes slide-bottom{0%{transform:translateY(2000px)}100%{transform:translateY(0px)}}
99 | .jello-horizontal{animation:jello-horizontal .6s linear both} @keyframes jello-horizontal{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}100%{transform:scale3d(1,1,1)}}
100 | .jello-vertical{animation:jello-vertical .6s ease both; } @keyframes jello-vertical{0%{transform:scale3d(1,1,1)}30%{transform:scale3d(.75,1.25,1)}40%{transform:scale3d(1.25,.75,1)}50%{transform:scale3d(.85,1.15,1)}65%{transform:scale3d(1.05,.95,1)}75%{transform:scale3d(.95,1.05,1)}100%{transform:scale3d(1,1,1)}}
101 | .jello-diagonal{animation:jello-diagonal .6s ease both; } @keyframes jello-diagonal{0%{transform:skew(0deg 0deg)}30%{transform:skew(25deg 25deg)}40%{transform:skew(-15deg,-15deg)}50%{transform:skew(15deg,15deg)}65%{transform:skew(-5deg,-5deg)}75%{transform:skew(5deg,5deg)}100%{transform:skew(0deg 0deg)}}
102 | .rotate-top{animation:rotate-top 0.4s linear} @keyframes rotate-top{0%{transform:rotate(0);transform-origin:top}100%{transform:rotate(360deg);transform-origin:top}}
103 | .rotate-scale-up{animation:rotate-scale-up 0.4s linear both} @keyframes rotate-scale-up{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(2) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
104 | .rotate-scale-down{animation:rotate-scale-down 0.4s linear both} @keyframes rotate-scale-down{0%{transform:scale(1) rotateZ(0)}50%{transform:scale(.5) rotateZ(180deg)}100%{transform:scale(1) rotateZ(360deg)}}
105 | .rotate-scale-up-horizontal{animation:rotate-scale-up-horizontal 0.4s linear both} @keyframes rotate-scale-up-horizontal{0%{transform:scale(1) rotateX(0)}50%{transform:scale(2) rotateX(-180deg)}100%{transform:scale(1) rotateX(-360deg)}}
106 | .rotate-scale-up-vertical{animation:rotate-scale-up-vertical 0.4s linear both} @keyframes rotate-scale-up-vertical{0%{transform:scale(1) rotateY(0)}50%{transform:scale(2) rotateY(180deg)}100%{transform:scale(1) rotateY(360deg)}}
107 | .blur-in{animation:blur-in 0.4s linear both} @keyframes blur-in{0%{filter:blur(12px);opacity:0}100%{filter:blur(0);opacity:1}}
108 | .shake-horizontal{animation:shake-horizontal 0.8s linear both} @keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
109 | .shake-left-right{animation:shake-left-right 0.8s linear both} @keyframes shake-left-right{0%,100%{transform:rotate(0deg);transform-origin:50% 50%}10%{transform:rotate(8deg)}20%,40%,60%{transform:rotate(-10deg)}30%,50%,70%{transform:rotate(10deg)}80%{transform:rotate(-8deg)}90%{transform:rotate(8deg)}}
110 | .bounce-top{animation:bounce-top .9s linear both} @keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0);animation-timing-function:ease-out}100%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}}
111 |
112 | /* Closing animation */
113 | .closing-anim{animation:closing-anim 0.2s ease both } @keyframes closing-anim{0%{transform:scale(1)}100%{transform:scale(0)}}
114 |
115 |
116 | /*--------------------
117 | Media Queries
118 | ---------------------*/
119 |
120 | /* Tablet */
121 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
122 | .xsalert-center { max-width: 70%;}
123 | .xsalert-top-right { max-width: 60%;}
124 | .xsalert-top-left { max-width: 60%;}
125 | .xsalert-bottom-right { max-width: 60%;}
126 | .xsalert-bottom-left { max-width: 60%;}
127 | }
128 |
129 | /* Tablet small screen*/
130 | @media only screen and (min-device-width: 600px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
131 | .xsalert-center { max-width: 70%;}
132 | .xsalert-top-right { max-width: 60%;}
133 | .xsalert-top-left { max-width: 60%;}
134 | .xsalert-bottom-right { max-width: 60%;}
135 | .xsalert-bottom-left { max-width: 60%;}
136 | }
137 |
138 | /* Tablet Landscape */
139 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) {
140 | .xsalert-center { max-width: 40%;}
141 | }
142 |
143 | /* iPhone */
144 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
145 | .xsalert-center { max-width: 90%;}
146 | .xsalert-top-right { max-width: 70%;}
147 | .xsalert-top-right { max-width: 70%;}
148 | .xsalert-top-left { max-width: 70%;}
149 | .xsalert-bottom-right { max-width: 70%;}
150 | .xsalert-bottom-left { max-width: 70%;}
151 | }
152 |
153 | /* iPhone Landscape */
154 | @media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: landscape) {
155 | .xsalert-center { max-width: 40%;}
156 | }
--------------------------------------------------------------------------------
/src/xsalert.js:
--------------------------------------------------------------------------------
1 | /* Global */
2 | var fileData;
3 | var isChecked;
4 | /* Function */
5 | function XSAlert({
6 | icon,
7 | title,
8 | titleColor,
9 | titleFontSize,
10 | titleFontFamily,
11 | message,
12 | messageColor,
13 | messageFontSize,
14 | messageFontFamily,
15 | position,
16 | animation,
17 | okButtonText,
18 | cancelButtonText,
19 | thirdButtonText,
20 | okButtonBackgroundColor,
21 | okButtonTextColor,
22 | cancelButtonBackgroundColor,
23 | cancelButtonTextColor,
24 | thirdButtonBackgroundColor,
25 | thirdButtonTextColor,
26 | hideOkButton,
27 | hideCancelButton,
28 | buttonBorderRadius,
29 | closeOnOutsideClick,
30 | closeWithESC,
31 | backgroundColor,
32 | borderSize,
33 | borderColor,
34 | borderRadius,
35 | buttonsOnLeft,
36 | buttonsOnRight,
37 | boxShadow,
38 | overlayImageURL,
39 | footer,
40 | inputType,
41 | inputPlaceholder,
42 | inputValue,
43 | inputAttributes,
44 | imageURL,
45 | imageWidth,
46 | imageHeight,
47 | autoCloseTimer,
48 | hideProgressBar,
49 | hideProgressIcon,
50 | }) {
51 | return new Promise(function(resolve, reject) {
52 | setTimeout(function(){
53 | if(animation == null){ animation = 'scale-up-center'; }
54 | if(okButtonText == null){ okButtonText = 'OK'; }
55 | if(cancelButtonText == null){ cancelButtonText = 'Cancel'; }
56 | if(position == null){ position = 'center'; }
57 |
58 | /* Icons */
59 | if(icon == 'success'){ icon = 'https://xsgames.co/xsalert/icons/success.png'; };
60 | if(icon == 'warning'){ icon = 'https://xsgames.co/xsalert/icons/warning.png'; };
61 | if(icon == 'error'){ icon = 'https://xsgames.co/xsalert/icons/error.png'; };
62 | if(icon == 'question'){ icon = 'https://xsgames.co/xsalert/icons/question.png'; };
63 | if(icon == 'notification'){ icon = 'https://xsgames.co/xsalert/icons/notification.png'; };
64 | if(icon == 'like'){ icon = 'https://xsgames.co/xsalert/icons/like.png'; };
65 | if(icon == 'thumbup'){ icon = 'https://xsgames.co/xsalert/icons/thumbup.png'; };
66 | if(icon == 'thumbdown'){ icon = 'https://xsgames.co/xsalert/icons/thumbdown.png'; };
67 |
68 | /* Build Alert */
69 | $('body').append(
70 | '
'+
81 | ''+inputPlaceholder+'
').insertAfter('#xs-input'); } 168 | $('#xs-input').on('change', function(){ isChecked = $('#xs-input').is(":checked") }) 169 | break; 170 | 171 | } 172 | 173 | /* Prevent body to scroll behind the alert */ 174 | let body = document.querySelector("body"); body.style.overflow = "hidden"; 175 | /* Overlay onClick */ 176 | if(closeOnOutsideClick){ $('#xsoverlay').click(function() { closeXSAlert(); resolve('outside'); }); } 177 | /* OK button onClick */ 178 | $('#xs-ok-btn').click(function() { closeXSAlert(); resolve('ok') }); 179 | $("#xs-ok-btn").focus(); 180 | /* Cancel button onClick */ 181 | $('#xs-cancel-btn').click(function() { closeXSAlert(); resolve('cancel') }); 182 | /* Third button onClick */ 183 | $('#xs-third-btn').click(function() { closeXSAlert(); resolve('third') }); 184 | /* Close with ESC key */ 185 | if(closeWithESC != null && closeWithESC) { $('#xsalert').on('keydown', function(event) { if (event.key == "Escape") { closeXSAlert() } }) } 186 | }, 210); 187 | }) 188 | } 189 | /* Close XSAlert */ 190 | function closeXSAlert(){ 191 | $('#xsalert').addClass('closing-anim'); 192 | /* Make body scrollable again */ 193 | let body = document.querySelector("body"); 194 | body.style.overflow = "auto"; 195 | setTimeout(function(){ 196 | $("#xsalert").each(function() { $(this).remove(); }) 197 | $("#xsoverlay").remove(); 198 | }, 100); 199 | } 200 | -------------------------------------------------------------------------------- /src/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0