8000 fix bug and adding theme-color by Deri-Kurniawan · Pull Request #5 · Deri-Kurniawan/windows-11-os · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix bug and adding theme-color #5

New issue
Merged
merged 1 commit into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions v1/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Portfolio Deri Kurniawan">
<meta name="keywords" content="Deri Kurniawan,Portfolio Deri Kurniawan,">
<meta name="theme-color" content="#fff">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
Expand Down
4 changes: 2 additions & 2 deletions v1/assets/js/script-about.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// set current page
localStorage['currentPage'] = 'about';

var aboutDescription = document.querySelector('#about-description');
var aboutDescriptionElement = document.querySelector('#about-description');

var i = 0;
var txt =
Expand Down Expand Up @@ -52,7 +52,7 @@ typeWriter();

function typeWriter() {
if (i < txt.length) {
aboutDescription.innerHTML += txt.charAt(i);
aboutDescriptionElement.innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
Expand Down
12 changes: 8 additions & 4 deletions v1/assets/js/script.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// set var
var body = document.body;
var navbar = document.getElementById('navbar');
var changeMode = document.getElementById('change-mode');
var aboutDescription = document.querySelector('#about-description');
let body = document.body;
let navbar = document.getElementById('navbar');
let changeMode = document.getElementById('change-mode');
let metaTagThemeColor = document.querySelector('meta[name=theme-color]');

// Check Last Mode

Expand All @@ -13,13 +13,15 @@ if (localStorage['nightMode'] === 'off') {
navbar.classList.replace('night-mode', 'bg-light');
navbar.classList.replace('navbar-dark', 'navbar-light');
body.classList.remove('night-mode');
metaTagThemeColor.setAttribute('content', '#fff');
// day to night
} else if (localStorage['nightMode'] === 'on') {
changeMode.setAttribute('title', 'Set To Day Mode');
changeMode.classList.replace('fa-moon', 'fa-sun');
navbar.classList.replace('bg-light', 'night-mode');
navbar.classList.replace('navbar-light', 'navbar-dark');
body.classList.add('night-mode');
metaTagThemeColor.setAttribute('content', '#000');
}

// add event
Expand All @@ -34,6 +36,7 @@ changeMode.addEventListener('click', function () {
changeMode.setAttribute('title', 'Set To Day Mode');
navbar.classList.replace('navbar-light', 'navbar-dark');
body.classList.add('night-mode');
metaTagThemeColor.setAttribute('content', '#000');

// set night mode to on
localStorage['nightMode'] = 'on';
Expand All @@ -46,6 +49,7 @@ changeMode.addEventListener('click', function () {
changeMode.setAttribute('title', 'Set To Night Mode');
changeMode.classList.replace('fa-sun', 'fa-moon');
body.classList.remove('night-mode');
metaTagThemeColor.setAttribute('content', '#fff');

// set night mode to off
localStorage['nightMode'] = 'off';
Expand Down
1 change: 1 addition & 0 deletions v1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Portfolio Deri Kurniawan">
<meta name="keywords" content="Deri Kurniawan,Portfolio Deri Kurniawan,">
<meta name="theme-color" content="#fff">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
Expand Down
1 change: 1 addition & 0 deletions v1/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Portfolio Deri Kurniawan">
<meta name="keywords" content="Deri Kurniawan,Portfolio Deri Kurniawan,">
<meta name="theme-color" content="#fff">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
Expand Down
0