Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated two major themes of your website #56

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
894d472
Create index.html
Harish-2003 Sep 26, 2024
612eb5d
Delete README.md
Harish-2003 Sep 26, 2024
5655509
Create styles.css
Harish-2003 Sep 26, 2024
0f96d7f
Create script.js
Harish-2003 Sep 26, 2024
0b584c2
Adds Symbol Accessibility
OrganicBeetle Sep 28, 2024
ad79b15
Update settings.json
OrganicBeetle Sep 29, 2024
863e093
Delete .vscode/settings.json
OrganicBeetle Sep 29, 2024
f5e621d
Update index.html
OrganicBeetle Sep 29, 2024
bd541d5
Merge pull request #20 from OrganicBeetle/gh-pages
Harish-2003 Sep 29, 2024
5f4c95b
Merge remote-tracking branch 'origin/gh-pages' into gh-pages
Bruhbytes Sep 30, 2024
2537cb9
Enhanced the UI
Bruhbytes Sep 30, 2024
66483ff
Merge pull request #29 from Bruhbytes/gh-pages
Harish-2003 Sep 30, 2024
2dede91
Added dropdown options for crypto currencies in the new UI
Tomkndn Sep 30, 2024
dec949a
Merge pull request #30 from Tomkndn/gh-pages
Harish-2003 Sep 30, 2024
357019f
Improved styles
J-B-Mugundh Oct 1, 2024
d5c37a4
Added media queries for mobile responsiveness
J-B-Mugundh Oct 1, 2024
6b53c2d
Improved the crypto predictor box stylings
J-B-Mugundh Oct 1, 2024
390b67a
Added mobile responsiveness to tagline and footer
J-B-Mugundh Oct 1, 2024
fd33bed
Merge pull request #33 from J-B-Mugundh/gh-pages
Harish-2003 Oct 1, 2024
6170d77
added telegram bot link to website
Oct 2, 2024
46b16dc
added more crypto currencies
Oct 2, 2024
089101c
Merge pull request #38 from IshuSinghSE/gh-pages
Harish-2003 Oct 2, 2024
0c1a3e9
changed the complete ui of the webpage and added a static airdrop sec…
Boobeshkumar56 Oct 2, 2024
4949921
Merge pull request #47 from Boobeshkumar56/gh-pages
Harish-2003 Oct 2, 2024
d31af87
Revert "changed the complete ui of the webpage and added a static air…
Harish-2003 Oct 2, 2024
4a0ae54
Merge pull request #49 from OpenTekHub/revert-47-gh-pages
Harish-2003 Oct 2, 2024
ef6479b
added telegram and github icon for more good apperance
Boobeshkumar56 Oct 3, 2024
23194a3
Merge pull request #54 from Boobeshkumar56/gh-pages
Harish-2003 Oct 3, 2024
70b84da
updated theme toggle with all new themes
STDYGIT Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5503
}
Binary file added Assets/moon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/sun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 0 additions & 60 deletions CODE_OF_CONDUCT.md

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

31 changes: 0 additions & 31 deletions README.md

This file was deleted.

56 changes: 56 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenTekHub Blockchain Repo</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fredoka:[email protected]&family=Gowun+Batang:wght@400;700&family=Mate+SC&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>

<body>
<header class="header">
<nav>
<h1>OpenTekHub Blockchain Repository</h1>
<div class="theme-switch" id="theme-switch"></div>
</nav>
</header>

<div class="central">
<p class="tagline">Explore the Blockchain implementation and predict the latest cryptocurrency prices.</p>

<section id="crypto-price-predictor">
<h2>Crypto Price Predictor</h2>
<div id="crypto-form">
<label for="crypto">Enter Cryptocurrency Symbol (e.g., BITCOIN(BTC), ETHERUM(ETH)):</label>
<input type="text" id="crypto" name="crypto">
<div id="crypto-suggestions"></div>
<button id="predict-btn">Predict Price</button>

</div>
<div id="price-result">
<h3>Predicted Price:</h3>
<p id="price"></p>
</div>
<div id="telegram-bot">

<p class="bot-text"> Track prices with our Telegram bot</p>
<h3><a href="https://t.me/trackingcryptopricerbot" class="bot-link"><img src="public/Telegram.png" alt="Telegram logo" id="Telegram">@TrackCryptoPriceBot</a></h3>
</div>
</section>
</div>

<section id="repo-info">

<h2>About the Repository</h2>
<p>This repository demonstrates blockchain prices using api and javascript.</p>
<a href="https://github.com/OpenTekHub/blockchain" target="_blank"><img src="public/github.png" alt="" id="git">BlockChain Repository</a>
</section>

<script src="script.js"></script>
</body>

