From d6722980ba4adcc68caa33cee75a290a0350d9f9 Mon Sep 17 00:00:00 2001 From: Harish Date: Fri, 4 Oct 2024 22:52:18 +0530 Subject: [PATCH] Revert "updated theme toggle with all new themes" --- .vscode/settings.json | 3 --- Assets/moon.png | Bin 971 -> 0 bytes Assets/sun.png | Bin 960 -> 0 bytes index.html | 7 ++---- script.js | 40 ------------------------------- styles.css | 53 +----------------------------------------- 6 files changed, 3 insertions(+), 100 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100644 Assets/moon.png delete mode 100644 Assets/sun.png diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 155422b..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "liveServer.settings.port": 5503 -} \ No newline at end of file diff --git a/Assets/moon.png b/Assets/moon.png deleted file mode 100644 index c39c90df6585f4765c541aa60625227ad2f0f363..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 971 zcmV;+12p`JP)dAD)S+;tk2S(LeMtMqh)FX_5-B4?BFPzM77Z(>Btto7 z80D1YkRg%L;dWEytd3o2|JWj;q#hYEBr;SOMw(NUGlWQ!I)y(S<^pZNLEswj6c_<6 z$&h59{!ZW?@O_55=70}h3`RG71s z5OY=aK%Yl5thy)&A=>AcJ)2>5pMp-0)Vfl3022WW`2x(Lpu-B)t`u7<^an7bq%Gu_ z5QdxxXodl}D)bXrNY3$<)K3LA!#H)5b9|hM+imX0gbW!07I}_A z?%11<8OBMchqG`uVMG1^o056fve{Pum9QbkovAEI`_IQnTMA|vr$_FA5L4(%(GUaN z%zFi2DYsHK!~l1+QYP`;)ipJ|zLuu=U`E6H2+S}}{Vt~!n$ZZ1FjMpw=q>UNY&-%J z%na@NV@0g$V>QG$*%f>h*jkj`*pCQ;Zpzd*-~n*N_3+lYE_H)D%V}{FlI?Dm_+l2P z?%zcaXcMrJnK_@w6 zCIx+U*XuIL!w3RsJnJ?YW?uvWG@g~|S>k$EbeWuJD2oN*bb2BPr17MaTw1U>kG;5d^hb*$YOE5fiT(0_xFyGbe`O;@7y>vUoLeL6)jv(kWY0zEWE);8kHxUGXx?UCe`zfm;%PEiD z=ROKequYH=q`bAgP=o|tX`M2df*E#$u`TUCA9F?DlTh!=_NI=ykEV%PSPq;G)VjBK zCXc(%2#PAsQ##!c+gOcLiuR;$kMe{+>f8kTVc@!}q6gfoXWZQ{9CefKPuv*NAz(uu t4wZxuLI@#*5JCtcgb+dqA%qa*fdB8wrD6mZ%@C4Wr83#(_h}XbBO*Y91cRd>KNQE3w4RC;Z*7B?bI6ysXc~)A<0sX)r z(4B$gLQg=U020VfGI=W=K&5-&rFyGe!KK`q)yh@^=UxOK=)CA14a$>Yd*Tl z30CM2Xn=_m)F$Y_LvPPuGvwEJNBXe9U`QpD%!HJ29#{arh*agbAZ88hs=6gkw~YCq ziu?gC#c1;~a2jIs7tnFrtOElc`ZuL)_dF9e*;=C)xCab* ze8sYSrN0K_*b(*avgqnPVMuJnImsr*Mc_jn4cA3&xGs=U%E0>u8t=$QkDibTUc}IN zN7Qi06a#gRd6PLoO`@4$BgV!%vX*8HZ(h2zBWmq_=yQ1K2wCc)%CXNrp-oPhi&`D$ z8;vox`9yEsa^P`@sU*;NN7QD?O(*avL}xQ<$o;WlrPQg;&18ZOn9yu38tSRML*2YH zELP?8BG zsNg-1NpK`V2i(?dDck!YIk7aPwr{H#3vf^(151(bQBz4i3!8!RDsj!}a z16IipSAnybx5C%R7|Ss_z%*gfRJ7&&IE(}{{IWGoxhWp7w)sa!!*FsmgkjwFET6(d-aYlp7 z;uEsTIp?F(p*6lK!s1II-B?9$e#^JD{5P%hHtq2c#Cmv(2VY^fot?B=4{#S(~xE i{mV>2K|w(QO~8Nje4RV4*+u;T0000
- +

