How to Make Night Mode [Dark Mode] on Blogger - hyderabadrichest

How to Make Night Mode [Dark Mode] on Blogger

How to Make Night Mode [Dark Mode] on Blogger

The addition of the night mode feature is usually used to pamper visitors who want to see dark displays on visited blogs. There is a button/switch to change the display from standard mode to dark mode.

The dark mode/night mode switch is then adjusted via CSS changes. This code will then follow the instructions from the script that initiates this mode. Many bloggers are already using this installation on their blogs, I'm also one of them. How about you, are you interested in using this trick? If so, then feel free to continue following this tutorial until it's finished.

With this installation, it will automatically make the blog look cooler. And in this tutorial, I will show you how to create and then install Night mode into a blog template. In this script a cookie set has also been added so that when the page is reloaded or the page is re-visited, it will not return to its original mode even though you have visited another page.

How about a blog template that has a dark base color, can you apply this method too? Of course you can, but if you use this method, of course you will call it in other terms, for example Day Mode, Light Mode, Day Mode etc. I think maybe my explanation is enough about this night mode and let's go straight to how to make and install it below.

How to Install Night Mode on Blogger [Blogspot]

As usual, make sure you are logged into your blogger account. Open Theme then click Edit HTML

1.  Add the following script before </body>
 <div class='Switchbtn'>  
<span class='nightly'>Night Mode</span> <input class='togglenight togglenight-switch' id='nightmode' type='checkbox'/>
<label class='togglenight-btn' for='nightmode'/></div>
<script type='text/javascript'>
// Night Mode

2. Next add this CSS code before </head>
 <style type='text/css'>  
