Skip to content

Commit

Permalink
Merge pull request #75 from SpartaEnergizerTeam/develop
Browse files Browse the repository at this point in the history
main into develop
  • Loading branch information
1eeyerin authored May 9, 2024
2 parents 5d9a097 + ef83d85 commit 64c77b2
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ table {
--main-rgba-color2: rgba(255, 255, 255, 0.15);
}

.light-mode {
[data-theme='light-mode'] {
--background-color: #ffffff;
--main-color0: #1b1b1b;
--main-color1: #333333;
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link rel="stylesheet" href="./css/popup.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="./js/swiper-bundle.min.js"></script>
<script src="./js/theme.js"></script>
<script defer src="./js/common.js" type="module"></script>
<script defer src="./js/index.js" type="module"></script>
<script defer src="./js/popup.js"></script>
Expand Down
13 changes: 4 additions & 9 deletions js/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,15 @@ const header = () => {

const themeHandler = () => {
const themeButton = document.querySelector('#themeBtn');
const bodyElement = document.body;
const rootElement = document.querySelector(':root');

if (themeButton) {
themeButton.addEventListener('click', () => {
bodyElement.classList.toggle('light-mode');
const lightMode = bodyElement.className;
setLocalStorage('theme-mode', lightMode === 'light-mode' ? 'light-mode' : '');
const lightMode = rootElement.dataset.theme;
rootElement.dataset.theme = lightMode ? '' : 'light-mode';
setLocalStorage('theme-mode', lightMode ? '' : 'light-mode');
});
}

const themeMode = getLocalStorage('theme-mode');
if (themeMode === 'light-mode') {
bodyElement.classList.add('light-mode');
}
};

handleSearch();
Expand Down
5 changes: 5 additions & 0 deletions js/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const themeMode = localStorage.getItem('theme-mode');

if (themeMode === 'light-mode') {
document.querySelector(':root').dataset.theme = 'light-mode';
}
1 change: 1 addition & 0 deletions page/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="../css/page/detail.css"/>
<link rel="stylesheet" href="../css/page/review.css"/>
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css" />
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/detail.js" type="module"></script>
<script defer src="../js/page/review/index.js" type="module"></script>
Expand Down
1 change: 1 addition & 0 deletions page/nowplaying.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="../css/common.css" />
<link rel="stylesheet" href="../css/page/subpage.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/subpage.js" type="module"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/popular.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="../css/common.css" />
<link rel="stylesheet" href="../css/page/subpage.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/subpage.js" type="module"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="stylesheet" href="../css/reset.css" />
<link rel="stylesheet" href="../css/common.css" />
<link rel="stylesheet" href="../css/page/profile.css" />
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/profile.js"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/search-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="../css/page/search.css"/>
<link rel="stylesheet" href="../css/page/search-result.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/searchList.js" type="module"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="stylesheet" href="../css/page/search.css"/>
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/swiper-bundle.min.js"></script>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/searchMain.js" type="module"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/top20.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="../css/common.css" />
<link rel="stylesheet" href="../css/page/subpage.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/subpage.js" type="module"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions page/upcoming.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="../css/common.css" />
<link rel="stylesheet" href="../css/page/subpage.css" />
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"/>
<script src="../js/theme.js"></script>
<script defer src="../js/common.js" type="module"></script>
<script defer src="../js/page/subpage.js" type="module"></script>
</head>
Expand Down

0 comments on commit 64c77b2

Please sign in to comment.