From eb54560f5e47e8cc8096fa790ad34177d8462ad4 Mon Sep 17 00:00:00 2001 From: AdityaPatel231003 Date: Mon, 11 Aug 2025 22:27:59 +0530 Subject: [PATCH 1/3] Adding style --- JS/TicTOE/style.css | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 JS/TicTOE/style.css diff --git a/JS/TicTOE/style.css b/JS/TicTOE/style.css new file mode 100644 index 0000000..cc4db9d --- /dev/null +++ b/JS/TicTOE/style.css @@ -0,0 +1,27 @@ +body{ + text-align: center; + background-color: rgb(33, 77, 111); + + +} + +.box{ + display: flex; + justify-content: center; + +} +.box .fone{ + height: 50px; + width: 50px; + border: 2px solid black; + margin: 0.3rem; +} + +.red{ + background-color: red; +} +.green{ + background-color: green; +} +.white{ + background-color: white; From be30a6be01f93faf964e87a0b7cf3eff04258a1c Mon Sep 17 00:00:00 2001 From: AdityaPatel231003 Date: Mon, 11 Aug 2025 22:30:36 +0530 Subject: [PATCH 2/3] Adding index and app --- JS/TicTOE/app.js | 152 +++++++++++++++++++++++++++++++++++++++++++ JS/TicTOE/index.html | 38 +++++++++++ JS/TicTOE/style.css | 1 + 3 files changed, 191 insertions(+) create mode 100644 JS/TicTOE/app.js create mode 100644 JS/TicTOE/index.html diff --git a/JS/TicTOE/app.js b/JS/TicTOE/app.js new file mode 100644 index 0000000..b849b8e --- /dev/null +++ b/JS/TicTOE/app.js @@ -0,0 +1,152 @@ +let startboolean=false; +let start=document.querySelector('#start'); +let p=document.querySelector('p'); + + +start.addEventListener('click',function () { + if (startboolean==false){ + console.log('start'); + startboolean=true; + userCall(); + + } + +}); + + + + + + +let array=[['one','two','three'],['four','five','six'],['seven','eight','nine']]; +function userCall() { + let users=document.querySelectorAll('.fone'); + for (const user of users) { + user.addEventListener('click' ,function () { + console.log(user); + let checkans=add(user); + + if(checkans=='red'){ + p.innerText="Red WIN"; + return; + + } + else if(checkans=='green'){ + p.innerText="GREEN WIN"; + return; + } + }); + } + + + +} + + // add(); + let set=0; + function add(user){ + let userid=user.id; + for(let i=0;i + + + + + Tic Toe + + + +

Welcome To TIC TOE

+

+ + +
+
+
1
+
4
+
7
+
+
+
2
+
5
+
8
+
+
+
3
+
6
+
9
+
+
+ + + + + + + + \ No newline at end of file diff --git a/JS/TicTOE/style.css b/JS/TicTOE/style.css index cc4db9d..d16b41f 100644 --- a/JS/TicTOE/style.css +++ b/JS/TicTOE/style.css @@ -25,3 +25,4 @@ body{ } .white{ background-color: white; +} \ No newline at end of file From d4b190d7d8953a36e5e69f14ea4874f26236e281 Mon Sep 17 00:00:00 2001 From: AdityaPatel231003 Date: Mon, 11 Aug 2025 22:41:08 +0530 Subject: [PATCH 3/3] Adding index.html and style.css --- JS/CurrencyConverter/app.js | 79 +++++++++++++++++++++++++++++++++ JS/CurrencyConverter/index.html | 27 +++++++++++ JS/CurrencyConverter/style.css | 11 +++++ 3 files changed, 117 insertions(+) create mode 100644 JS/CurrencyConverter/app.js create mode 100644 JS/CurrencyConverter/index.html create mode 100644 JS/CurrencyConverter/style.css diff --git a/JS/CurrencyConverter/app.js b/JS/CurrencyConverter/app.js new file mode 100644 index 0000000..15a4da2 --- /dev/null +++ b/JS/CurrencyConverter/app.js @@ -0,0 +1,79 @@ +// let url='https://api.frankfurter.app/latest?amount=1&from=USD&to=EUR'; +// let url='https://api.frankfurter.app/latest?amount='; + +// let url='https://api.exchangerate.host/convert?from=INR&to=PKR&amount=1'; +// let url='https://api.exchangerate.host/convert?'; + +// let url='https://currency-rate-exchange-api.onrender.com/inr'; +let url='https://currency-rate-exchange-api.onrender.com/'; + +// let url2='https://restcountries.com/v3.1/name/india?fullText=true'; +let url2='https://restcountries.com/v3.1/name/'; + + +let amt=document.querySelector('#amt'); +let fromc=document.querySelector('#fromc'); +let toc=document.querySelector('#toc'); + + + +let btn=document.querySelector('button'); +btn.addEventListener('click',async function(){ + let amount=amt.value; + let value1=fromc.value; + let value2=toc.value; + + let send1=value1+'?fullText=true'; + let send2=value2+'?fullText=true'; + + + + let from=await getConvert2(send1); + let to= await getConvert2(send2); + + // let queryString='from='+from+'&to='+to+'&amount='+amount; + let queryString=from; + let result=await getConvert(queryString,to); + let p=document.querySelector('p'); + p.innerHTML=`${amount}${from} of ${fromc.value} is equal to ${result} ${to} of ${toc.value}` + + + +}); + + +async function getConvert(add,to){ + try { + url='https://currency-rate-exchange-api.onrender.com/'; + add=add.toLowerCase(); + to=to.toLowerCase(); + let res= await axios.get(url+add); + let rate=res.data.rates[add.toLowerCase()]; + let resul=rate[to.toLowerCase()]; + console.log(resul); + return resul; + + } catch (error) { + console.log( "Error :",error); + } + +}; + +async function getConvert2(add){ + try { + url2='https://restcountries.com/v3.1/name/'; + let res= await axios.get(url2+add); + let currencies=res.data[0].currencies; + let currenciesCode=Object.keys(currencies); + console.log(currenciesCode[0]); + + return currenciesCode[0]; + } catch (error) { + console.log( "Error :",error); + + } + +}; + + + diff --git a/JS/CurrencyConverter/index.html b/JS/CurrencyConverter/index.html new file mode 100644 index 0000000..a4f2748 --- /dev/null +++ b/JS/CurrencyConverter/index.html @@ -0,0 +1,27 @@ + + + + + + Currency Converter + + + + + +

Currency Converter

+ + + + + + + +

+ + + + + + + \ No newline at end of file diff --git a/JS/CurrencyConverter/style.css b/JS/CurrencyConverter/style.css new file mode 100644 index 0000000..c4b9f9e --- /dev/null +++ b/JS/CurrencyConverter/style.css @@ -0,0 +1,11 @@ +body{ + text-align: center; + background-color: rgba(12, 12, 115, 0.705); +} +h1{ + text-decoration: overline; +} +button{ + color: red; + font-weight: 700; +} \ No newline at end of file