* Use iframe for connect sidecar * Modify css of lefthand sidebar * Add proper sidecar markup * Update tests
148 lines
6.7 KiB
Text
148 lines
6.7 KiB
Text
<script>
|
|
try {
|
|
var bodyClass = localStorage.getItem('config_body_class');
|
|
document.body.className = bodyClass;
|
|
if (bodyClass.includes('night-theme')) {
|
|
document.getElementById('body-styles').innerHTML = '<style>\
|
|
:root {\
|
|
--theme-background: #0d1219;\
|
|
--theme-color: #fff;\
|
|
--theme-opposite-color: #0d1219;\
|
|
--theme-logo-background: #0a0a0a;\
|
|
--theme-logo-color: #fff;\
|
|
--theme-code-background: #29292e;\
|
|
--theme-code-color: #e6db74;\
|
|
--theme-reaction-background: #202c3d;\
|
|
--theme-anchor-color: #17a1f6;\
|
|
--theme-secondary-color: #cedae2;\
|
|
--theme-secondary-color-border: 1px solid #cedae2;\
|
|
--theme-top-bar-background: #1c2938;\
|
|
--theme-top-bar-background-hover: #27384c;\
|
|
--theme-top-bar-color: #fff;\
|
|
--theme-top-bar-search-background: #424a54;\
|
|
--theme-top-bar-search-color: #fff;\
|
|
--theme-top-bar-write-background: #00af81;\
|
|
--theme-top-bar-write-color: #fff;\
|
|
--theme-container-background: #141f2d;\
|
|
--theme-container-accent-background: #202c3d;\
|
|
--theme-container-background-hover: #1c2c3f;\
|
|
--theme-gradient-background: linear-gradient(to right, #293d56 8%, #282833 18%, #293d56 33%);\
|
|
--theme-container-color: #fff;\
|
|
--theme-container-box-shadow: none;\
|
|
--theme-container-border: 1px solid #22303f;\
|
|
--theme-subtle-border: 1px solid #1f2c3a;\
|
|
--theme-social-icon-invert: invert(100);\
|
|
--theme-social-icon-color: #cedae2;\
|
|
--theme-current-article-background: #1143ca;\
|
|
--theme-series-article-background: #314d9c;\
|
|
--theme-series-article-hover: #1b2e63;</style>'
|
|
} else if (bodyClass.includes('ten-x-hacker-theme')) {
|
|
document.getElementById('body-styles').innerHTML = '<style>\
|
|
:root {\
|
|
--theme-background: #0a0a0a;\
|
|
--theme-color: #42ff87;\
|
|
--theme-opposite-color: #0d1219;\
|
|
--theme-logo-background: #42ff87;\
|
|
--theme-logo-color: #0a0a0a;\
|
|
--theme-code-background: #29292e;\
|
|
--theme-code-color: #42ff87;\
|
|
--theme-reaction-background: #202c3d;\
|
|
--theme-anchor-color: #e24ec1;\
|
|
--theme-secondary-color: #ebebeb;\
|
|
--theme-secondary-color-border: 1px solid #cedae2;\
|
|
--theme-top-bar-background: #1c1c1c;\
|
|
--theme-top-bar-background-hover: #27384c;\
|
|
--theme-top-bar-color: #fff;\
|
|
--theme-top-bar-search-background: #0a0a0a;\
|
|
--theme-top-bar-search-color: #42ff87;\
|
|
--theme-top-bar-write-background: #0a0a0a;\
|
|
--theme-top-bar-write-color: #42ff87;\
|
|
--theme-container-background: #030303;\
|
|
--theme-container-accent-background: #000f0b;\
|
|
--theme-container-background-hover: #1c2c3f;\
|
|
--theme-gradient-background: linear-gradient(to right, #010f06 8%, #121a16 18%, #010f06 33%);\
|
|
--theme-container-color: #42ff87;\
|
|
--theme-container-box-shadow: none;\
|
|
--theme-container-border: 1px solid #22303f;\
|
|
--theme-subtle-border: 1px solid #1f2c3a;\
|
|
--theme-social-icon-invert: invert(100);\
|
|
--theme-current-article-background: #1143ca;\
|
|
--theme-series-article-background: #006655;\
|
|
--theme-series-article-hover: #004035;</style>'
|
|
} else if (bodyClass.includes('pink-theme')) {
|
|
document.getElementById('body-styles').innerHTML = '<style>\
|
|
:root {\
|
|
--theme-background: #FFF7F9;\
|
|
--theme-color: #0a0a0a;\
|
|
--theme-opposite-color: #fff7f9;\
|
|
--theme-logo-background: #fff7f9;\
|
|
--theme-logo-color: #ff4983;\
|
|
--theme-code-background: #f9f9fa;\
|
|
--theme-code-color: #f92671;\
|
|
--theme-reaction-background: #eff0f2;\
|
|
--theme-anchor-color: #4e57ef;\
|
|
--theme-secondary-color: #4e57ef;\
|
|
--theme-secondary-color-border: 1px solid #4e57ef;\
|
|
--theme-top-bar-background: #ff4983;\
|
|
--theme-top-bar-background-hover: #ff5b8f;\
|
|
--theme-top-bar-color: #fff;\
|
|
--theme-top-bar-search-background: #FFF7F9;\
|
|
--theme-top-bar-search-color: #000;\
|
|
--theme-top-bar-write-background: #ff4983;\
|
|
--theme-top-bar-write-color: #fff;\
|
|
--theme-container-background: #fff;\
|
|
--theme-container-accent-background: #ffccdb;\
|
|
--theme-container-background-hover: #ffe5eb;\
|
|
--theme-gradient-background: linear-gradient(to right, #fff 8%, #ffceda 18%, #FFF7F9 33%);\
|
|
--theme-container-color: #333;\
|
|
--theme-container-box-shadow: none;\
|
|
--theme-container-border: 1px solid #ff4983;\
|
|
--theme-subtle-border: 1px solid #ffa8c3;\
|
|
--theme-social-icon-color: rgba(255, 204, 219, 0);\
|
|
--theme-social-icon-invert: invert(0);\
|
|
--theme-prime-option-border-color: rgba(255, 255, 255, 0.55)</style>'
|
|
} else if(bodyClass.includes('minimal-light-theme')) {
|
|
document.getElementById('body-styles').innerHTML = '<style>\
|
|
:root {\
|
|
--theme-background: #fcfcfc;\
|
|
--theme-color: #0a0a0a;\
|
|
--theme-opposite-color: #ffffff;\
|
|
--theme-logo-background: #e3e5ed;\
|
|
--theme-logo-color: #232426;\
|
|
--theme-code-background: #f9f9f9;\
|
|
--theme-code-color: #37383d;\
|
|
--theme-reaction-background: #eff0f2;\
|
|
--theme-anchor-color: #757ec6;\
|
|
--theme-secondary-color: #505159;\
|
|
--theme-secondary-color-border: 1px solid #14364c;\
|
|
--theme-top-bar-background: #ffffff;\
|
|
--theme-top-bar-background-hover: #f9f9f9;\
|
|
--theme-top-bar-color: #0a0a0a;\
|
|
--theme-top-bar-search-background: #f4f5f7;\
|
|
--theme-top-bar-search-color: #0a0a0a;\
|
|
--theme-top-bar-write-background: #ffffff;\
|
|
--theme-top-bar-write-color: #0a0a0a;\
|
|
--theme-container-background: #ffffff;\
|
|
--theme-container-accent-background: #f4f5f7;\
|
|
--theme-container-background-hover: #efefef;\
|
|
--theme-gradient-background: linear-gradient(to right, #f6f6f6 8%, #f0f0f0 18%, #f6f6f6 33%);\
|
|
--theme-container-color: #0a0a0a;\
|
|
--theme-container-box-shadow: none;\
|
|
--theme-container-border: 1px solid #e3e3e5;\
|
|
--theme-subtle-border: 1px solid #fcfcfc;\
|
|
--theme-social-icon-color: rgba(80, 81, 89, 0);\
|
|
--theme-social-icon-invert: invert(0)</style>'
|
|
}
|
|
if (navigator.userAgent === 'DEV-Native-ios') {
|
|
document.getElementsByTagName("body")[0].classList.add("dev-ios-native-body");
|
|
}
|
|
if (localStorage.getItem('config_minimize_newest_listings') === 'yes') {
|
|
document.getElementsByTagName("body")[0].classList.add("config_minimize_newest_listings");
|
|
}
|
|
if (window.frameElement) {
|
|
document.getElementsByTagName("body")[0].classList.add("hidden-shell");
|
|
}
|
|
} catch(e) {
|
|
console.log(e)
|
|
}
|
|
</script>
|