| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title></title>
- </head>
- <body>
- <div id="loadding">
- <div class="loader">
- <div class="horizontal">
- <div class="circlesup">
- <div class="circle"></div>
- <div class="circle"></div>
- <div class="circle"></div>
- <div class="circle"></div>
- <div class="circle"></div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <style type="text/css">
- /* Start the loader code, first, let's align it the center of screen */
- .loader {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- text-align: center;
- /* disable selection and cursor changes */
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- cursor: default;
- z-index: 2000;
- }
- /* Text align it the center of screen and connect the looped animation for 2 seconds */
- .text {
- position: fixed;
- left: -2.1rem;
- top: -1.7rem;
- -webkit-animation: text 2s infinite;
- -moz-animation: text 2s infinite;
- -moz-animation: text 2s infinite;
- -ms-animation: text 2s infinite;
- -o-animation: text 2s infinite;
- animation: text 2s infinite;
- }
- /* Set for the second layer horizontal position */
- .horizontal {
- position: fixed;
- top: -2.5rem;
- left: -2rem;
- -webkit-transform: rotate(0deg);
- -moz-transform: rotate(0deg);
- -ms-transform: rotate(0deg);
- -o-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- /* The next two classes do mirror for animation */
- .circlesup {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- /* Create a container for our circles, rotate it 45 degrees and set animation*/
- .circle {
- position: fixed;
- width: 3rem;
- height: 3rem;
- -webkit-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
- -webkit-animation: orbit 2s infinite;
- -moz-animation: orbit 2s infinite;
- -moz-animation: orbit 2s infinite;
- -ms-animation: orbit 2s infinite;
- -o-animation: orbit 2s infinite;
- animation: orbit 2s infinite;
- z-index: 5;
- }
- /* Style's of our circles */
- .circle:after {
- content: "";
- position: fixed;
- width: 15px;
- height: 15px;
- -webkit-border-radius: 100%;
- -moz-border-radius: 100%;
- -ms-border-radius: 100%;
- -o-border-radius: 100%;
- border-radius: 100%;
- background: #d33047; /* Pick a color 1*/
- }
- .circle:nth-child(2) {
- -webkit-animation-delay: 100ms;
- -moz-animation-delay: 100ms;
- -ms-animation-delay: 100ms;
- -o-animation-delay: 100ms;
- animation-delay: 100ms;
- z-index: 4;
- }
- .circle:nth-child(2):after {
- background: #ff3d38; /* Pick a color 2*/
- -webkit-transform: scale(0.8, 0.8);
- -moz-transform: scale(0.8, 0.8);
- -ms-transform: scale(0.8, 0.8);
- -o-transform: scale(0.8, 0.8);
- transform: scale(0.8, 0.8);
- }
- .circle:nth-child(3) {
- -webkit-animation-delay: 225ms;
- -moz-animation-delay: 225ms;
- -ms-animation-delay: 225ms;
- -o-animation-delay: 225ms;
- animation-delay: 225ms;
- z-index: 3;
- }
- .circle:nth-child(3):after {
- background: #ffa489; /* Pick a color 3*/
- -webkit-transform: scale(0.6, 0.6);
- -moz-transform: scale(0.6, 0.6);
- -ms-transform: scale(0.6, 0.6);
- -o-transform: scale(0.6, 0.6);
- transform: scale(0.6, 0.6);
- }
- .circle:nth-child(4) {
- -webkit-animation-delay: 350ms;
- -moz-animation-delay: 350ms;
- -ms-animation-delay: 350ms;
- -o-animation-delay: 350ms;
- animation-delay: 350ms;
- z-index: 2;
- }
- .circle:nth-child(4):after {
- background: #ff6d37; /* Pick a color 4*/
- -webkit-transform: scale(0.4, 0.4);
- -moz-transform: scale(0.4, 0.4);
- -ms-transform: scale(0.4, 0.4);
- -o-transform: scale(0.4, 0.4);
- transform: scale(0.4, 0.4);
- }
- .circle:nth-child(5) {
- -webkit-animation-delay: 475ms;
- -moz-animation-delay: 475ms;
- -ms-animation-delay: 475ms;
- -o-animation-delay: 475ms;
- animation-delay: 475ms;
- z-index: 1;
- }
- .circle:nth-child(5):after {
- background: #db2f00; /* Pick a color 5*/
- -webkit-transform: scale(0.2, 0.2);
- -moz-transform: scale(0.2, 0.2);
- -ms-transform: scale(0.2, 0.2);
- -o-transform: scale(0.2, 0.2);
- transform: scale(0.2, 0.2);
- }
- /* Animation keys */
- @-webkit-keyframes orbit {
- 0% {
- -webkit-transform: rotate(45deg);
- }
- 5% {
- -webkit-transform: rotate(45deg);
- -webkit-animation-timing-function: ease-out;
- }
- 70% {
- -webkit-transform: rotate(405deg);
- -webkit-animation-timing-function: ease-in;
- }
- 100% {
- -webkit-transform: rotate(405deg);
- }
- }
- @keyframes orbit {
- 0% {
- transform: rotate(45deg);
- }
- 5% {
- transform: rotate(45deg);
- animation-timing-function: ease-out;
- }
- 70% {
- transform: rotate(405deg);
- animation-timing-function: ease-in;
- }
- 100% {
- transform: rotate(405deg);
- }
- }
- @-webkit-keyframes text {
- 0% {
- -webkit-transform: scale(0.2, 0.2);
- -webkit-animation-timing-function: ease-out;
- }
- 40%,
- 60% {
- -webkit-transform: scale(1, 1);
- -webkit-animation-timing-function: ease-out;
- }
- 70%,
- 100% {
- -webkit-transform: scale(0.2, 0.2);
- }
- }
- @-moz-keyframes text {
- 0% {
- -moz-transform: scale(0.2, 0.2);
- -moz-animation-timing-function: ease-out;
- }
- 50% {
- -moz-transform: scale(1, 1);
- -moz-animation-timing-function: ease-out;
- }
- 60% {
- -moz-transform: scale(1, 1);
- -moz-animation-timing-function: ease-out;
- }
- 100% {
- -moz-transform: scale(0.2, 0.2);
- }
- }
- @keyframes text {
- 0% {
- transform: scale(0.2, 0.2);
- animation-timing-function: ease-out;
- }
- 50% {
- transform: scale(1, 1);
- animation-timing-function: ease-out;
- }
- 60% {
- transform: scale(1, 1);
- animation-timing-function: ease-out;
- }
- 100% {
- transform: scale(0.2, 0.2);
- }
- }
- </style>
- <script type="text/javascript">
- // 常用工具函数
- var tools = {
- formatParams: function(data) {
- var arr = [];
- for (var name in data) {
- arr.push(encodeURIComponent(name) + "=" + encodeURIComponent(data[name]));
- }
- return arr.join("&");
- },
- /* ajax请求get
- * @param url string 请求的路径
- * @param query object 请求的参数query
- * @param succCb function 请求成功之后的回调
- * @param failCb function 请求失败的回调
- * @param isJson boolean true: 解析json false:文本请求 默认值true
- */
- ajaxGet: function (url, query, succCb, failCb, isJson) {
- // 拼接url加query
- if (query) {
- var parms = tools.formatParams(query);
- url += '&' + parms;
- // console.log('-------------',url);
- }
- // 1、创建对象
- var ajax = new XMLHttpRequest();
- // 2、建立连接
- // true:请求为异步 false:同步
- ajax.open("GET", url, true);
- // ajax.setRequestHeader("Origin",STATIC_PATH);
- // ajax.setRequestHeader("Access-Control-Allow-Origin","*");
- // // 响应类型
- // ajax.setRequestHeader('Access-Control-Allow-Methods', '*');
- // // 响应头设置
- // ajax.setRequestHeader('Access-Control-Allow-Headers', 'x-requested-with,content-type');
- // ajax.withCredentials = true;
- // 3、发送请求
- ajax.send(null);
- // 4、监听状态的改变
- ajax.onreadystatechange = function () {
- if (ajax.readyState === 4) {
- if (ajax.status === 200) {
- // 用户传了回调才执行
- // isJson默认值为true,要解析json
- if (isJson === undefined) {
- isJson = true;
- }
- var res = isJson ? JSON.parse(ajax.responseText == "" ? '{}' : ajax.responseText) : ajax.responseText;
- succCb && succCb(res);
- } else {
- // 请求失败
- failCb && failCb();
- }
- }
- }
- },
- /* ajax请求post
- * @param url string 请求的路径
- * @param data object 请求的参数query
- * @param succCb function 请求成功之后的回调
- * @param failCb function 请求失败的回调
- * @param isJson boolean true: 解析json false:文本请求 默认值true
- */
- ajaxPost: function (url, data, succCb, failCb, isJson) {
- var formData = new FormData();
- for (var i in data) {
- formData.append(i, data[i]);
- }
- //得到xhr对象
- var xhr = null;
- if (XMLHttpRequest) {
- xhr = new XMLHttpRequest();
- } else {
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
- }
- xhr.open("post", url, true);
- // 设置请求头 需在open后send前
- // 这里的CSRF需自己取后端获取,下面给出获取代码
- // xhr.setRequestHeader("X-CSRFToken", CSRF);
- xhr.send(formData);
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- if (xhr.status === 200) {
- // 判断isJson是否传进来了
- isJson = isJson === undefined ? true : isJson;
- succCb && succCb(isJson ? JSON.parse(xhr.responseText) : xhr.responseText);
- }
- }
- }
- },
- getSiteRoot: function () {
- return document.location.protocol + '//' + window.location.host;
- },
- }
- // 调用
- // 接口地址
- let url = tools.getSiteRoot()+"/admin/center";
- // 传输数据 为object
- // let data = {}
- tools.ajaxGet(url,'', function(res){
- if(res.result === 1) {
- if(res.data.is_open == 2){
- window.location.href = res.data.url;
- }else {
- window.location.href = tools.getSiteRoot()+'/admin.html';
- }
- }else {
- window.location.href = tools.getSiteRoot()+'/admin.html';
- }
- })
- </script>
- </html>
|