/* Night Mode */
.togglenight + .togglenight-btn{outline:0;display:inline-block;width:45px;height:10px;position:relative;cursor:pointer;margin-left:5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
.togglenight + .togglenight-btn:after,.togglenight + .togglenight-btn:before{position:relative;display:block;content:"";width:50%;height:100%}
.togglenight-switch + .togglenight-btn{background:#d5d2fc;border-radius:99em;transition:all .4s ease}
.togglenight-switch + .togglenight-btn:after{content:'';border-radius:100px;background:#887fff;transition:left 0.3s cubic-bezier(0.175,0.885,0.32,1.275),padding 0.3s ease,margin 0.3s ease;position:absolute;width:20px;height:20px;top:-5px;left:0;box-shadow:0 3px 6px rgba(0,0,0,0.16),0 3px 6px rgba(0,0,0,0.23)}
.togglenight-switch:checked + .togglenight-btn{background:rgba(255,255,255,.15)}
.togglenight:checked + .togglenight-btn:after{content:'';left:55%;background:#ff9f43}
.nightmode a{color:rgba(255,255,255,.7)!important}
.nightmode a:hover{color:rgba(255,255,255,.4)!important}
.nightmode .class-baru{}
.nightmode .class-baru{}

Information: In code 2 .nightmode .class-new {} is code that you can use to add new elements that you want to be included when pressing the night mode button. Please change the .class-new with the class element or HTML ID that you want to put into night mode. For example in the following example:
 .nightmode .popular-post h2{background:#222}  
.nightmode .Post-body h1{color:#fff}
.nightmode .Post-body th {color:#555}

Please also adjust the position of the nigth mode button


Creating a Responsive SEO Friendly Dark Mode

The following is the second method that can be applied to the Viomagz 3.3.0 template or the latest version and the like. I have used this method and worked on the viomagz template. Here's the tutorial:

1. Paste the following CSS code before ]]</b:skin>
 /* dark */  
.modedark svg{width:24px;height:24px;vertical-align:-5px;background-repeat:no-repeat!important;content:'';}
.modedark svg path{fill:#fff;}
.iconmode{cursor:pointer;display:block;padding:8px;background-position:center;transition:all .5s linear;}
.modedark .iconmode .openmode{display:block;}
.modedark .iconmode .closemode{display:none;}
.modedark .check:checked ~ .iconmode .openmode{display:none;}
.modedark .check:checked ~ .iconmode .closemode{display:block;}
.Night #wrapper{background:#121212;color:#ddd;}
.Night #header-container{background:#000;color:#ddd;}
.Night #cssmenu ul ul li{background:#121212;}
.Night #cssmenu ul ul li a{color:#fff;background:#121212;}
.Night #cssmenu ul li{background:#000;}
.Night #cssmenu ul li a,#cssmenu ul ul li a{color:#ddd;}
.Night .above-post-widget h2{color:#ddd;}
.Night .latest-post-title h2{color:#ddd;}
.Night a{color:#ddd;}
.Night .sidebar h2{color:#ddd;}
.Night .sidebar-sticky h2{color:#ddd;}
.Night .sidebar h2,.Night .sidebar-sticky h2{border-bottom:2px solid #ddd;}
.Night .sidebar h2::before,.Night .sidebar-sticky h2::before{background-color:#ddd;}
.Night .artikel-terbaru a{color:#ddd;}
.Night .artikel-terbaru a:hover{color:#0078d4;}
.Night .artikel-terbaru ul li::before{color:#ddd;}
.Night .PopularPosts ul li a{color:#ddd;}
.Night .author-profile >span{color:#595959;}
.Night .tableOfContent{border-color:rgba(255,255,255,.1);background-color:#15202b;}
.Night .tableOfContent #tocContent a{color:#fff;}
.Night .tableOfContent #tocContent ol ul:before,.post-body .tableOfContent ol ol:before,.post-body .tableOfContent #tocContent ul ol:before,.post-body .tableOfContent ul ul:before{border-left:1px dashed rgba(234,228,228,0.2);}
.Night .comments h3{color:#fff;}
.Night #Related ul li a.judul{color:#fff;}
.Night #Related ul li a.judul:hover,#Related ul li:hover a.judul{color:#fff;}
.Night #comments .comment .comment-content,.comment .comment-body{color:#fff;}
.Night #footer-wrapperx{background:#000;}
.Night #footbawah{background:#121212;color:#fff;}
.Night #footbawah a,.Night .Profile .profile-link,.Night .Profile .profile-name-link,.Night .related-post-style-3 .related-post-item-title{color:#ddd;}

2. Next, save the following Java Script code before. </body>
$(document).ready(function () {
$("#modedark").on("click", function () {
"Night" != localStorage.toggled ? ($("body").toggleClass("Night", !0), localStorage.toggled = "Night", $(".section-center").css("display", "block")) : ($("body").toggleClass("Night", !1), localStorage.toggled = "", $(".section-center").css("display", ""))
$("body").hasClass("Night") ? $("#modedark").prop("checked", !0) : $("#modedark").prop("checked", !1)

3. Next, add this Nightmode HTML code just above or before the code  </header>
 <div class='modedark'><input class='check' id='modedark' title='Mode Dark' type='checkbox'/><label class='iconmode' for='modedark'><svg class='openmode' viewbox='0 0 24 24'><path d='M12,18C11.11,18 10.26,17.8 9.5,17.45C11.56,16.5 13,14.42 13,12C13,9.58 11.56,7.5 9.5,6.55C10.26,6.2 11.11,6 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z'/></svg><svg class='closemode' viewbox='0 0 24 24'><path d='M14.3,16L13.6,14H10.4L9.7,16H7.8L11,7H13L16.2,16H14.3M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69M10.85,12.65H13.15L12,9L10.85,12.65Z'/></svg></label></div>  

4. Now save and see the results.

For the type of SVG icon and the placement of this dark mode button can be changed according to taste. Please be creative yourself. Of course, don't forget to back up the template before making changes.

That's the tutorial this time about how to install Dark Mode/Night Mode for blogger with a cool style and adding a shooting star effect.

Show Comments
Hide Comments

0 Response to "How to Make Night Mode [Dark Mode] on Blogger"

Post a comment

Top Ad Articles

Top Ad Articles

Top Ad Articles 2

Advertise Articles