09e981f94b
- Added a new job to fetch crypto currency rates from an external source and store them in a JSON file. - Updated the CurrencyController to include methods for retrieving current crypto currency rates and rates by name. - Enhanced the API to return detailed metadata for crypto currency rates, including timestamps and update information. - Updated the API routes to support new endpoints for crypto currency rates. - Modified the merged rates JSON to include crypto currency data alongside existing currency and gold rates. - Improved the welcome view to display additional crypto currency information, enhancing user experience. These changes collectively expand the functionality of the Truncgil Finance application, providing users with comprehensive access to crypto currency data.
188 lines
8.1 KiB
PHP
188 lines
8.1 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<title>Truncgil Finance</title>
|
|
|
|
<!-- Tailwind CSS -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
|
|
<!-- Fonts -->
|
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
|
<style>
|
|
/* From Uiverse.io by iSweat-exe */
|
|
.card {
|
|
padding: 1rem;
|
|
background-color: #fff;
|
|
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
max-width: 100%;
|
|
border-radius: 20px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.title {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.title span {
|
|
position: relative;
|
|
padding: 0.5rem;
|
|
background-color: #B9101E;
|
|
width: 1.5rem;
|
|
height: 1.5rem;
|
|
border-radius: 9999px;
|
|
}
|
|
|
|
.title span svg {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
color: #ffffff;
|
|
height: 1rem;
|
|
}
|
|
|
|
.title-text {
|
|
margin-left: 0.5rem;
|
|
color: #374151;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.percent {
|
|
margin-left: 0.5rem;
|
|
color: #B9101E;
|
|
font-weight: 600;
|
|
display: flex;
|
|
}
|
|
|
|
.data {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
}
|
|
|
|
.data p {
|
|
margin-top: 1rem;
|
|
margin-bottom: 1rem;
|
|
color: #1F2937;
|
|
font-size: 2.25rem;
|
|
line-height: 2.5rem;
|
|
font-weight: 700;
|
|
text-align: left;
|
|
}
|
|
|
|
.data .range {
|
|
position: relative;
|
|
background-color: #E5E7EB;
|
|
width: 100%;
|
|
height: 0.5rem;
|
|
border-radius: 0.25rem;
|
|
}
|
|
|
|
.data .range .fill {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
background-color: #B9101E;
|
|
width: 36%;
|
|
height: 100%;
|
|
border-radius: 0.25rem;
|
|
transition: .5s all;
|
|
}
|
|
</style>
|
|
|
|
<!-- Styles / Scripts -->
|
|
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
|
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
@else
|
|
|
|
@endif
|
|
<link rel="manifest" href="{{ asset('manifest.json') }}">
|
|
</head>
|
|
<body class="font-sans antialiased dark:bg-black dark:text-white/50">
|
|
<div class="bg-gray-50 text-black/50 dark:bg-black dark:text-white/50">
|
|
<img id="background" class="absolute -left-20 top-0 max-w-[877px]" src="{{ asset('img/background.svg') }}" alt="Background" />
|
|
<div class="relative min-h-screen flex flex-col items-center justify-center selection:bg-[#FF2D20] selection:text-white">
|
|
<div class="relative w-full max-w-2xl px-6 lg:max-w-7xl">
|
|
<header class="grid grid-cols-2 items-center gap-2 py-10 lg:grid-cols-3">
|
|
<div class="flex lg:justify-center lg:col-start-2">
|
|
<img src="{{ asset('img/logo.svg') }}" alt="Truncgil Finance Logo" class="h-24 w-auto filter brightness-110" />
|
|
</div>
|
|
@if (Route::has('login'))
|
|
<nav class="-mx-3 flex flex-1 justify-end">
|
|
@auth
|
|
<a href="{{ url('/dashboard') }}" class="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white">Dashboard</a>
|
|
@else
|
|
<a href="{{ route('login') }}" class="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white">Log in</a>
|
|
@if (Route::has('register'))
|
|
<a href="{{ route('register') }}" class="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white">Register</a>
|
|
@endif
|
|
@endauth
|
|
</nav>
|
|
@endif
|
|
</header>
|
|
<main class="mt-6">
|
|
@php
|
|
$response = file_get_contents('https://finance.truncgil.com/api/today.json');
|
|
$data = json_decode($response, true);
|
|
$currencies = ['USD', 'EUR', 'GBP', 'GRA', 'BTC', 'ETH', 'XRP', 'LTC'];
|
|
$rates = [];
|
|
|
|
foreach ($currencies as $currency) {
|
|
$rates[$currency] = $data['Rates'][$currency] ?? null;
|
|
}
|
|
@endphp
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
@foreach($rates AS $currencyName => $rate)
|
|
<div class="w-full md:w-auto">
|
|
@include('currency', [
|
|
'currencyName' => $currencyName,
|
|
'rate' => $rate
|
|
])
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
|
|
|
|
</main>
|
|
|
|
<main class="mt-6">
|
|
<div class="grid gap-6 lg:grid-cols-3">
|
|
<a href="https://finance.truncgil.com/docs" class="group relative overflow-hidden rounded-2xl bg-gradient-to-b from-zinc-50 to-white p-6 shadow-lg transition-all duration-300 hover:shadow-xl dark:from-zinc-900 dark:to-zinc-800">
|
|
<div class="relative z-10">
|
|
<div class="mb-4 inline-flex rounded-lg bg-green-100 p-2 dark:bg-green-900/30">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-green-600 dark:text-green-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
</svg>
|
|
</div>
|
|
<h2 class="text-2xl font-bold text-zinc-900 dark:text-white">API Documentation</h2>
|
|
<p class="mt-3 text-zinc-600 dark:text-zinc-300">
|
|
Visit our documentation to access all information about the Truncgil Finance API.
|
|
</p>
|
|
<div class="mt-4 inline-flex items-center text-green-600 dark:text-green-400">
|
|
Learn more
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="ml-1 h-5 w-5 transition-transform group-hover:translate-x-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="absolute inset-0 z-0 bg-gradient-to-br from-green-50/50 via-transparent to-transparent opacity-0 transition-opacity group-hover:opacity-100 dark:from-green-900/20"></div>
|
|
</a>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="py-16 text-center text-sm text-black dark:text-white/70">
|
|
Truncgil Finance v5.0.3
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|