### JavaScript Global Application Configuration Object Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This JavaScript snippet defines a global `So` object containing common application parameters. It includes properties like `abv` (possibly A/B test versions), `guid` (unique identifier), `pid` (page ID), `t` (timestamp), `ip` (IP address), and `user` details, likely used for tracking or client-side configuration. ```JavaScript var So = { comm: { abv: "1246-mediav8_1,1242-treatment,954-search_rec_abtest_c,1131-360pic_new_normal2,881-textnew_shiyan2,1153-control,1243-mediav6_1", guid: "CD6D13BAB19D76BB796155D2D433AEB3.1540863866720", md: "", pid: "home", src: "", fr: "none", t: 1600253316193, ip: "10.18.120.149", ls: "", user: { qid: "", imageId: "" } } } ``` -------------------------------- ### Base Utility and General Button Styles Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Defines foundational utility classes like `g-clearfix` for clearing floats, and base styles for generic buttons (`g-btn`) including icon alignment. These styles provide a common starting point for UI elements. ```CSS input.g-btn, button.g-btn { line-height: 20px; *padding: 0 5px; } .g-clearfix:after { clear: both; content: ""; display: block; height: 0; visibility: hidden; } .g-btn .g-icon { margin-right: 5px; } .g-btn-icon .g-icon { _margin-top: -3px; } ``` -------------------------------- ### JavaScript Browser Detection Utility (n.browser) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html The `n.browser` utility provides a set of functions to detect various web browsers and their versions based on the user agent string. It includes specific checks for IE, Edge, Chrome, Safari, Firefox, Opera, and different versions of 360 browsers, including a method to get the 360 browser version if available via external objects. ```JavaScript n.browser = (function () { var e = navigator.userAgent; return { isIE: function () { return /MSIE/i.test(e) ? /MSIE (\d\.)+/i.test(e) ? parseInt(RegExp.$1) : !1 : /rv:(\d\.)+/i.test(e) && !/Firefox/i.test(e) ? parseInt(RegExp.$1) : !1; }, isEdge: function () { return /Edge/i.test(e); }, isChrome: function () { return ( e.indexOf("Chrome") > -1 && e.indexOf("Safari") > -1 && e.indexOf("Edge") === -1 && e.indexOf("OPR") === -1 ); }, isSafari: function () { return ( e.indexOf("Safari") > -1 && e.indexOf("Chrome") === -1 && e.indexOf("OPR") === -1 && e.indexOf("Edge") === -1 ); }, isFirefox: function () { return /Firefox/i.test(e); }, isOpera: function () { return /OPR/i.test(e); }, is360: function () { return /QIHU/i.test(e); }, is360SE: function () { return /QIHU 360SE/i.test(e); }, is360EE: function () { return /QIHU 360EE/i.test(e); }, get360Ver: function () { if (!/QIHU/i.test(e)) return ""; try { if (external && external.GetVersion && external.GetSID) return external.GetVersion(external.GetSID(window)); } catch (t) {} }, }; })(); ``` -------------------------------- ### Global Configuration Initialization Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Initializes global configuration objects 'So.comm' and 'So.web.skin' with various settings including SSL status, security tags, and skinning parameters. These objects store application-wide constants and dynamic values for frontend operations. ```JavaScript So.comm.home = "so"; So.web.skin = { flag: "", flag_limit: "", type: 0, close: 0, skinNew: null, skinOld: null, skinJs: "", limitTime: "", tip: "" }; ``` -------------------------------- ### DOM Ready Utility (OB.DomU.ready) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Offers a cross-browser `ready` method within `OB.DomU` to execute a callback function once the DOM is fully loaded. It uses `DOMContentLoaded` for modern browsers and `doScroll` / `onreadystatechange` for IE, ensuring reliable execution of scripts dependent on the DOM structure. ```javascript i = { ready: function (e, t) { function r() { clearTimeout(t.__QWDomReadyTimer); if (n.length) { var e = n.shift(); n.length && (t.__QWDomReadyTimer = setTimeout(r, 0)), e(); } } t = t || document; var n = (t.__QWDomReadyCbs = t.__QWDomReadyCbs || []); n.push(e), setTimeout(function () { if (/complete/.test(t.readyState)) r(); else if (t.addEventListener) "interactive" == t.readyState ? r() : t.addEventListener("DOMContentLoaded", r, !1); else { var e = function () { (e = new Function()), r(); }; (function () { try { t.body.doScroll("left"); } catch (n) { return setTimeout(arguments.callee, 1); } e(); })(), t.attachEvent("onreadystatechange", function () { "complete" == t.readyState && e(); }); } }, 0); }, }; t.DomU = i; ``` -------------------------------- ### Image Format Conversion to WebP Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This snippet demonstrates logic for converting image URLs (JPG or PNG) to their WebP equivalents based on certain conditions. It handles cases where a '.webp' extension might already be present or needs to be added. ```JavaScript && !n && (f ? ((l = l.replace(/\\.jpg(?:\\.webp)?/, ".jpg.webp")), (l = l.replace(/\\.png(?:\\.webp)?/, ".png.webp"))) : ((l = l.replace(/\\.jpg/, ".webp")), (l = l.replace(/\\.png/, ".webp")))), u + a + f + l ); ``` -------------------------------- ### Core String Utility Functions Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Provides fundamental string utility functions within the 'So.lib' namespace. These include 'trim' for whitespace removal, 'startsWith' and 'endsWith' for prefix/suffix checks, and 'contains' for substring detection, essential for common string processing tasks. ```JavaScript u = { trim: function (e) { return e.replace(/^[\s]+|[\s]+$/, ""); }, startsWith: function (e, t) { return e.indexOf(t) === 0; }, endsWith: function (e, t) { return e.lastIndexOf(t) === e.length - t.length; }, contains: function (e, t) { return e.indexOf(t) !== -1; } }; ``` -------------------------------- ### Custom Asynchronous Script Loader (OB._loader) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Implements a custom JavaScript module loader that supports asynchronous script loading, dependency management, and execution of callbacks once dependencies are met. It includes methods to `add` new scripts, `use` existing ones with callbacks, and `remove` scripts from the registry. It also defines a set of pre-configured scripts like jQuery and RequireJS. ```javascript (function (e) { function f(e, t) { var n = document, r = n.getElementsByTagName("head")[0] || n.documentElement, i = n.createElement("script"), s = !1, o = 0; (i.src = e), (i.onerror = i.onload = i.onreadystatechange = function (e) { !s && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") && ((s = !0), e && e.type && e.type == "error" && (o = 1), t && t(o), (i.onerror = i.onload = i.onreadystatechange = null), r.removeChild(i)); }), r.insertBefore(i, r.firstChild); } function l(e) { var t, n, r, i; for (t = 0; t < u.length; t++) { (r = u[t]), (i = r.requires); for (n = 0; n < i.length; n++) if (i[n] == e) { i.splice(n, 1); break; } i.length === 0 && (r.fun(), u.splice(t, 1)); } } function c() { var e = o.splice(0, 1)[0], t = s[e], n = function (n) { n == 0 ? (l(e), (t.loaded = !0)) : (t.loaded = !1), o.length ? c() : (a = !1); }; if (!t) { o.length ? c() : (a = !1); return; } (a = !0), t.loaded || (t.checker && t.checker()) ? n(0) : f(t.url, function (e) { n(e); }); } var t = {}; (e.OB = t); var s = { jquery: { url: "https://s.ssl.qhimg.com/lib/jquery/183.js", checker: function () { return !!e.jQuery; }, }, "require.2.1.11": { url: "https://s.ssl.qhimg.com/!5a33324b/require.min.js", checker: function () { return !!e.require && !!e.define; }, }, MMPlugin: { url: "https://s.ssl.qhimg.com/!cd5291ad/MMPlugin.js", checker: function () { return !!e.MMPlugin; }, }, mediav: { url: "https://s.ssl.qhimg.com/static/cc26a038d0ce4f91.js", checker: function () { return !!e.MediavAds; }, }, "ad-polymer-sdk": { url: "https://s3.ssl.qhimg.com/static/ca8370b36fb4f5bf.js", checker: function () { return !!e.qhMultiResourceInnV2; }, }, }, o = [], u = [], a = !1; e._loader = { add: function (e, t, n) { s[e] ? So.comm.isajax && (s[e].loaded = !1) : (s[e] = { url: t, checker: n }); }, use: function (e, n) { t.DomU.ready(function () { (e = e.split(/\\s*,\\s*/g)), (o = o.concat(e)), u.push({ requires: e, fun: n }), a || c(); }); }, remove: function (e) { s[e] && delete s[e]; }, }; })(window) ``` -------------------------------- ### Theming and Skinning CSS for UI Elements Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This CSS section provides styles for applying different 'skins' or themes to various user interface elements. It defines color schemes for text and links, background image positions for icons, and border styles for search input fields, including hover states and fallback colors for older browsers. ```CSS .skin #footer span { color: rgba(255, 255, 255, 0.2); color: #fff\\9; margin: 0 8px; } .skin .ac_wrap { margin-top: 0; } .skin-text, .skin-text a { color: #666; } .skin-text:hover, .skin-text a:hover { color: #333; } .skin .skin-text, .skin .skin-text a { color: #fff; } .skin .skin-text:hover, .skin .skin-text a:hover { color: rgba(255, 255, 255, 0.8); } .skin-tab-ico { background: url(https://p.ssl.qhimg.com/t01512497e6e7151b1f.png) no-repeat -50px -290px; } .skin-search-input { border: 1px solid #bbb; } .skin-text-tab strong { color: #19b955; } .skin .skin-tab-ico { background-position: -50px -280px; } .skin-search-input:hover { border: 1px solid #999; } .skin-search-input.hover { border: 1px solid #19b955; } .skin .skin-search-input { background: rgba(255, 255, 255, 0.9); background: #fff\\9; border: 1px solid #fff; } .skin .skin-text-tab strong { co ``` -------------------------------- ### JavaScript Local Storage Availability Check (n.soLocalStorage) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This snippet attempts to access `window.localStorage` and assigns it to `n.soLocalStorage`. It includes a try-catch block to gracefully handle environments where `localStorage` might not be available or accessible, preventing errors. ```JavaScript (n.soLocalStorage = !1); try { n.soLocalStorage = window.localStorage; } catch (s) {} ``` -------------------------------- ### Comprehensive CSS for UI Components and News Flow Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This snippet contains all the CSS rules for styling interactive elements such as close buttons, loading animations, and a news/content feed. It includes definitions for layout, text appearance, image handling with animations, and special overlays for media types like videos. ```CSS ask .close:hover { background-position: -10px -40px; } #close-card-mask .sure-del, #close-card-mask .cancel { border-radius: 3px; border: 1px solid #00be3c; color: #333; display: inline-block; font-size: 14px; height: 30px; line-height: 30px; margin: 0 15px; width: 80px; } #close-card-mask .sure-del { color: #00be3c; } #close-card-mask .cancel { background-color: #00be3c; color: #fff; } #close-card-mask .cancel:hover { background-color: #1bc550; } #card_container .card-loading { margin: 110px 0; } #card_container .card-loading p { color: #333; font-size: 13px; height: 35px; line-height: 35px; margin: 5px auto 72px; text-align: center; width: 120px; } #card_container .card-loading .ico { background: url(https://p.ssl.qhimg.com/t01a214fd02e70ced77.gif) no-repeat; display: inline-block; height: 16px; margin-right: 4px; padding-right: 0; vertical-align: text-top; width: 18px; } #card_container .card-loading.block { margin: 0; } #res_news_flow { display: none; margin-top: -15px; min-height: 454px; } #res_news_flow a { outline: 0; } .hide-res-folding #res_news_flow { display: block; } #res_news_flow.has-top-title .loading.long { display: none; } #res_news_flow .top-title { margin: 120px 0 25px; } #res_news_flow .title { margin-bottom: 15px; } #res_news_flow li { border-top: 1px solid #e5e5e5; overflow: hidden; position: relative; width: 100%; } #res_news_flow li.curr { overflow: visible; z-index: 1; } #res_news_flow li:first-child { border: 0; } #res_news_flow li a { display: block; text-decoration: none; } #res_news_flow .respond { display: block; padding: 10px 0; transition: background 0.2s; -webkit-transition: background 0.2s; } #res_news_flow .respond:hover { background: #fafafa; } #res_news_flow .sub-title { color: #333; font-family: PingFangSC-Regular, arial, "Microsoft Yahei", "微软雅黑"; font-weight: 700; font-size: 18px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #res_news_flow .sub-title.long { display: none; } #res_news_flow .sub-title b { color: #c00; } #res_news_flow .sub-title em { text-decoration: none; } #res_news_flow li p.sub-title:hover, #res_news_flow li a.sub-title:hover { color: #333; text-decoration: underline; } #res_news_flow a:visited .sub-title, #res_news_flow .sub-title:visited { color: #999; } #res_news_flow .img { font-size: 0; margin-top: 8px; position: relative; } #res_news_flow .img-wrap { background-color: #f0f0f0; background-image: url(https://p.ssl.qhimg.com/t0129041a30aba4db0b.png); background-position: center center; background-repeat: no-repeat; display: inline-block; height: 84px; margin-right: 4px; overflow: hidden; width: 132px; } #res_news_flow .img-wrap.last { margin-right: 0; } #res_news_flow .img img.anim { transition: transform 0.5s ease-in-out; -webkit-transition: transform 0.5s ease-in-out; } #res_news_flow .img img.anim:hover { transform: scale(1.2); -webkit-transform: scale(1.2); } #res_news_flow .corner { background: rgba(0, 0, 0, 0.5); border-radius: 9px; bottom: 3px; color: rgba(255, 255, 255, 0.7); font-size: 12px; line-height: 18px; padding: 0 7px; position: absolute; right: 3px; } .ie8 #res_news_flow .corner { color: #d1cfcf; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f000000,endColorstr=#7f000000); } #res_news_flow .corner.red { background: #fa5050; } #res_news_flow .corner .arrow { background: url(https://p.ssl.qhimg.com/t01c2b710afeb27837b.png) 0 0 no-repeat; display: inline-block; height: 8px; margin-right: 3px; vertical-align: middle; width: 6px; } #res_news_flow .desc { color: #999; font-size: 13px; padding-top: 8px; } #res_news_flow .single-img .desc { padding-top: 10px; } #res_news_flow .desc span { margin-right: 12px; } #res_news_flow .desc .tag { border: 1px solid #e5e5e5; display: inline-block; height: 20px; line-height: 20px; padding: 0 4px; } #res_news_flow .desc .tag:hover { border: 1px solid #1dd160; color: #1dd160; } #res_news_flow .desc .tag:active { border: 1px solid #16aa4e; color: #16aa4e; } .ie8 #res_news_flow .desc .tag { height: 18px; padding-top: 2px; } #res_news_flow li.single-img { display: table; } #res_news_flow li.single-img .img { display: table-cell; margin-top: 0; padding: 3px 0; vertical-align: top; } #res_news_flow li.single-img .con { display: table-cell; padding-left: 16px; vertical-align: middle; width: 400px; } #res_news_flow li.single-img .corner { bottom: 6px; } #res_news_flow li.single-img .sub-title { overflow: visible; text-overflow: inherit; white-space: normal; word-break: break-all; } #res_news_flow .video .corner { right: 7px; } #res_news_flow li.video .play { background-image: url(https://p.ssl.qhimg.com/t0135c97a2dc9afd279.png); background-image: -webkit-image-set(url(https://p.ssl.qhimg.com/t0135c97a2dc9afd279.png) 1x,url(https://p.ssl.qhimg.com/t01a31db5da0ae798c3.png) 2x); background-color: rgba(0, 0, 0, 0.39); background-repeat: no-repeat; background-posit ``` -------------------------------- ### Browser Detection Utility (OB.Browser) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html Provides an object `OB.Browser` that identifies the user's browser (e.g., msie, webkit, gecko, opera, safari, firefox, chrome) and its version, along with the platform. It also includes a fix for IE's BackgroundImageCache to prevent issues. ```javascript t.Browser = (function () { var t = e.navigator, n = t.userAgent.toLowerCase(), r = /(msie|webkit|gecko|presto|opera|safari|firefox|chrome|maxthon|android|ipad|iphone|webos|hpwos)[ \\/os]*([\d_.]+)/gi, i = { platform: t.platform }; n.replace(r, function (e, t, n) { var r = t.toLowerCase(); i[r] || (i[r] = n); }), i.opera && n.replace(/opera.*version\/([\d.]+)/, function (e, t) { i.opera = t; }); if (i.msie) { i.ie = i.msie; var s = parseInt(i.msie, 10); i["ie" + s] = !0; } return i; })(); if (t.Browser.ie) try { document.execCommand("BackgroundImageCache", !1, !0); } catch (n) {} ``` -------------------------------- ### JavaScript Event Observer (Publish-Subscribe Pattern) (n.observer) Source: https://github.com/fefit/rphtml/blob/master/cases/full.html The `n.observer` implements a simple publish-subscribe pattern for managing events. It allows modules to `subscribe` to named events, `publish` events with arguments (which are immediately delivered to existing subscribers), and `remove` subscriptions. It also includes a debug method `_dbg` to inspect the internal state. ```JavaScript (n.observer = (function () { var e = {}, t = Array.prototype.slice, n = function (t) { e[t] || (e[t] = { cbs: [], ok: !1, args: [] }); }; return { _dbg: function () { return e; }, publish: function () { var r = t.call(arguments), i = r.shift() || ""; if (!i) return; n(i), (e[i].ok = !0), (e[i].args = r); var s = (e[i].cbs || []).concat(), o = s.length; while (o) s[--o].apply(this, r); }, subscribe: function (t, r) { if (!t || typeof r != "function") return; n(t), e[t].ok && r.apply(this, e[t].args), e[t].cbs.unshift(r); }, remove: function (t, n) { $.each(e, function (r, i) { ((!n && t == r) || (n && new RegExp("^" + t + ".*$").test(r))) && delete e[r]; }); }, }; })()) ``` -------------------------------- ### Client-Side Monitoring and Tracking Utility Source: https://github.com/fefit/rphtml/blob/master/cases/full.html A utility function for client-side monitoring and tracking. It gathers various client and application-specific data, such as project ID, session ID, module, query, AB test information, screen dimensions, and window size, then sends this data to a remote analytics server via a GIF request. ```JavaScript function u(t, n, r, i) { var s = { pro: "so", pid: So.comm.pid || "", sid: So.comm.sid || "", mod: t, q: So.comm.q || "", abv: So.comm.abv || "", src: So.comm.src || "", ablist: So.comm.monitor && So.comm.monitor.ablist.join(","), nlpv: So.comm.monitor && So.comm.monitor.nlpv, dpi: window.screen.width + "_" + window.screen.height, ds: (o.clientWidth || window.innerWidth) + "_" + (o.clientHeight || window.innerHeight) }; if (n) for (prop in n) s[prop] = n[prop]; if (e.monitor) { var u = "//s.qhupdate.com/" + r + ".gif"; i } ``` -------------------------------- ### General Styling for Fefit RPHTML Skins Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This extensive CSS snippet provides styling for multiple theme variations (e.g., 'skin-dark', 'skin-dark_light', 'skin-light_dark') and general UI components. It covers text colors, link styles, input borders, navigation borders, footer text, and advertisement wrapper appearance, including an inline SVG background image. ```CSS lor: #fff; } .skin .skin-search-input:hover, .skin .skin-search-input.hover { background: #fff; } .skin .skin-text-tab a:hover { color: rgba(255, 255, 255, 0.8); text-decoration: underline; } .skin-dark .skin-text, .skin-dark .skin-text a { color: #666; } .skin-dark .skin-text:hover, .skin-dark .skin-text a:hover { color: #333; } .skin-dark .skin-tab-ico { background-position: -50px -290px; } .skin-dark .skin-search-input { border: 1px solid #bbb; } .skin-dark .skin-text-skin-text-tab strong { color: #19b955; } .skin-dark #hd_nav li { border-right-color: rgba(0, 0, 0, 0.1); } .skin-dark #footer span { color: rgba(0, 0, 0, 0.1); } .skin-dark_light .skin-text-top, .skin-dark_light .skin-text-top a { color: #666; } .skin-dark_light .skin-text-top:hover, .skin-dark_light .skin-text-top a:hover { color: #333; } .skin-dark_light .skin-tab-ico { background-position: -50px -290px; } .skin-dard_light .skin-text-foot, .skin-dard_light .skin-text-foot a { color: #fff; } .skin-dark_light .skin-text-tab strong { color: #19b955; } .skin-dark_light .skin-text-tab a { color: #666; text-decoration: none; } .skin-dark_light .skin-text-tab a:hover { color: #333; text-decoration: underline; } .skin-dark_light #hd_nav li { border-right-color: rgba(0, 0, 0, 0.1); } .skin-dark_light #footer span { color: rgba(255, 255, 255, 0.2); } .skin-light_dark .skin-text-top, .skin-light_dark .skin-text-top a { color: #fff; } .skin-light_dark .skin-text-top:hover, .skin-light_dark .skin-text-top a:hover { color: rgba(255, 255, 255, 0.8); text-decoration: underline; } .ad-wrap { color: #fff; font-size: 14px; margin-bottom: 30px; max-height: 40px; text-align: center; } .ad-wrap a { position: relative; } .skin-light_dark .skin-tab-ico { background-position: -50px -280px; } .skin-light_dark .skin-text-foot, .skin-light_dark .skin-text-foot a { color: #666; } .ad-wrap.big { max-height: 100px; } .hascard .ad-wrap { display: none; } .ad-wrap .jinju-icon { height: 14px; margin-right: 5px; vertical-align: bottom; width: 11px; } .skin-light_dark .skin-text-tab strong, .skin-light_dark .skin-text-tab a { color: #fff; } .skin-light_dark .skin-text-tab a:hover { color: rgba(255, 255, 255, 0.8); text-decoration: underline; } body.skin-light .ad-wrap .txt { text-shadow: 0 0 2px rgba(0, 0, 0, 0.6); } .skin-light_dark #hd_nav li { border-right-color: rgba(255, 255, 255, 0.2); } .skin-light_dark #footer span { color: rgba(0, 0, 0, 0.1); } #main .ad-wrap i { background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIxMnB4IiB2aWV3Qm94PSIwIDAgMjQgMTIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ3LjEgKDQ1NDIyKSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5Hcm91cCAyIENvcHkgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLop4TojIMtY29weSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMzMC4wMDAwMDAsIC0xOTAuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSJHcm91cC0yLUNvcHktMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzMwLjAwMDAwMCwgMTkwLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHBhdGggZD0iTTIsMCBMMjQsMCBMMjQsMTAgTDI0LDEwIEMyNCwxMS4xMDQ1Njk1IDIzLjEwNDU2OTUsMTIgMjIsMTIgTDAsMTIgTDAsMiBMMCwyIEMtMS4zNTI3MDc1ZS0xNiwwLjg5NTQzMDUgMC44OTU0MzA1LDIuMDI5MDYxMjVlLTE2IDIsMCBaIiBpZD0iUmVjdGFuZ2xlLTItQ29weS04IiBmaWxsPSIjMDEwMDAwIiBvcGFjaXR5PSIwLjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik03LjQxLDEuNjcgTDYuMzUsMS44NSBDNi41MywyLjEzIDYuNjksMi40NSA2Ljg0LDIuNzkgTDMuMTksMi43OSBMMy4xOSw1LjgyIEMzLjE3LDcuNzcgMi45LDkuMyAyLjM4LDEwLjQgTDMuMTgsMTEuMTEgQzMuOCw5Ljc4IDQuMTIsOC4wMiA0LjE1LDUuODIgTDQuMTUsMy43MSBMMTEuNDgsMy43MSBMMTEuNDgsMi43OSBMNy44OSwyLjc5IEM3LjczLDIuMzcgNy41NywyIDcuNDEsMS42NyBaIE0yMC4zOCw3LjIzIEwyMC4zOCwxMS4wMiBMMTkuNDIsMTEuMDIgTDE5LjQyLDEwLjU0IEwxNC42NCwxMC41NCBMMTQuNjQsMTEuMDIgTDEzLjY4LDExLjAyIEwxMy42OCw3LjIzIEwyMC4zOCw3LjIzIFogTTE0LjY0LDkuNjUgTDE5LjQyLDkuNjUgTDE5LjQyLDguMTMgTDE0LjY0LDguMTMgTDE0LjY0LDkuNjUgWiBNMTQuNDEsNC4wNCBMMTYuNjUsNC4wNCBMMT2uNjUsNS40MiBMMTIsNDUuNDIgTDEyLjQ1LDYuMzUgTDIxLjU1LDYuMzUgTDIxLjU1LDUuNDIgTDE3LjYsNS40MiBMMTcuNiw0LjA0IEwyMC43OSw0LjA0IEwyMC43OSwzLjEzIEwxNy42LDMuMTMgTDE3LjYsMS43OSBMMTYuNjUsMS43OSBMMTYuNjUsMy4xMyBMMTQuOTcsMy4xMyBEMTUuMTQsMi43OSAxNS4yOCwyLjQyIDE1LjQsMi4wMyBMMTQuNDYsMS45MSBEMTQuMTQsMi45NSAxMy41NCwzLjgyIDEyLjY2LDQuNTMgTDEzLjIzLDUuMjggQzEzLjY4LDQuOTEgMTQuMDcsNC41IDE0LjQxLDQuMDQgWiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgogPC9zdmc=") no-repeat center center; bottom: 2px; display: block; height: 12px; position: absolute; right: 0; width: 24px; z-index: 2; } #main .ad-wrap .ad { cursor: pointer; display: inline-block; *display: inline; font-size: 14px; line-height: 14px; margin: 0 auto; zoom: 1; } #main .ad-wrap .ad img ``` -------------------------------- ### Responsive Adjustments for Logo and Search Bar Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This CSS section provides responsive design rules for the logo (#bd_logo) and search bar (#bd_search). It uses custom classes (.less888, .less728, .less696) and media queries based on max-height to adjust margins and positioning, ensuring optimal display across various screen sizes and orientations. ```CSS .less888 #bd_logo { margin: 95px auto 50px; } .less888 #bd_search { margin-bottom: 60px; } .less728 #bd_logo { margin: 25px auto 50px; } .less728 #bd_search { margin-bottom: 40px; } .less696 #bd_logo { margin: 55px auto 45px; } .less696 #bd_search { margin-bottom: 20px; } .less888 .hascard #bd_logo { margin: 90px auto 50px; } .less728 .hascard #bd_logo { margin: 30px auto; } .less696 .hascard #bd_logo { margin: 8px auto; } @media screen and (max-height: 1600px) { #bd_logo { margin: 290px auto 50px; } } @media screen and (max-height: 1440px) { #bd_logo { margin: 140px auto 50px; } } @media screen and (max-height: 900px) { #bd_logo { margin: 80px auto 50px; } } @media screen and (max-height: 696px) { #bd_logo { margin: 55px auto 45px; } } ``` -------------------------------- ### JavaScript JSON Parse/Stringify Wrapper with Error Handling and Polyfill Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This module enhances `window.JSON` by wrapping `JSON.parse` and `JSON.stringify` with try-catch blocks to prevent errors during parsing or stringifying, returning default values (empty object or empty string) on failure and logging the error to the console. It also provides a basic JSON polyfill implementation if `window.JSON` is not natively available, including logic for escaping special characters. ```JavaScript (function (win, doc, undefined) { if (window.JSON) { var _json_parse = window.JSON.parse; window.JSON.parse = function (e, t) { try { return _json_parse.apply(this, arguments); } catch (n) { return window.console && console.log(n), {}; } }; var _json_stringify = window.JSON.stringify; window.JSON.stringify = function (e, t, n) { try { return _json_stringify.apply(this, arguments); } catch (r) { return window.console && console.log(r), ""; } }; } else window.JSON = (function () { var m = { "\b": "\\b", " ": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, s = { boolean: function (e) { return String(e); }, number: function (e) { return isFinite(e) ? String(e) : "null"; }, string: function (e) { return ( /[\"\\\x00-\x1f]/.test(e) && (e = e.replace(/([\x00-\x1f\\"])/g, function (e, t) { var n = m[t]; return n ? n : ((n = t.charCodeAt()), "\\u00" + Math.floor(n / 16).toString(16) + (n % 16).toString(16)); })), '"' + e + '"' ); }, object: function (e) { if (e) { var t = [], n, r, i, o, u; if (e instanceof Array) { (t[0] = "["), (o = e.length); for (i = 0; i < o; i += 1) (u = e[i]), (r = s[typeof u]), r && ((u = r(u)), typeof u == "string" && (n && (t[t.length] = ","), (t[t.length] = u), (n = !0))); ``` -------------------------------- ### CSS Styling for Header and Logo Elements Source: https://github.com/fefit/rphtml/blob/master/cases/full.html This CSS snippet defines styles for various header components such as user navigation, settings, and the main logo. It includes rules for display properties, positioning, margins, background images (including base64 encoded SVGs), and CSS transitions for animations. Specific rules target elements like #hd_usernav, #hd_setting, #bd_logo, and #hd_nav to control their appearance and behavior. ```CSS MUwzMi45LDE4LjdjMy4xLDAsNC44LDAsNS4yLDBjLjIsMCwuOSwwLC45LS45YzAtLjYsMC0xLjMsMC0yLjFjLTEuNiwwLTIuNiwwLTIuOSwwYy0uNSwwLTEtLjQtMS0uOXMwLTIuNSwwLTNjMC0uNS41LTEuMSwxLTEuMWMuMywwLDEuMywwLDIuOSwwYzAtLjUsMC0xLDAtMS43QzM4LjksOC4xLDM4LjgsNy43LDM3LjgsNy43Yy0zLjEsMC0yLjktMS40LTIuOS0yLjVWMy44YzAtLjQuNi0xLDEtMWwzLjcsMGMyLjUsMCw0LjMsMi41LDQuMyw1LjRjMCwyLjksMCw4LjIsMCwxMXMtMS42LDQuNS00LjMsNC41Yy00LjQsMC02LjcsMC02LjcsMHpNMTEuOSw2LjdoMi ```