Skip to content

Commit

Permalink
feat: add new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
psincraian committed Nov 1, 2024
1 parent 715fcbf commit 34dc721
Show file tree
Hide file tree
Showing 26 changed files with 5,601 additions and 115 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run deploy
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
path: '.dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
.idea
node_modules
dist
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
);
124 changes: 11 additions & 113 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,115 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gas TUR Prices API Documentation</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 20px;
line-height: 1.6;
background-color: #f8f8f8;
}

header, section, footer {
background-color: #fff;
padding: 20px;
margin-bottom: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
color: #333;
}

p {
color: #555;
}

code {
background-color: #f4f4f4;
padding: 2px 5px;
border-radius: 3px;
font-family: 'Courier New', Courier, monospace;
}

pre {
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}

@media (min-width: 768px) {
body {
max-width: 80%;
margin: 20px auto;
}
}
</style>
</head>

<body>

<header>
<h1>Gas TUR Prices API</h1>
<p>Welcome to the Gas TUR Prices API for Spain! This API provides real-time Gas TUR prices in a convenient and
parseable format.</p>
</header>

<section>
<h2>Features</h2>
<ul>
<li><strong>Real-time Data:</strong> Access the latest Gas TUR prices.</li>
<li><strong>Easy to Integrate:</strong> Simple integration into your projects.</li>
<li><strong>Simple Data Format:</strong> Clear and easy-to-parse JSON format.</li>
</ul>
</section>

<section>
<h2>Usage</h2>
<p>To get started, make a GET request to the following endpoint:</p>
<pre><code>https://tur-prices.petru.tech/api/v1/prices.json</code></pre>
<p>Example Response:</p>
<pre><code>[
{
"rate_name": "TUR1",
"date": "2024-01",
"variable_price": "0.0511",
"fixed_price": "3.85",
"currency": "EUR"
},
{
"rate_name": "TUR2",
"date": "2024-01",
"variable_price": "0.0481",
"fixed_price": "7.12",
"currency": "EUR"
},
{
"rate_name": "TUR3",
"date": "2024-01",
"variable_price": "0.0454",
"fixed_price": "14.92",
"currency": "EUR"
}
]</code></pre>
</section>

<section>
<h2>Contribution</h2>
<p>We welcome contributions! Report bugs, suggest new features, or improve documentation by opening an <a
href="https://github.com/psincraian/tur-prices/issues">issue</a> or submitting a <a
href="https://github.com/psincraian/tur-prices/pulls">pull request</a>.</p>
</section>

<footer>
<p>Happy coding!</p>
</footer>

</body>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 34dc721

Please sign in to comment.