From af62bc942665000b4f4fd40b0c20b0dacc0904a0 Mon Sep 17 00:00:00 2001 From: Harry Min Khant <118270468+harrymkt@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:08:16 +0630 Subject: [PATCH] Contact page rebuilt --- contact/index.html | 18 ++++++++---------- scripts/functions.js | 32 +++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/contact/index.html b/contact/index.html index de6cec5..d438c67 100644 --- a/contact/index.html +++ b/contact/index.html @@ -15,16 +15,14 @@ -

Contact me

-

This is a list of available contact informations If you need to contact me.

- - - - - -
typevalue
Telegramharrymkt
Phone+959760485634
Emailharrymk64@gmail.com
- -

+

Contact

+

You can contact me with the following:

+

Telegram

+

This is the recommended option if you have it. Send me message at harrymkt.

+

Facebook Messenger

+

Although not much reliable as Telegram, you can still contact me on Messenger. Send me at harry.mk.64.

+

Email

+

Although email is unreliable, you can contact me at harrymk64@gmail.com.

diff --git a/scripts/functions.js b/scripts/functions.js index 925f097..9680ece 100644 --- a/scripts/functions.js +++ b/scripts/functions.js @@ -90,7 +90,7 @@ function createLinkListItem(href, text, target="_blank") { var listItem = document.createElement("li"); var link = document.createElement("a"); -link.target = target; +if(target!=="") link.target = target; link.href = href; link.textContent = text; listItem.appendChild(link); @@ -122,4 +122,34 @@ function get_storage(value, otherwise="undefined") var n=localStorage.getItem(value); if(n==="" || n==="undefined" || n===null) n=otherwise; return n; +} +function round(num, decimals) +{ +const factor = Math.pow(10, decimals); +return Math.round(num * factor) / factor; +} +function convert_size(size, round_to = 2) +{ +if (size < 1) return "0 B"; +if (size < 1024) +{ +return round(size, round_to) + " B"; +} +size = size / 1024; +if (size < 1024) +{ +return round(size, round_to) + " KB"; +} +size = size / 1024; +if (size < 1024) +{ +return round(size, round_to) + " MB"; +} +size = size / 1024; +if (size < 1024) +{ +return round(size, round_to) + " GB"; +} +size = size / 1024; +return round(size, round_to) + " TB"; } \ No newline at end of file