From e58f13d2a156a8a6938e5c0658d45acc85477b19 Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:26:12 +0530 Subject: [PATCH 1/8] Create delete.html --- Currency Converter/delete.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 Currency Converter/delete.html diff --git a/Currency Converter/delete.html b/Currency Converter/delete.html new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Currency Converter/delete.html @@ -0,0 +1 @@ + From 864e8433c17e8b8774292fb9cea42b697a6db854 Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:28:41 +0530 Subject: [PATCH 2/8] Add files via upload --- Currency Converter/index.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Currency Converter/index.html diff --git a/Currency Converter/index.html b/Currency Converter/index.html new file mode 100644 index 00000000..506c67ef --- /dev/null +++ b/Currency Converter/index.html @@ -0,0 +1,28 @@ + + + + + + Currency Converter + + + +
+
+

Currency Converter

+
+
+ + +
+
+ + +
+
+ +
+
+ + + \ No newline at end of file From b8dede6f9c89394977835e3fcfeb597b7efd57dc Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:29:41 +0530 Subject: [PATCH 3/8] Add files via upload --- Currency Converter/Style.css | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Currency Converter/Style.css diff --git a/Currency Converter/Style.css b/Currency Converter/Style.css new file mode 100644 index 00000000..f3b71c7f --- /dev/null +++ b/Currency Converter/Style.css @@ -0,0 +1,71 @@ +* +{ + margin: 0; + padding: 0; + box-sizing: border-box; +} +body{ + height: 100vh; + display: flex; + justify-content: center; + align-items: center; +} +.content { + width: 500px; + background-color: #dde1e7; + box-shadow: -3px -3px 7px #babecc, + 2px 2px 5px rgba(94,104,121); + border-radius: 5px; + padding: 50px 50px; +} +.container { + width: 400px; +} +h1 { + color: #4d6366; + margin-bottom: 0.4em; + text-align: center; +} +.container .box{ + width: 100%; + display: flex; +} +.box div { + width: 100%; +} +select { + width: 95%; + height: 40px; + font-size: 1em; + cursor: pointer; + outline: none; + background: #848885; + color: #fff; + margin: 0.2em 0; + padding: 0 1em; + border-radius: 10px; + border: none; +} +input { + width: 95%; + height: 40px; + font-size: 1em; + margin: 0.2em 0; + border-radius: 10px; + border: none; + background: #edeef7; + outline: none; + padding: 0 1em; +} + +.btn { + width: 98%; + height: 40px; + background: rgb(18, 46, 71); + color: #fff; + border-radius: 10px; + border: none; + cursor: pointer; + font-size: 1em; + margin: 0.5em 0; +} \ No newline at end of file From af76504164417b19542901abfcbd81f094200715 Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:30:27 +0530 Subject: [PATCH 4/8] Add files via upload --- Currency Converter/script.js | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Currency Converter/script.js diff --git a/Currency Converter/script.js b/Currency Converter/script.js new file mode 100644 index 00000000..2e804c87 --- /dev/null +++ b/Currency Converter/script.js @@ -0,0 +1,42 @@ +const select = document.querySelectorAll('.currency'); +const btn = document.getElementById('btn'); +const num = document.getElementById('num'); +const ans = document.getElementById('ans'); + +fetch("https://api.frankfurter.app/currencies") + .then((data) => data.json()) + .then((data) => { + display(data); + }); + +function display(data) { + const entries = Object.entries(data); + for(var i = 0; i < entries.length; i++) { + select[0].innerHTML += ``; + select[1].innerHTML += ``; + } +} +btn.addEventListener('click', () => { + let currency1 = select[0].value; + let currency2 = select[1].value; + let value = num.value; + + if(currency1 != currency2) { + convert(currency1, currency2, value); + } + else { + alert('Choose Different Currency'); + } +}); + +function convert (currency1, currency2, value) { + const host = 'api.frankfurter.app'; + fetch( + `https://${host}/latest?amount=${value}&from=${currency1}&to=${currency2}` + ) + .then((val) => val.json()) + .then((val) => { + console.log(Object.values(val.rates)[0]); + ans.value = Object.values(val.rates)[0]; + }); +} \ No newline at end of file From 2d093181ef85d7fb87661a5ac0448e2eb4fa91bf Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:30:47 +0530 Subject: [PATCH 5/8] Delete delete.html --- Currency Converter/delete.html | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Currency Converter/delete.html diff --git a/Currency Converter/delete.html b/Currency Converter/delete.html deleted file mode 100644 index 8b137891..00000000 --- a/Currency Converter/delete.html +++ /dev/null @@ -1 +0,0 @@ - From cc65e73017d5a16c18dac51ef641870e4681904d Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:31:21 +0530 Subject: [PATCH 6/8] Update index.html --- Currency Converter/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Currency Converter/index.html b/Currency Converter/index.html index 506c67ef..9dda8e1c 100644 --- a/Currency Converter/index.html +++ b/Currency Converter/index.html @@ -4,7 +4,7 @@ Currency Converter - +
@@ -24,5 +24,5 @@

Currency Converter

- - \ No newline at end of file + + From f73596907177e9415b6736af2649dace35c4d2f5 Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:33:39 +0530 Subject: [PATCH 7/8] Add files via upload --- Currency Converter/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Currency Converter/README.md diff --git a/Currency Converter/README.md b/Currency Converter/README.md new file mode 100644 index 00000000..88e82e8f --- /dev/null +++ b/Currency Converter/README.md @@ -0,0 +1,13 @@ +

Currency Converter

+ +

Tech Stack

+ + +

Explanation:

+

I've used Frankfurter Api for this project. User can convert any currencies.

+ +

Demo:

\ No newline at end of file From 2e5d165b221969183924cf2e4220cd2aaa1ddf10 Mon Sep 17 00:00:00 2001 From: Sulagna Dutta Roy <72568715+Sulagna-Dutta-Roy@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:34:23 +0530 Subject: [PATCH 8/8] Update README.md --- Currency Converter/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Currency Converter/README.md b/Currency Converter/README.md index 88e82e8f..a214686f 100644 --- a/Currency Converter/README.md +++ b/Currency Converter/README.md @@ -10,4 +10,6 @@

Explanation:

I've used Frankfurter Api for this project. User can convert any currencies.

-

Demo:

\ No newline at end of file +

Demo:

+ +![Currency-converter](https://user-images.githubusercontent.com/72568715/196792687-aa1f9391-cb0d-4b08-a9bc-11d904f63532.PNG)