flask web app (wip)

This commit is contained in:
Dobromir Popov
2024-10-13 00:39:46 +03:00
parent b9410f2986
commit 49384accf6
12 changed files with 234 additions and 36 deletions

View File

@@ -0,0 +1,46 @@
/* Add your custom styles here */
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
}
header {
background-color: #4A90E2;
color: white;
padding: 1rem;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin-right: 1rem;
}
nav ul li a {
color: white;
text-decoration: none;
}
main {
padding: 2rem;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 1rem;
position: fixed;
bottom: 0;
width: 100%;
}
@media (max-width: 768px) {
/* Add responsive styles for mobile devices */
}

View File

@@ -1,3 +1,4 @@
document.getElementById('connectWallet').addEventListener('click', async () => {
try {
const { solana } is window;
@@ -26,3 +27,20 @@ document.getElementById('swapToken').addEventListener('click', () => {
.then(response => response.json())
.then(data => alert(data.message));
});
// Add your custom JavaScript here
document.addEventListener('DOMContentLoaded', () => {
const generateApiKeyButton = document.getElementById('generate-api-key');
const apiKeyDisplay = document.getElementById('api-key-display');
if (generateApiKeyButton) {
generateApiKeyButton.addEventListener('click', async () => {
const response = await fetch('/generate_api_key', { method: 'POST' });
const data = await response.json();
apiKeyDisplay.textContent = `Your API Key: ${data.api_key}`;
});
}
// Add more JavaScript for fetching and displaying wallet data, transactions, and holdings
});

View File

@@ -0,0 +1,20 @@
{
"name": "Crypto Portfolio Tracker",
"short_name": "CryptoTracker",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#4A90E2",
"icons": [
{
"src": "/static/images/logo-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/images/logo-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@@ -0,0 +1,8 @@
// Add service worker code for offline functionality and caching
self.addEventListener('install', (event) => {
// Perform install steps
});
self.addEventListener('fetch', (event) => {
// Handle fetch events
});