左下角客户端信息和进站欢迎

把这段代码放到后台底部自定义里面即可 需引入jq

代码语言:javascript
复制
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
代码语言:javascript
复制
    <!-- 客户端信息 -->
    <style>
    /* 元素遮罩层不遮挡下方元素的代码 */
    .zz_select{
        -webkit-pointer-events: none;
        -moz-pointer-events: none;
        -ms-pointer-events: none;
        -o-pointer-events: none;
        pointer-events: none;
    }
    </style>
        <div class="zz_select" id="fps" style="z-index:5;position:fixed;bottom:3px;left:3px;color:#2196F3;font-size:10px;"></div>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/kaliisra/myblogstatic/kehuduan-js/fetch.min.js"></script>
        <script src="https://cdn.gmit.vip/layer/3.1.1/layer.js" type="text/javascript" charset="utf-8"></script>
        <script>
        /*网站打开提醒代码开始*/
        $(function(){
            if(1){
                var t = document.createElement("a");
                t.href = document.referrer;
                var msgTitle = t.hostname;
                var name = t.hostname.split(".")[1];
                if("" !== document.referrer){
                    switch (name) {
                        case 'bing':
                            msgTitle = '必应搜索';
                            break;
                        case 'baidu':
                            msgTitle = '百度搜索';
                            break;
                        case 'so':
                            msgTitle = '360搜索';
                            break;
                        case 'google':
                            msgTitle = '谷歌搜索';
                            break;
                        case 'sm':
                            msgTitle = '神马搜索';
                            break;
                        case 'sogou':
                            msgTitle = '搜狗搜索';
                            break;
                        default:
                            msgTitle =  t.hostname;
                    };
                };
                var time = (new Date).getHours();
                var msg = '';
                23 < time || time <= 5 ? msg = "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?":
                5< time && time <= 7 ? msg = "早上好!一日之计在于晨,美好的一天就要开始了!":
                7< time && time <= 11 ? msg = "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!":
                11< time && time <= 14 ? msg = "中午了,工作了一个上午,现在是午餐时间!":
                14< time && time <= 17 ? msg = "午后很容易犯困呢,今天的运动目标完成了吗?":
                17< time && time <= 19 ? msg = "傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~":
                19< time && time <= 21 ? msg = "晚上好,今天过得怎么样?":
                21< time && time <= 23 && (msg = "已经这么晚了呀,早点休息吧,晚安~");
                $.ajax({
                    type:"get",
                    url:"https://open.gmit.vip/web/api/UserInfo/",
                    async:true,
                    success:function(data){
                        window.info = data;
                        if(!sessionStorage.getItem('tip')){
                            sessionStorage.setItem('tip', 1)
                            layer.msg("Hi~ 来自"+ data.data.location + '~<br/>通过 '+msgTitle+' 进来的朋友!<br/>使用 '+ data.data.os +"<br/>"+ data.data.browser +' 访问本站!' + '<br/>' + msg);
                        }
                        var showFPS = (function(){
                            var requestAnimationFrame =
                                window.requestAnimationFrame ||
                                window.webkitRequestAnimationFrame ||
                                window.mozRequestAnimationFrame ||
                                window.oRequestAnimationFrame ||
                                window.msRequestAnimationFrame ||
                                function(callback) {
                                    window.setTimeout(callback, 1000/60);
                                };
                            var e,pe,pid,fps,last,offset,step,appendFps;
                        fps = 0;
                        last = Date.now();
                        step = function(){
                            offset = Date.now() - last;
                            fps += 1;
                            if( offset &gt;= 1000 ){
                            last += offset;
                            appendFps(fps);
                            fps = 0;
                            };
                            requestAnimationFrame( step );
                        };
                        appendFps = function(fps){
                            var settings = {
                                timeout: 5000,
                                logError: true
                            };
                            $(&#39;#fps&#39;).html(&#39;&lt;span style=&#34;float:left;&#34;&gt;&#39;+fps+&#39;FPS&lt;/span&gt;&lt;br/&gt;&lt;span style=&#34;float:left;&#34;&gt;&#39;+window.info.data.os+&#39;&lt;/span&gt;&lt;br/&gt;&lt;span style=&#34;float:left;margin-top:1px;&#34;&gt;&#39;+window.info.data.browser+&#39;&lt;/span&gt;&lt;br/&gt;&lt;span style=&#34;float:left;margin-top:1px;&#34;&gt;&#39;+window.info.data.location+&#39;&lt;/span&gt;&lt;br/&gt;&lt;span style=&#34;float:left;margin-top:1px;&#34;&gt;&lt;/span&gt;&#39;);
                        };
                        step();
                    })();
                }
            });
        };
    });
    &lt;/script&gt;
&lt;!-- 客户端信息 end --&gt;</code></pre></div></div><figure class=""><div class="rno-markdown-img-url" style="text-align:center"><div class="rno-markdown-img-url-inner" style="width:57.15%"><div style="width:100%"><img src="https://cdn.static.attains.cn/app/developer-bbs/upload/1723235937260680580.png" /></div><div class="figure-desc">入站欢迎</div></div></div></figure><figure class=""><div class="rno-markdown-img-url" style="text-align:center"><div class="rno-markdown-img-url-inner" style="width:18.24%"><div style="width:100%"><img src="https://cdn.static.attains.cn/app/developer-bbs/upload/1723235937469423107.png" /></div><div class="figure-desc">显示客户端信息</div></div></div></figure>