OpenTekHub Blockchain Repository

Explore the Blockchain implementation and predict the latest cryptocurrency prices.

- +

Crypto Price Predictor

diff --git a/script.js b/script.js index 6cf345e..edd74c9 100644 --- a/script.js +++ b/script.js @@ -1,42 +1,3 @@ -// Dark Mode Toggle Functionality -const themeSwitch = document.getElementById('theme-switch'); // Ensure this matches your HTML button's ID -const body = document.body; -const header = document.querySelector('header'); -const footer = document.querySelector('footer'); - -// Function to enable dark mode -function enableDarkMode() { - body.classList.add('dark-mode'); - header.classList.add('dark-mode'); - themeSwitch.classList.add('dark-theme'); // Update the switch appearance - footer.classList.add('dark-mode'); -} - -// Function to disable dark mode -function disableDarkMode() { - body.classList.remove('dark-mode'); - header.classList.remove('dark-mode'); - themeSwitch.classList.remove('dark-theme'); // Update the switch appearance - footer.classList.remove('dark-mode'); -} - -// Event listener for dark mode toggle button -themeSwitch.addEventListener('click', () => { - if (body.classList.contains('dark-mode')) { - disableDarkMode(); // Switch to light mode - localStorage.removeItem('dark-mode'); // Remove from local storage - } else { - enableDarkMode(); // Switch to dark mode - localStorage.setItem('dark-mode', 'enabled'); // Save in local storage - } -}); - -// Optional: Check the initial mode on page load and apply the correct theme based on local storage -if (localStorage.getItem('dark-mode') === 'enabled') { - enableDarkMode(); -} else { - disableDarkMode(); // Default to light mode on load if localStorage is empty -} // A map of symbols to their corresponding API names const cryptoMap = { // Major cryptocurrencies @@ -197,4 +158,3 @@ document.getElementById('predict-btn').addEventListener('click', function() { document.getElementById("price").innerText = "Please enter a valid cryptocurrency symbol."; } }); - diff --git a/styles.css b/styles.css index 1a0af87..bb4eaf3 100644 --- a/styles.css +++ b/styles.css @@ -32,7 +32,7 @@ h1, h2, h3 { .header { text-align: center; - background: linear-gradient(135deg, rgb(36, 11, 54), rgb(195, 20, 50)); + background-color: #2E073F; color: #EBD3F8; padding: 1.2rem; font-family: "Mate SC", serif; @@ -251,55 +251,4 @@ h1, h2, h3 { .bot-text{ font-size: 1rem; margin-block: 0px; -} - - -/* Here are the styles for the theme toggel */ -/* Theme switcher */ -.theme-switch { - display: inline-block; - width: 60px; - height: 30px; - border-radius: 30px; - background: linear-gradient(116deg, #ffffff, #a00101); - position: relative; - cursor: pointer; - transition: background 0.3s ease-in-out; - vertical-align: middle; -} - -.theme-switch::before { - content: ''; - position: absolute; - top: 3px; - left: 3px; /* Initial position for light mode */ - width: 24px; - height: 24px; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - transition: left 0.3s ease-in-out, background-image 0.3s ease-in-out; - background-image: url('Assets/moon.png'); /* Icon for light mode */ -} - -.theme-switch.dark-theme { - background: linear-gradient(92deg, #ff0000, #ffffff); /* Background for dark mode */ -} - -.theme-switch.dark-theme::before { - left: 33px; /* Move the toggle to the right for dark mode */ - background-image: url('Assets/sun.png'); /* Icon for dark mode */ -} - -/* Other dark mode styles */ -.header.dark-mode { - background: linear-gradient(303deg, #000000, #500210); -} - -body.dark-mode{ - background: linear-gradient(303deg, #000000, #500210); - color: #ffecec; -} -p.tagline.dark-mode{ - color: #ffffff; } \ No newline at end of file