</html>
Binary file added public/Telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
// 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
'BTC': 'bitcoin',
'ETH': 'ethereum',
'USDT': 'tether',
'BNB': 'binancecoin',
'USDC': 'usd-coin',
'XRP': 'ripple',
'DOGE': 'dogecoin',
'ADA': 'cardano',
'SOL': 'solana',
'DOT': 'polkadot',
'MATIC': 'matic-network',
'SHIB': 'shiba-inu',
'LTC': 'litecoin',
'TRX': 'tron',
'AVAX': 'avalanche-2',
'ATOM': 'cosmos',
'LINK': 'chainlink',
'XMR': 'monero',
'BCH': 'bitcoin-cash',
'ALGO': 'algorand',
'ICP': 'internet-computer',
'VET': 'vechain',
'FIL': 'filecoin',
'NEAR': 'near',
'HBAR': 'hedera-hashgraph',
'TON': 'toncoin',
'SUI':'sui',
'OP': 'optimism',
'INJ': 'injective',
'ARB': 'arbitrum',

// Stablecoins
'DAI': 'dai',
'BUSD': 'binance-usd',
'PAX': 'paxos-standard',

// DeFi tokens
'UNI': 'uniswap',
'AAVE': 'aave',
'SUSHI': 'sushi',
'COMP': 'compound-governance-token',
'YFI': 'yearn-finance',

// Layer 2 solutions and scaling
'LRC': 'loopring',
'ZRX': '0x',
'OMG': 'omisego',

// NFT and metaverse tokens
'MANA': 'decentraland',
'SAND': 'the-sandbox',
'ENJ': 'enjincoin',
'AXS': 'axie-infinity',
'GALA': 'gala',

// Privacy coins
'ZEC': 'zcash',
'DASH': 'dash',

// Other popular tokens
'FTM': 'fantom',
'GRT': 'the-graph',
'1INCH': '1inch',
'CHZ': 'chiliz',
'BAT': 'basic-attention-token',
'CRV': 'curve-dao-token',
'KSM': 'kusama',
'QTUM': 'qtum',
'ZIL': 'zilliqa',
'EGLD': 'elrond-erd-2',
'HOT': 'holotoken',
'THETA': 'theta-token',
'HNT': 'helium',
'SNX': 'synthetix-network-token',
'RUNE': 'thorchain',
'XLM': 'stellar',
'REN': 'ren',
'FTT': 'ftx-token',
'RVN': 'ravencoin',
'KAVA': 'kava',
'CRO': 'crypto-com-chain',
'MIOTA': 'iota',
'ETC': 'ethereum-classic',

// Meme coins
'BABYDOGE': 'baby-doge-coin',
'SAFEMOON': 'safemoon',
'ELON': 'dogelon-mars',
'PEPE': 'memetic',
'WIF': 'dogwithat',
'BONK': 'bonk',
'FLOKI': 'floki',

// Add more symbols and tokens as needed
'WETH': 'wrapped-ethereum',
'MKR': 'maker',
'BAL': 'balancer',
'WLD': 'worldcoin',
'OM': 'mantra-dao',
'PHB': 'phoenix',
'LISTA': 'lista',
'RENDER': 'render',
};

const cryptoInput = document.getElementById('crypto');
const suggestionsBox = document.getElementById('crypto-suggestions');

cryptoInput.addEventListener('input', function() {
const inputValue = cryptoInput.value.toUpperCase();
suggestionsBox.innerHTML = '';

const filteredCryptos = Object.keys(cryptoMap).filter(crypto => crypto.includes(inputValue));

if (inputValue && filteredCryptos.length > 0) {
suggestionsBox.style.display = 'block';
filteredCryptos.forEach(crypto => {
const suggestionItem = document.createElement('div');
suggestionItem.textContent = crypto;
suggestionItem.addEventListener('click', function() {
cryptoInput.value = crypto;
suggestionsBox.style.display = 'none';
});
suggestionsBox.appendChild(suggestionItem);
});
} else {
suggestionsBox.style.display = 'none';
}
});

document.addEventListener('click', function(event) {
if (!event.target.closest('#crypto-form')) {
suggestionsBox.style.display = 'none';
}
});

document.getElementById('predict-btn').addEventListener('click', function() {
const cryptoInputValue = cryptoInput.value.toUpperCase();
const crypto = cryptoMap[cryptoInputValue];

if (crypto) {
fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${crypto}&vs_currencies=usd`)
.then(response => response.json())
.then(data => {
if (data[crypto]) {
document.getElementById("price").innerText = "$" + data[crypto].usd;
} else {
document.getElementById("price").innerText = "Cryptocurrency not found!";
}
})
.catch(error => {
document.getElementById("price").innerText = "Error fetching price data.";
console.error("Error:", error);
});
} else {
document.getElementById("price").innerText = "Please enter a valid cryptocurrency symbol.";
}
});

Loading