Skip to content

Commit

Permalink
feat: add hide comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Jun 11, 2024
1 parent bf63bc4 commit c05929a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

### Deployment API

- Vercel
[https://dikit.my.id/DeploymentApiVercel](https://dikit.my.id/DeploymentApiVercel)

- Hosting
[https://dikit.my.id/DeploymentApiHosting](https://dikit.my.id/DeploymentApiHosting)
- Presentation
[https://docs.google.com/presentation/d/1EY2YmWdZUI7ASoo0f2wvU7ec_Yt0uZanYa8YLbfNysk/edit](https://docs.google.com/presentation/d/1EY2YmWdZUI7ASoo0f2wvU7ec_Yt0uZanYa8YLbfNysk/edit)

### Tech stack

Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</head>

<body data-key="bfb9cfea33ab7ae21a315fbd6f065a815d3e20ff2f007aa2ca" data-url="https://api.ulems.my.id/" style="overflow-y: hidden;">
<!-- If not using comments, you can remove the data-key and data-url attributes -->

<!-- Navbar Bottom -->
<nav class="navbar bg-dark navbar-expand fixed-bottom rounded-top-4 p-0" id="navbar-menu">
Expand Down Expand Up @@ -482,7 +483,7 @@ <h1 class="font-esthetic text-center mb-3" style="font-size: 3rem;">Ucapan & Doa
<div id="information" class="alert alert-info alert-dismissible fade show" role="alert">
<p style="font-size: 1.5rem;">Bestieee!!!</p>
<p class="m-0">Sekarang bisa format text seperti whatsapp lohh... cobainn sekaranggg, makaciwww bestieee</p>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="localStorage.setItem('alertClosed', 'true');"></button>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="util.close()"></button>
</div>
<textarea class="form-control shadow-sm" id="form-comment" rows="4" placeholder="Tulis Ucapan & Doa"></textarea>
</div>
Expand Down
7 changes: 6 additions & 1 deletion js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ export const theme = (() => {
}
};

const showButtonChangeTheme = () => {
document.getElementById('button-theme').style.display = 'block';
};

return {
change,
check,
isDarkMode
isDarkMode,
showButtonChangeTheme
};
})();
34 changes: 25 additions & 9 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,32 +184,48 @@ export const util = (() => {
zIndex: 1057
});

theme.check();
AOS.init();
audio.play();
document.querySelector('body').style.overflowY = 'scroll';
if (storage('information').get('info')) {
document.getElementById('information').remove();
}

if (localStorage.getItem('alertClosed')) {
document.getElementById('information').style.display = 'none';
const token = document.querySelector('body').getAttribute('data-key');
if (!token || token.length === 0) {
document.getElementById('ucapan').remove();
document.querySelector('a.nav-link[href="#ucapan"]').closest('li.nav-item').remove();
}

opacity('welcome', 0.025);
AOS.init();

countDownDate();
opacity('welcome', 0.025);

audio.play();
audio.showButton();
document.getElementById('button-theme').style.display = 'block';

const token = document.querySelector('body').getAttribute('data-key');
theme.check();
theme.showButtonChangeTheme();

if (!token || token.length === 0) {
return;
}

const status = await storeConfig(token);
if (status === 200) {
animation();
comment.comment();
await comment.comment();
}
};

const close = () => {
storage('information').set('info', true);
};

return {
open,
copy,
show,
close,
modal,
opacity,
animate,
Expand Down

0 comments on commit c05929a

Please sign in to comment.