From 55cc049b35500f5e497fd01e21b8b9b67e68bc14 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 29 Apr 2021 19:08:52 +0800 Subject: [PATCH] fix: auto adjust position, add animation --- README.md | 10 ++++ assets/css/main.css | 10 ++-- assets/css/main.min.css | 2 +- assets/js/main.js | 6 +-- assets/js/main.min.js | 2 +- index.html | 108 +++++++++++++++++++++++----------------- 6 files changed, 83 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index e1c140f..1bec6bb 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,16 @@ Detail: 美国俄亥俄州哥伦布市DoD网络信息中心 数据库文件位于 `backend/qqwry.dat`,数据库更新脚本位于 `backend/qqwryUpdate.sh`,查询代码位于 `backend/qqwry.php`,数据解析服务位于 `backend/qqwryFormat/*` +Docker部署方式中,容器内已经预留了 `qqwry.dat` 的自动升级功能,每天00:00时会运行脚本拉取数据库更新。对于其他部署方式,可以配置 `crontab` 自动执行更新脚本,示例如下 + +``` +# 打开crontab任务列表 +shell> crontab -e +··· +# 添加如下一行,表示每天00:00时自动运行指定脚本 +0 0 * * * /var/www/echoIP/backend/qqwryUpdate.sh +``` + ## 许可证 MIT ©2021 [@dnomd343](https://github.com/dnomd343) [@ShevonKuan](https://github.com/ShevonKuan) diff --git a/assets/css/main.css b/assets/css/main.css index d766a12..7916d57 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -394,7 +394,8 @@ table td:not([align]) { padding: .75rem } -@media screen and (min-width:769px), +/* @media screen and (min-width:769px), */ +@media all and (orientation : landscape), print { .column.is-6 { -webkit-box-flex: 0; @@ -438,7 +439,8 @@ print { align-items: center } -@media screen and (min-width:769px), +/* @media screen and (min-width:769px), */ +@media all and (orientation : landscape), print { .columns:not(.is-desktop) { display: -webkit-box; @@ -828,11 +830,11 @@ body::-webkit-scrollbar-thumb { } } -@media only screen and (min-width:768px) and (max-width:1024px) and (orientation:portrait) { +/* @media only screen and (min-width:768px) and (max-width:1024px) and (orientation:portrait) { .columns { padding: 0 10% } -} +} */ @font-face { font-family: slick; diff --git a/assets/css/main.min.css b/assets/css/main.min.css index cf5667a..9aeaa1b 100644 --- a/assets/css/main.min.css +++ b/assets/css/main.min.css @@ -1 +1 @@ -.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}/*! bulma.io v0.9.1 | MIT License | github.com/jgthms/bulma */.button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.button,.input{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.5em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.5em - 1px);padding-left:calc(.75em - 1px);padding-right:calc(.75em - 1px);padding-top:calc(.5em - 1px);position:relative;vertical-align:top}.button:active,.button:focus,.input:active,.input:focus{outline:0}body,h3,html,p{margin:0;padding:0}h3{font-size:100%;font-weight:400}button,input{margin:0}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}table{border-collapse:collapse;border-spacing:0}td{padding:0}td:not([align]){text-align:inherit}html{background-color:#fff;font-size:14px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body,button,input{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif}body{color:#4a4a4a;font-size:1em;font-weight:400;line-height:1.5}table td{vertical-align:top}table td:not([align]){text-align:inherit}.button{background-color:#fff;border-color:#dbdbdb;border-width:1px;color:#363636;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-bottom:calc(.5em - 1px);padding-left:1em;padding-right:1em;padding-top:calc(.5em - 1px);text-align:center;white-space:nowrap}.button:hover{border-color:#b5b5b5;color:#363636}.button:focus{border-color:#3273dc;color:#363636}.button.is-focused:not(:active),.button:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.button:active{border-color:#4a4a4a;color:#363636}.button.is-white.is-focused:not(:active),.button.is-white:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(255,255,255,.25);box-shadow:0 0 0 .125em rgba(255,255,255,.25)}.button.is-black.is-focused:not(:active),.button.is-black:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(10,10,10,.25);box-shadow:0 0 0 .125em rgba(10,10,10,.25)}.button.is-light.is-focused:not(:active),.button.is-light:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(245,245,245,.25);box-shadow:0 0 0 .125em rgba(245,245,245,.25)}.button.is-dark.is-focused:not(:active),.button.is-dark:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(54,54,54,.25);box-shadow:0 0 0 .125em rgba(54,54,54,.25)}.button.is-primary.is-focused:not(:active),.button.is-primary:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(0,209,178,.25);box-shadow:0 0 0 .125em rgba(0,209,178,.25)}.button.is-link.is-focused:not(:active),.button.is-link:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.button.is-info.is-focused:not(:active),.button.is-info:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,152,220,.25);box-shadow:0 0 0 .125em rgba(50,152,220,.25)}.button.is-success.is-focused:not(:active),.button.is-success:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(72,199,116,.25);box-shadow:0 0 0 .125em rgba(72,199,116,.25)}.button.is-warning.is-focused:not(:active),.button.is-warning:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(255,221,87,.25);box-shadow:0 0 0 .125em rgba(255,221,87,.25)}.button.is-danger.is-focused:not(:active),.button.is-danger:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(241,70,104,.25);box-shadow:0 0 0 .125em rgba(241,70,104,.25)}.button.is-fullwidth{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;margin:0 auto;position:relative;width:auto}@media screen and (min-width:1024px){.container{max-width:960px}}@media screen and (min-width:1216px){.container:not(.is-max-desktop){max-width:1152px}}.table{background-color:#fff;color:#363636}.table td{border:1px solid #dbdbdb;border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.table tbody{background-color:rgba(0,0,0,0)}.table tbody tr:last-child td{border-bottom-width:0}.input{background-color:#fff;border-color:#dbdbdb;border-radius:4px;color:#363636}.input::-moz-placeholder{color:rgba(54,54,54,.3)}.input::-webkit-input-placeholder{color:rgba(54,54,54,.3)}.input:-moz-placeholder{color:rgba(54,54,54,.3)}.input:-ms-input-placeholder{color:rgba(54,54,54,.3)}.input:hover{border-color:#b5b5b5}.input:active,.input:focus{border-color:#3273dc;-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.input{-webkit-box-shadow:inset 0 .0625em .125em rgba(10,10,10,.05);box-shadow:inset 0 .0625em .125em rgba(10,10,10,.05);max-width:100%;width:100%}.is-medium.input{font-size:1.25rem}.select.is-white:not(:hover)::after{border-color:#fff}.select.is-black:not(:hover)::after{border-color:#0a0a0a}.select.is-light:not(:hover)::after{border-color:#f5f5f5}.select.is-dark:not(:hover)::after{border-color:#363636}.select.is-primary:not(:hover)::after{border-color:#00d1b2}.select.is-link:not(:hover)::after{border-color:#3273dc}.select.is-info:not(:hover)::after{border-color:#3298dc}.select.is-success:not(:hover)::after{border-color:#48c774}.select.is-warning:not(:hover)::after{border-color:#ffdd57}.select.is-danger:not(:hover)::after{border-color:#f14668}.control{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;font-size:1rem;position:relative;text-align:inherit}@media screen and (min-width:1024px){.navbar-link.is-active:not(:focus):not(:hover),a.navbar-item.is-active:not(:focus):not(:hover){background-color:rgba(0,0,0,0)}}.column{display:block;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;padding:.75rem}@media screen and (min-width:769px),print{.column.is-6{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6{margin-left:50%}.column.is-12{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}}.columns{margin-left:-.75rem;margin-right:-.75rem;margin-top:-.75rem}.columns:last-child{margin-bottom:-.75rem}.columns:not(:last-child){margin-bottom:calc(1.5rem - .75rem)}.columns.is-multiline{-ms-flex-wrap:wrap;flex-wrap:wrap}.columns.is-vcentered{-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media screen and (min-width:769px),print{.columns:not(.is-desktop){display:-webkit-box;display:-ms-flexbox;display:flex}}.has-text-centered{text-align:center!important}.hero{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.hero.is-fullheight .hero-body{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.hero.is-fullheight .hero-body>.container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.hero.is-fullheight{min-height:100vh}.hero-body{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;padding:3rem 1.5rem}p{font-family:Roboto,sans-serif}::-moz-selection{background:#8c8cf9;color:#fff}::selection{background:#8c8cf9;color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";overflow:hidden!important}div,div:active,div:focus{outline:0!important}.button:active,.button:focus{-webkit-box-shadow:none!important;box-shadow:none!important}@font-face{font-family:'Nexa Light';src:url(../fonts/text/nexa/NexaLight.woff) format("woff"),url(../fonts/text/nexa/NexaLight.ttf) format("truetype")}@font-face{font-family:'Nexa Bold';font-weight:700;src:url(../fonts/text/nexa/NexaBold.woff) format("woff"),url(../fonts/text/nexa/NexaBold.ttf) format("truetype")}::-webkit-input-placeholder{color:#cecece}::-moz-placeholder{color:#cecece}:-ms-input-placeholder{color:#cecece}:-moz-placeholder{color:#cecece}body::-webkit-scrollbar{width:10px}body::-webkit-scrollbar-thumb{border-radius:5px;background:rgba(0,0,0,.2)}.hero.is-app-grey{background-color:#f5f6fa}.hero-body{position:relative;background-size:cover!important;background-repeat:no-repeat!important;z-index:6}.hero-body .is-subheader-caption{padding-bottom:60px}.button{-webkit-transition:all .5s;transition:all .5s}.button.button-cta{padding:22px 40px!important}.button.no-lh{line-height:0!important}.button.raised:hover{-webkit-box-shadow:0 14px 26px -12px rgba(0,0,0,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2)!important;box-shadow:0 14px 26px -12px rgba(0,0,0,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2)!important;opacity:.8}.button.is-bold{font-weight:500}.button:focus{border-color:#ccc}.button.is-fullwidth{display:block!important;width:100%!important;text-align:center!important}.button.primary-btn{outline:0;border-color:#8c8cf9;background-color:#8c8cf9;color:#fff;-webkit-transition:all .5s;transition:all .5s}.button.primary-btn:hover{color:#fff}.button.primary-btn.raised:hover{-webkit-box-shadow:0 14px 26px -12px rgba(140,140,249,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(140,140,249,.2)!important;box-shadow:0 14px 26px -12px rgba(140,140,249,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(140,140,249,.2)!important;opacity:.9 .5}.button.primary-btn:focus{border-color:#8c8cf9}.flex-card{position:relative;background-color:#fff;border:1px solid #fcfcfc;border-radius:.1875rem;display:inline-block;position:relative;overflow:hidden;width:100%;margin-bottom:20px;-webkit-transition:all .5s;transition:all .5s}.input{-webkit-box-shadow:none!important;box-shadow:none!important}.input{color:#878787;font-family:Roboto,sans-serif;font-size:.95rem;height:36px;-webkit-transition:all .3s;transition:all .3s;border-color:#dee2e6}.input.is-medium{height:44px}.input:hover{border-color:#d3d3d3}.input:active,.input:focus{border-color:#d6d6d6}.input:focus{-webkit-box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06)!important;box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06)!important}.field>label{font-family:Roboto,sans-serif;padding-bottom:4px;color:#5d6c84}.table{width:100%}.switch[type=checkbox]:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox]:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-small:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-small:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-medium:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-medium:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-large:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-large:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-primary:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(140,140,249,.25);box-shadow:0 0 0 .125em rgba(140,140,249,.25)}.switch[type=checkbox].is-secondary:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(127,0,255,.25);box-shadow:0 0 0 .125em rgba(127,0,255,.25)}.switch[type=checkbox].is-accent:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(173,92,255,.25);box-shadow:0 0 0 .125em rgba(173,92,255,.25)}.switch[type=checkbox].is-info:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(3,155,229,.25);box-shadow:0 0 0 .125em rgba(3,155,229,.25)}.switch[type=checkbox].is-success:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(6,214,160,.25);box-shadow:0 0 0 .125em rgba(6,214,160,.25)}.switch[type=checkbox].is-warning:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,165,20,.25);box-shadow:0 0 0 .125em rgba(237,165,20,.25)}.switch[type=checkbox].is-danger:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(249,43,96,.25);box-shadow:0 0 0 .125em rgba(249,43,96,.25)}.hero{position:relative}.carousel-wrap .testimonials-solo-carousel .hero-form .testimonial-item .field .control .input:not(:focus),.hero-form .carousel-wrap .testimonials-solo-carousel .testimonial-item .field .control .input:not(:focus),.hero-form .flex-card .field .control .input:not(:focus),.hero-form .network-grid .network-card .field .control .input:not(:focus),.hero-form .profile-card .field .control .input:not(:focus),.hero-form .project-card .field .control .input:not(:focus),.network-grid .hero-form .network-card .field .control .input:not(:focus){border-color:#dee2e6}.mapbox-hero{position:relative}.contact-page-form{display:block;padding:40px;border:1px solid #eaecef;-webkit-box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06);box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06);border-radius:6px;width:100%;max-width:380px;margin:0 auto;text-align:left}.contact-page-form>h3{font-family:"Nexa Bold",sans-serif;font-size:1.4rem;color:#444f60}.contact-page-form>p{color:#8e9baf;margin-bottom:2rem}.contact-page-form .column{padding:.5rem}.contact-page-form .field>label{font-size:.95rem}.contact-page-form .field .control .input{font-size:1.1rem}@media (max-width:768px){#main-hero{max-height:100vh;background-position-x:55%!important}}@media only screen and (min-width:768px) and (max-width:1024px) and (orientation:portrait){.columns{padding:0 10%}}@font-face{font-family:slick;src:url(/assets/fonts/slick.eot);src:url(/assets/fonts/slick.eot?#iefix) format("embedded-opentype"),url(/assets/fonts/slick.woff) format("woff"),url(/assets/fonts/slick.ttf) format("truetype"),url(/assets/fonts/slick.svg#slick) format("svg");font-weight:400;font-style:normal} \ No newline at end of file +.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}/*! bulma.io v0.9.1 | MIT License | github.com/jgthms/bulma */.button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.button,.input{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.5em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.5em - 1px);padding-left:calc(.75em - 1px);padding-right:calc(.75em - 1px);padding-top:calc(.5em - 1px);position:relative;vertical-align:top}.button:active,.button:focus,.input:active,.input:focus{outline:0}body,h3,html,p{margin:0;padding:0}h3{font-size:100%;font-weight:400}button,input{margin:0}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}table{border-collapse:collapse;border-spacing:0}td{padding:0}td:not([align]){text-align:inherit}html{background-color:#fff;font-size:14px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body,button,input{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif}body{color:#4a4a4a;font-size:1em;font-weight:400;line-height:1.5}table td{vertical-align:top}table td:not([align]){text-align:inherit}.button{background-color:#fff;border-color:#dbdbdb;border-width:1px;color:#363636;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-bottom:calc(.5em - 1px);padding-left:1em;padding-right:1em;padding-top:calc(.5em - 1px);text-align:center;white-space:nowrap}.button:hover{border-color:#b5b5b5;color:#363636}.button:focus{border-color:#3273dc;color:#363636}.button.is-focused:not(:active),.button:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.button:active{border-color:#4a4a4a;color:#363636}.button.is-white.is-focused:not(:active),.button.is-white:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(255,255,255,.25);box-shadow:0 0 0 .125em rgba(255,255,255,.25)}.button.is-black.is-focused:not(:active),.button.is-black:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(10,10,10,.25);box-shadow:0 0 0 .125em rgba(10,10,10,.25)}.button.is-light.is-focused:not(:active),.button.is-light:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(245,245,245,.25);box-shadow:0 0 0 .125em rgba(245,245,245,.25)}.button.is-dark.is-focused:not(:active),.button.is-dark:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(54,54,54,.25);box-shadow:0 0 0 .125em rgba(54,54,54,.25)}.button.is-primary.is-focused:not(:active),.button.is-primary:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(0,209,178,.25);box-shadow:0 0 0 .125em rgba(0,209,178,.25)}.button.is-link.is-focused:not(:active),.button.is-link:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.button.is-info.is-focused:not(:active),.button.is-info:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(50,152,220,.25);box-shadow:0 0 0 .125em rgba(50,152,220,.25)}.button.is-success.is-focused:not(:active),.button.is-success:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(72,199,116,.25);box-shadow:0 0 0 .125em rgba(72,199,116,.25)}.button.is-warning.is-focused:not(:active),.button.is-warning:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(255,221,87,.25);box-shadow:0 0 0 .125em rgba(255,221,87,.25)}.button.is-danger.is-focused:not(:active),.button.is-danger:focus:not(:active){-webkit-box-shadow:0 0 0 .125em rgba(241,70,104,.25);box-shadow:0 0 0 .125em rgba(241,70,104,.25)}.button.is-fullwidth{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;margin:0 auto;position:relative;width:auto}@media screen and (min-width:1024px){.container{max-width:960px}}@media screen and (min-width:1216px){.container:not(.is-max-desktop){max-width:1152px}}.table{background-color:#fff;color:#363636}.table td{border:1px solid #dbdbdb;border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.table tbody{background-color:rgba(0,0,0,0)}.table tbody tr:last-child td{border-bottom-width:0}.input{background-color:#fff;border-color:#dbdbdb;border-radius:4px;color:#363636}.input::-moz-placeholder{color:rgba(54,54,54,.3)}.input::-webkit-input-placeholder{color:rgba(54,54,54,.3)}.input:-moz-placeholder{color:rgba(54,54,54,.3)}.input:-ms-input-placeholder{color:rgba(54,54,54,.3)}.input:hover{border-color:#b5b5b5}.input:active,.input:focus{border-color:#3273dc;-webkit-box-shadow:0 0 0 .125em rgba(50,115,220,.25);box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.input{-webkit-box-shadow:inset 0 .0625em .125em rgba(10,10,10,.05);box-shadow:inset 0 .0625em .125em rgba(10,10,10,.05);max-width:100%;width:100%}.is-medium.input{font-size:1.25rem}.select.is-white:not(:hover)::after{border-color:#fff}.select.is-black:not(:hover)::after{border-color:#0a0a0a}.select.is-light:not(:hover)::after{border-color:#f5f5f5}.select.is-dark:not(:hover)::after{border-color:#363636}.select.is-primary:not(:hover)::after{border-color:#00d1b2}.select.is-link:not(:hover)::after{border-color:#3273dc}.select.is-info:not(:hover)::after{border-color:#3298dc}.select.is-success:not(:hover)::after{border-color:#48c774}.select.is-warning:not(:hover)::after{border-color:#ffdd57}.select.is-danger:not(:hover)::after{border-color:#f14668}.control{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;font-size:1rem;position:relative;text-align:inherit}@media screen and (min-width:1024px){.navbar-link.is-active:not(:focus):not(:hover),a.navbar-item.is-active:not(:focus):not(:hover){background-color:rgba(0,0,0,0)}}.column{display:block;-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;padding:.75rem}@media all and (orientation :landscape),print{.column.is-6{-webkit-box-flex:0;-ms-flex:none;flex:none;width:50%}.column.is-offset-6{margin-left:50%}.column.is-12{-webkit-box-flex:0;-ms-flex:none;flex:none;width:100%}}.columns{margin-left:-.75rem;margin-right:-.75rem;margin-top:-.75rem}.columns:last-child{margin-bottom:-.75rem}.columns:not(:last-child){margin-bottom:calc(1.5rem - .75rem)}.columns.is-multiline{-ms-flex-wrap:wrap;flex-wrap:wrap}.columns.is-vcentered{-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media all and (orientation :landscape),print{.columns:not(.is-desktop){display:-webkit-box;display:-ms-flexbox;display:flex}}.has-text-centered{text-align:center!important}.hero{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.hero.is-fullheight .hero-body{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.hero.is-fullheight .hero-body>.container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.hero.is-fullheight{min-height:100vh}.hero-body{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;padding:3rem 1.5rem}p{font-family:Roboto,sans-serif}::-moz-selection{background:#8c8cf9;color:#fff}::selection{background:#8c8cf9;color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";overflow:hidden!important}div,div:active,div:focus{outline:0!important}.button:active,.button:focus{-webkit-box-shadow:none!important;box-shadow:none!important}@font-face{font-family:'Nexa Light';src:url(../fonts/text/nexa/NexaLight.woff) format("woff"),url(../fonts/text/nexa/NexaLight.ttf) format("truetype")}@font-face{font-family:'Nexa Bold';font-weight:700;src:url(../fonts/text/nexa/NexaBold.woff) format("woff"),url(../fonts/text/nexa/NexaBold.ttf) format("truetype")}::-webkit-input-placeholder{color:#cecece}::-moz-placeholder{color:#cecece}:-ms-input-placeholder{color:#cecece}:-moz-placeholder{color:#cecece}body::-webkit-scrollbar{width:10px}body::-webkit-scrollbar-thumb{border-radius:5px;background:rgba(0,0,0,.2)}.hero.is-app-grey{background-color:#f5f6fa}.hero-body{position:relative;background-size:cover!important;background-repeat:no-repeat!important;z-index:6}.hero-body .is-subheader-caption{padding-bottom:60px}.button{-webkit-transition:all .5s;transition:all .5s}.button.button-cta{padding:22px 40px!important}.button.no-lh{line-height:0!important}.button.raised:hover{-webkit-box-shadow:0 14px 26px -12px rgba(0,0,0,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2)!important;box-shadow:0 14px 26px -12px rgba(0,0,0,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2)!important;opacity:.8}.button.is-bold{font-weight:500}.button:focus{border-color:#ccc}.button.is-fullwidth{display:block!important;width:100%!important;text-align:center!important}.button.primary-btn{outline:0;border-color:#8c8cf9;background-color:#8c8cf9;color:#fff;-webkit-transition:all .5s;transition:all .5s}.button.primary-btn:hover{color:#fff}.button.primary-btn.raised:hover{-webkit-box-shadow:0 14px 26px -12px rgba(140,140,249,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(140,140,249,.2)!important;box-shadow:0 14px 26px -12px rgba(140,140,249,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(140,140,249,.2)!important;opacity:.9 .5}.button.primary-btn:focus{border-color:#8c8cf9}.flex-card{position:relative;background-color:#fff;border:1px solid #fcfcfc;border-radius:.1875rem;display:inline-block;position:relative;overflow:hidden;width:100%;margin-bottom:20px;-webkit-transition:all .5s;transition:all .5s}.input{-webkit-box-shadow:none!important;box-shadow:none!important}.input{color:#878787;font-family:Roboto,sans-serif;font-size:.95rem;height:36px;-webkit-transition:all .3s;transition:all .3s;border-color:#dee2e6}.input.is-medium{height:44px}.input:hover{border-color:#d3d3d3}.input:active,.input:focus{border-color:#d6d6d6}.input:focus{-webkit-box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06)!important;box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06)!important}.field>label{font-family:Roboto,sans-serif;padding-bottom:4px;color:#5d6c84}.table{width:100%}.switch[type=checkbox]:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox]:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-small:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-small:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-medium:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-medium:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-large:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,237,237,.25);box-shadow:0 0 0 .125em rgba(237,237,237,.25)}.switch[type=checkbox].is-large:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(135,135,135,.25);box-shadow:0 0 0 .125em rgba(135,135,135,.25)}.switch[type=checkbox].is-primary:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(140,140,249,.25);box-shadow:0 0 0 .125em rgba(140,140,249,.25)}.switch[type=checkbox].is-secondary:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(127,0,255,.25);box-shadow:0 0 0 .125em rgba(127,0,255,.25)}.switch[type=checkbox].is-accent:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(173,92,255,.25);box-shadow:0 0 0 .125em rgba(173,92,255,.25)}.switch[type=checkbox].is-info:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(3,155,229,.25);box-shadow:0 0 0 .125em rgba(3,155,229,.25)}.switch[type=checkbox].is-success:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(6,214,160,.25);box-shadow:0 0 0 .125em rgba(6,214,160,.25)}.switch[type=checkbox].is-warning:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(237,165,20,.25);box-shadow:0 0 0 .125em rgba(237,165,20,.25)}.switch[type=checkbox].is-danger:checked:focus:not(:active)+label::before{-webkit-box-shadow:0 0 0 .125em rgba(249,43,96,.25);box-shadow:0 0 0 .125em rgba(249,43,96,.25)}.hero{position:relative}.carousel-wrap .testimonials-solo-carousel .hero-form .testimonial-item .field .control .input:not(:focus),.hero-form .carousel-wrap .testimonials-solo-carousel .testimonial-item .field .control .input:not(:focus),.hero-form .flex-card .field .control .input:not(:focus),.hero-form .network-grid .network-card .field .control .input:not(:focus),.hero-form .profile-card .field .control .input:not(:focus),.hero-form .project-card .field .control .input:not(:focus),.network-grid .hero-form .network-card .field .control .input:not(:focus){border-color:#dee2e6}.mapbox-hero{position:relative}.contact-page-form{display:block;padding:40px;border:1px solid #eaecef;-webkit-box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06);box-shadow:-1px 3px 15px 0 rgba(0,0,0,.06);border-radius:6px;width:100%;max-width:380px;margin:0 auto;text-align:left}.contact-page-form>h3{font-family:"Nexa Bold",sans-serif;font-size:1.4rem;color:#444f60}.contact-page-form>p{color:#8e9baf;margin-bottom:2rem}.contact-page-form .column{padding:.5rem}.contact-page-form .field>label{font-size:.95rem}.contact-page-form .field .control .input{font-size:1.1rem}@media (max-width:768px){#main-hero{max-height:100vh;background-position-x:55%!important}}@font-face{font-family:slick;src:url(/assets/fonts/slick.eot);src:url(/assets/fonts/slick.eot?#iefix) format("embedded-opentype"),url(/assets/fonts/slick.woff) format("woff"),url(/assets/fonts/slick.ttf) format("truetype"),url(/assets/fonts/slick.svg#slick) format("svg");font-weight:400;font-style:normal} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index b8a253d..79dfe79 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -9,7 +9,7 @@ $(document).ready(function() { $("input").val(getQuery("ip")); getInfo(); } - $("table").hide(); + $("#table").hide(); $("#share").hide(); $("button").click(function() { $(this).css({ @@ -17,7 +17,7 @@ $(document).ready(function() { 'background-color': '' }); $(this).text("Searching..."); - $("table").hide(1000); + $("#table").hide(500); $("input").val(trim($("input").val())); if ($("input").val() == '' || checkIP($("input").val()) == "ok") { getInfo(); @@ -118,7 +118,6 @@ function getInfo() { $("input").val(data.ip); } $("button").text("Search"); - $("table").show(1000); $("#ip").text(data.ip); data.city = (data.city == null) ? "Unknow" : data.city; data.region = (data.region == null) ? "Unknow" : data.region; @@ -149,6 +148,7 @@ function getInfo() { $("#loc").html('' + data.loc + ''); draw(parseFloat(data.loc.split(',')[0]), parseFloat(data.loc.split(',')[1])); } + $("#table").show(500); }); } diff --git a/assets/js/main.min.js b/assets/js/main.min.js index 1f54725..45c8cc3 100644 --- a/assets/js/main.min.js +++ b/assets/js/main.min.js @@ -1 +1 @@ -var rangeSize=300,shareX,shareY;function checkRange(){var distanceX=Math.abs(event.pageX-shareX),distanceY=Math.abs(event.pageY-shareY);(distanceX>=rangeSize||distanceY>=rangeSize)&&hideQRCode()}function hideQRCode(){$("#qrcode").is(":hidden")||$("#share").hide(200)}function showQRCode(){var ip=$("#ip").text();if("ok"==checkIP(ip)){var pageUri="https://"+window.location.host+"/?ip="+ip;$("#qrcode").attr("href",pageUri),$("#qrcode").empty(),$("#qrcode").qrcode({width:100,height:100,text:pageUri});var shareLeft=event.pageX-50,shareTop=event.pageY+15;shareLeft+122>$(document).width()&&(shareLeft=$(document).width()-122),shareTop+122>$(document).height()&&(shareTop=$(document).height()-122),shareX=shareLeft+61,shareY=shareTop+61,$("#qrcode").is(":hidden")?($("#share").css("left",shareLeft),$("#share").css("top",shareTop),$("#share").show(200)):$("#share").hide(100,(function(){$("#share").css("left",shareLeft),$("#share").css("top",shareTop),$("#share").show(150)}))}}function getInfo(){$.get("/info/"+$("input").val(),(function(data){if(console.log(data),"F"!=data.status){if($("input").val()||$("input").val(data.ip),$("button").text("Search"),$("table").show(1e3),$("#ip").text(data.ip),data.city=null==data.city?"Unknow":data.city,data.region=null==data.region?"Unknow":data.region,data.country=null==data.country?"Unknow":data.country,data.timezone=null==data.timezone?"Unknow":data.timezone,data.isp=null==data.isp?"Unknow":data.isp,data.scope=null==data.scope?"Unknow":data.scope,data.detail=null==data.detail||" "==data.detail?"Unknow":data.detail,$("#city").text(data.city),$("#region").text(data.region),$("#country").text(data.country),$("#timezone").text(data.timezone),$("#isp").text(data.isp),$("#scope").text(data.scope),$("#detail").text(data.detail),null==data.as)$("#as").text("Unknow");else{$("#as").text(data.as);var asUri="https://bgpview.io/asn/"+data.as.substr(2);$("#as").html(''+data.as+"")}if(null==data.loc)$("#loc").text("Unknow"),clear();else{var earthUri="https://earth.google.com/web/@"+data.loc+",0a,398836d,1y,0h,0t,0r";$("#loc").html(''+data.loc+""),draw(parseFloat(data.loc.split(",")[0]),parseFloat(data.loc.split(",")[1]))}}else errorIP()}))}function getVersion(){$.get("/version",(function(data){console.log(data),data.qqwry=data.qqwry.slice(0,4)+"-"+data.qqwry.slice(4,6)+"-"+data.qqwry.slice(6,8),data.ipip=data.ipip.slice(0,4)+"-"+data.ipip.slice(4,6)+"-"+data.ipip.slice(6,8);var data_ver="";data_ver+="echoIP: "+data.echoip+"\n",data_ver+="纯真数据库: "+data.qqwry+"\n",data_ver+="IPIP.net数据库: "+data.ipip,alert(data_ver)}))}function trim(str){return str.replace(/(^\s*)|(\s*$)/g,"")}function errorIP(){$("button").text("Illegal IP"),$("button").css({"border-color":"#ff406f","background-color":"#ff406f"}),$("input").focus()}function checkIP(ipStr){if(null===ipStr)return"error";var regIPv4=/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/,regIPv6=/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$/,V4=ipStr.match(regIPv4),V6=ipStr.match(regIPv6);return null===V4&&null===V6?"error":"ok"}function getQuery(name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),result=window.location.search.substr(1).match(reg);return null!=result?unescape(result[2]):null}function clear(){var map;new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/streets-v11",center:[0,0],zoom:1}).on("load",(function(){console.log("reset map")}))}function draw(x,y){var size=100,map=new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/streets-v11",center:[y,x],zoom:3}),pulsingDot={width:100,height:100,data:new Uint8Array(4e4),onAdd:function(){var canvas=document.createElement("canvas");canvas.width=this.width,canvas.height=this.height,this.context=canvas.getContext("2d")},render:function(){var duration=1e3,t=performance.now()%1e3/1e3,radius=15,outerRadius=35*t+15,context=this.context;return context.clearRect(0,0,this.width,this.height),context.beginPath(),context.arc(this.width/2,this.height/2,outerRadius,0,2*Math.PI),context.fillStyle="rgba(255, 200, 200,"+(1-t)+")",context.fill(),context.beginPath(),context.arc(this.width/2,this.height/2,15,0,2*Math.PI),context.fillStyle="rgba(255, 100, 100, 1)",context.strokeStyle="white",context.lineWidth=2+4*(1-t),context.fill(),context.stroke(),this.data=context.getImageData(0,0,this.width,this.height).data,map.triggerRepaint(),!0}};map.on("load",(function(){map.addImage("pulsing-dot",pulsingDot,{pixelRatio:2}),map.addLayer({id:"points",type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[y,x]}}]}},layout:{"icon-image":"pulsing-dot"}})}))}mapboxgl.accessToken="pk.eyJ1Ijoic2hldm9ua3VhbiIsImEiOiJja20yMjlnNDYybGg2Mm5zNW40eTNnNnUwIn0.6xj6sgjWvdQgT_7OQUy_Jg",$(document).ready((function(){null===getQuery("ip")?getInfo():($("input").val(getQuery("ip")),getInfo()),$("table").hide(),$("#share").hide(),$("button").click((function(){$(this).css({"border-color":"","background-color":""}),$(this).text("Searching..."),$("table").hide(1e3),$("input").val(trim($("input").val())),""==$("input").val()||"ok"==checkIP($("input").val())?getInfo():errorIP()})),$("button").dblclick((function(event){event.stopPropagation(),getVersion()})),$("input").dblclick((function(event){event.stopPropagation()})),$("table").dblclick((function(event){event.stopPropagation()})),$("#output").dblclick((function(){showQRCode()})),$("#output").click((function(){hideQRCode()})),$("#map").click((function(){hideQRCode()})),$("body").mousemove((function(){checkRange()})),$("body").mouseleave((function(){hideQRCode()}))})),$(document).keydown((function(event){13==event.keyCode&&$("button").focus()})); \ No newline at end of file +var rangeSize=300,shareX,shareY;function toCenter(){var objWidth=$(".positioncontrol").css("width");objWidth=objWidth.substr(0,objWidth.length-2);var left=($(document).width()-objWidth)/2;$(".positioncontrol").css("left",left+"px")}function checkRange(){var distanceX=Math.abs(event.pageX-shareX),distanceY=Math.abs(event.pageY-shareY);(distanceX>=rangeSize||distanceY>=rangeSize)&&hideQRCode()}function hideQRCode(){$("#qrcode").is(":hidden")||$("#share").hide(200)}function showQRCode(){var ip=$("#ip").text();if("ok"==checkIP(ip)){var pageUri="https://"+window.location.host+"/?ip="+ip;$("#qrcode").attr("href",pageUri),$("#qrcode").empty(),$("#qrcode").qrcode({width:100,height:100,text:pageUri});var shareLeft=event.pageX-50,shareTop=event.pageY+15;shareLeft+122>$(document).width()&&(shareLeft=$(document).width()-122),shareTop+122>$(document).height()&&(shareTop=$(document).height()-122),shareX=shareLeft+61,shareY=shareTop+61,$("#qrcode").is(":hidden")?($("#share").css("left",shareLeft),$("#share").css("top",shareTop),$("#share").show(200)):$("#share").hide(100,(function(){$("#share").css("left",shareLeft),$("#share").css("top",shareTop),$("#share").show(150)}))}}function getInfo(){$.get("/info/"+$("input").val(),(function(data){if(console.log(data),"F"!=data.status){if($("input").val()||$("input").val(data.ip),$("button").text("Search"),$("#ip").text(data.ip),data.city=null==data.city?"Unknow":data.city,data.region=null==data.region?"Unknow":data.region,data.country=null==data.country?"Unknow":data.country,data.timezone=null==data.timezone?"Unknow":data.timezone,data.isp=null==data.isp?"Unknow":data.isp,data.scope=null==data.scope?"Unknow":data.scope,data.detail=null==data.detail||" "==data.detail?"Unknow":data.detail,$("#city").text(data.city),$("#region").text(data.region),$("#country").text(data.country),$("#timezone").text(data.timezone),$("#isp").text(data.isp),$("#scope").text(data.scope),$("#detail").text(data.detail),null==data.as)$("#as").text("Unknow");else{$("#as").text(data.as);var asUri="https://bgpview.io/asn/"+data.as.substr(2);$("#as").html(''+data.as+"")}if(null==data.loc)$("#loc").text("Unknow"),clear();else{var earthUri="https://earth.google.com/web/@"+data.loc+",0a,398836d,1y,0h,0t,0r";$("#loc").html(''+data.loc+""),draw(parseFloat(data.loc.split(",")[0]),parseFloat(data.loc.split(",")[1]))}$("#table").show(500)}else errorIP()}))}function getVersion(){$.get("/version",(function(data){console.log(data),data.qqwry=data.qqwry.slice(0,4)+"-"+data.qqwry.slice(4,6)+"-"+data.qqwry.slice(6,8),data.ipip=data.ipip.slice(0,4)+"-"+data.ipip.slice(4,6)+"-"+data.ipip.slice(6,8);var data_ver="";data_ver+="echoIP: "+data.echoip+"\n",data_ver+="纯真数据库: "+data.qqwry+"\n",data_ver+="IPIP.net数据库: "+data.ipip,alert(data_ver)}))}function trim(str){return str.replace(/(^\s*)|(\s*$)/g,"")}function errorIP(){$("button").text("Illegal IP"),$("button").css({"border-color":"#ff406f","background-color":"#ff406f"}),$("input").focus()}function checkIP(ipStr){if(null===ipStr)return"error";var regIPv4=/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/,regIPv6=/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$/,V4=ipStr.match(regIPv4),V6=ipStr.match(regIPv6);return null===V4&&null===V6?"error":"ok"}function getQuery(name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),result=window.location.search.substr(1).match(reg);return null!=result?unescape(result[2]):null}function clear(){var map;new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/streets-v11",center:[0,0],zoom:1}).on("load",(function(){console.log("reset map")}))}function draw(x,y){var size=100,map=new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/streets-v11",center:[y,x],zoom:3}),pulsingDot={width:100,height:100,data:new Uint8Array(4e4),onAdd:function(){var canvas=document.createElement("canvas");canvas.width=this.width,canvas.height=this.height,this.context=canvas.getContext("2d")},render:function(){var duration=1e3,t=performance.now()%1e3/1e3,radius=15,outerRadius=35*t+15,context=this.context;return context.clearRect(0,0,this.width,this.height),context.beginPath(),context.arc(this.width/2,this.height/2,outerRadius,0,2*Math.PI),context.fillStyle="rgba(255, 200, 200,"+(1-t)+")",context.fill(),context.beginPath(),context.arc(this.width/2,this.height/2,15,0,2*Math.PI),context.fillStyle="rgba(255, 100, 100, 1)",context.strokeStyle="white",context.lineWidth=2+4*(1-t),context.fill(),context.stroke(),this.data=context.getImageData(0,0,this.width,this.height).data,map.triggerRepaint(),!0}};map.on("load",(function(){map.addImage("pulsing-dot",pulsingDot,{pixelRatio:2}),map.addLayer({id:"points",type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[y,x]}}]}},layout:{"icon-image":"pulsing-dot"}})}))}mapboxgl.accessToken="pk.eyJ1Ijoic2hldm9ua3VhbiIsImEiOiJja20yMjlnNDYybGg2Mm5zNW40eTNnNnUwIn0.6xj6sgjWvdQgT_7OQUy_Jg",$(document).ready((function(){null===getQuery("ip")?getInfo():($("input").val(getQuery("ip")),getInfo()),$("#table").hide(),$("#share").hide(),$("button").click((function(){$(this).css({"border-color":"","background-color":""}),$(this).text("Searching..."),$("#table").hide(500),$("input").val(trim($("input").val())),""==$("input").val()||"ok"==checkIP($("input").val())?getInfo():errorIP()})),$("button").dblclick((function(event){event.stopPropagation(),getVersion()})),$("input").dblclick((function(event){event.stopPropagation()})),$("table").dblclick((function(event){event.stopPropagation()})),$("#output").dblclick((function(){showQRCode()})),$("#output").click((function(){hideQRCode()})),$("#map").click((function(){hideQRCode()})),$("body").mousemove((function(){checkRange()})),$("body").mouseleave((function(){hideQRCode()}))})),$(document).keydown((function(event){13==event.keyCode&&$("button").focus()})); \ No newline at end of file diff --git a/index.html b/index.html index 55b06d5..0aa5152 100644 --- a/index.html +++ b/index.html @@ -48,6 +48,10 @@ color: #5165db; } + .input { + background-color: rgba(255, 255, 255, 0.5); + } + .table { color: #282828; } @@ -76,14 +80,25 @@ .positioncontrol { position: absolute; - left: calc(100vw*0.8 - 190px); + left: calc(80vw - 180px); + transform: translate(-20%, 0); } - @media screen and (max-width: 600px) { + @media screen and (max-width: 800px) { .positioncontrol { position: absolute; left: 0; right: 0; + transform: translate(0, 0); + } + } + + @media all and (orientation : portrait) { + .positioncontrol { + position: absolute; + left: 0; + right: 0; + transform: translate(0, 0); } } @@ -112,7 +127,6 @@ #qrcode canvas { display: block; } - @@ -127,7 +141,7 @@
- +
@@ -139,48 +153,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IP
AS
City
Region
Country
Timezone
Location
ISP
Scope
Detail
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IP
AS
City
Region
Country
Timezone
Location
ISP
Scope
Detail
+