Skip to content

Commit

Permalink
feat(index): add link al quran
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 14, 2024
1 parent 36ff911 commit 674089c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ <h2 class="font-esthetic py-2 m-0" style="font-size: 2rem;">Allah Subhanahu Wa T

<div class="bg-theme-dark mt-4 p-3 shadow rounded-4" data-aos="fade-up" data-aos-duration="2000">
<p class="p-1 mb-3" style="font-size: 0.95rem;">Dan segala sesuatu Kami ciptakan berpasang-pasangan agar kamu mengingat (kebesaran Allah).</p>
<p class="m-0 p-0 fw-bold">QS. Az-Zariyat: Ayat 49</p>
<a class="m-0 p-0 text-dark link-offset-2" target="_blank" href="https://quran.com/id/51/49">QS. Adh-Dhariyat: 49</a>
</div>

<div class="bg-theme-dark mt-4 p-3 shadow rounded-4" data-aos="fade-up" data-aos-duration="2000">
<p class="p-1 mb-3" style="font-size: 0.95rem;">dan sesungguhnya Dialah yang menciptakan pasangan laki-laki dan perempuan,</p>
<p class="m-0 p-0 fw-bold">QS. An-Najm: Ayat 45</p>
<a class="m-0 p-0 text-dark link-offset-2" target="_blank" href="https://quran.com/id/53/45">QS. An-Najm: 45</a>
</div>
</div>
</section>
Expand Down Expand Up @@ -432,7 +432,7 @@ <h2 class="font-esthetic text-center mt-2 mb-4" style="font-size: 2.5rem;">Ucapa

<div class="mb-3">
<div id="information" class="alert alert-info alert-dismissible fade show rounded-4" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="util.close()"></button>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="util.closeInformation()"></button>

<p style="font-size: 1.5rem;">Bestieee!!!</p>
<p class="m-0">Cobain like seperti Instagram, dengan tap tap bagian komentarnya</p>
Expand Down
7 changes: 3 additions & 4 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,14 @@ export const admin = (() => {
if (!session.isAdmin() || !session.getToken() || (JSON.parse(window.atob(session.getToken().split('.')[1]))?.exp ?? 0) < (Date.now() / 1000)) {
throw new Error('invalid token');
}

getUserDetail();
comment.comment();
} catch {
bootstrap.Modal.getOrCreateInstance('#loginModal').show();
session.logout();
user.clear();
return;
}

getUserDetail();
comment.comment();
};

return {
Expand Down
15 changes: 13 additions & 2 deletions js/audio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
export const audio = (() => {

/**
* @type {HTMLElement|null}
*/
let music = null;

/**
* @type {HTMLAudioElement|null}
*/
let audio = null;

let isPlay = false;

const statePlay = '<i class="fa-solid fa-circle-pause spin-button"></i>';
const statePause = '<i class="fa-solid fa-circle-play"></i>';

const init = () => {
music = document.getElementById('button-music');

Expand All @@ -25,7 +36,7 @@ export const audio = (() => {
try {
await audio.play();
isPlay = true;
music.innerHTML = '<i class="fa-solid fa-circle-pause spin-button"></i>';
music.innerHTML = statePlay;
} catch (err) {
isPlay = false;
alert(err);
Expand All @@ -36,7 +47,7 @@ export const audio = (() => {
const pause = () => {
isPlay = false;
audio.pause();
music.innerHTML = '<i class="fa-solid fa-circle-play"></i>';
music.innerHTML = statePause;
};

const showButton = () => {
Expand Down
2 changes: 1 addition & 1 deletion js/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const request = (method, path) => {

let url = document.body.getAttribute('data-url');
let req = {
method: method,
method: String(method).toUpperCase(),
headers: new Headers({
'Accept': 'application/json',
'Content-Type': 'application/json'
Expand Down
8 changes: 2 additions & 6 deletions js/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ export const session = (() => {
.then((res) => res.code === 200, () => false);
};

const logout = () => {
session.unset('token');
};
const logout = () => session.unset('token');

const isAdmin = () => {
return (getToken() ?? '.').split('.').length === 3;
};
const isAdmin = () => String(getToken() ?? '.').split('.').length === 3;

const guest = () => {
progress.add();
Expand Down
8 changes: 3 additions & 5 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const util = (() => {
};

const escapeHtml = (unsafe) => {
return unsafe
return String(unsafe)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
Expand Down Expand Up @@ -118,14 +118,11 @@ export const util = (() => {
return decoder.decode(decodedBytes);
};

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

return {
open,
copy,
close,
modal,
timeOut,
opacity,
Expand All @@ -134,6 +131,7 @@ export const util = (() => {
base64Encode,
base64Decode,
disableButton,
closeInformation,
addLoadingCheckbox,
};
})();

0 comments on commit 674089c

Please sign in to comment.