Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions Layout/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
@inject IJSRuntime JSRuntime

<div class="animated-bg">
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
<div class="bitcoin-bg-symbol bitcoin-symbol">₿</div>
</div>
<div class="particles" id="global-particles"></div>

Expand Down
6 changes: 3 additions & 3 deletions Layout/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">
<span class="brand-icon">₿</span>
<span class="brand-icon bitcoin-symbol">₿</span>
<span class="brand-text">ფული</span>
</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
Expand Down Expand Up @@ -168,10 +168,10 @@
@if (bitcoinPrice != null)
{
<div class="btc-ticker">
<div class="ticker-symbol">1</div>
<div class="ticker-symbol">1<span class="bitcoin-symbol">₿</span></div>
<div class="ticker-rates">
<div class="ticker-price">$@bitcoinPrice.PriceUsd.ToString("N0")</div>
<div class="ticker-price">@bitcoinPrice.PriceGel.ToString("N0")</div>
<div class="ticker-price"><span class="lari-symbol">₾</span>@bitcoinPrice.PriceGel.ToString("N0")</div>
</div>
</div>
}
Expand Down
67 changes: 61 additions & 6 deletions Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/"
@page "/{Currency}/{Amount:decimal?}"
@using InGeorgianLari.Models
@using InGeorgianLari.Services
@inject IExchangeRateService ExchangeRateService
Expand All @@ -10,7 +11,7 @@
<div class="container page-container mobile-safe">
<div class="converter-card">
<h1 class="title">
<span class="flag">₿</span>
<span class="flag bitcoin-symbol">₿</span>
ბიტკოინი ლარში
</h1>

Expand Down Expand Up @@ -49,9 +50,9 @@
<div class="currency-select">
<label for="currency">ვალუტა</label>
<select id="currency" @bind="selectedCurrency" @bind:event="onchange" @bind:after="OnCurrencyChanged">
<option value="USD">🇺🇸 USD - აშშ დოლარი</option>
<option value="EUR">🇪🇺 EUR - ევრო</option>
<option value="GBP">🇬🇧 GBP - ბრიტანული ფუნტი</option>
<option value="USD">USD - აშშ დოლარი</option>
<option value="EUR">EUR - ევრო</option>
<option value="GBP">GBP - ბრიტანული ფუნტი</option>
</select>
</div>
</div>
Expand All @@ -61,15 +62,15 @@
<div class="rate-display">
<div class="rate-card">
<span class="rate-label">მიმდინარე კურსი</span>
<span class="rate-value">1 @selectedCurrency = @currentRate.Rate.ToString("N4")</span>
<span class="rate-value">1 @selectedCurrency = <span class="lari-symbol">₾</span> @currentRate.Rate.ToString("N4")</span>
</div>
</div>
}

<div class="result-section">
<div class="equals">=</div>
<div class="result">
<span class="amount"> @(rates != null ? calculatedAmount.ToString("N2") : "0.00")</span>
<span class="amount"><span class="lari-symbol">₾</span> @(rates != null ? calculatedAmount.ToString("N2") : "0.00")</span>
<span class="currency-name">ქართული ლარი</span>
</div>
</div>
Expand All @@ -92,6 +93,9 @@
</div>

@code {
[Parameter] public string? Currency { get; set; }
[Parameter] public decimal? Amount { get; set; }

decimal amount = 100;
string selectedCurrency = "USD";
bool loading = false; // Start with loading false to avoid initial spinner
Expand All @@ -109,6 +113,23 @@

protected override async Task OnInitializedAsync()
{
// Handle URL parameters
if (!string.IsNullOrEmpty(Currency))
{
var upperCurrency = Currency.ToUpperInvariant();
// Check if it's a supported currency
if (upperCurrency == "USD" || upperCurrency == "EUR" || upperCurrency == "GBP")
{
selectedCurrency = upperCurrency;
}
}

// Set amount from URL parameter if provided
if (Amount.HasValue && Amount.Value > 0)
{
amount = Amount.Value;
}

await LoadRates();
initialLoad = false; // Set to false after first load
}
Expand Down Expand Up @@ -779,6 +800,40 @@
}
}

/* Currency symbol fixes for cross-platform compatibility */
.bitcoin-symbol {
font-family: 'Arial Unicode MS', 'Lucida Sans Unicode', 'DejaVu Sans', sans-serif;
/* Fallback for Bitcoin symbol */
}

.bitcoin-symbol:empty::before {
content: 'B';
font-weight: bold;
}

.lari-symbol {
font-family: 'Sylfaen', 'BPG Nino', 'Arial Unicode MS', 'Lucida Sans Unicode', sans-serif;
/* Georgian fonts first, then Unicode fallbacks */
}

.lari-symbol:empty::before {
content: 'GEL';
font-size: 0.8em;
}

/* Add currency indicators to select options */
select option[value="USD"]::before {
content: '$ ';
}

select option[value="EUR"]::before {
content: '€ ';
}

select option[value="GBP"]::before {
content: '£ ';
}

/* Mobile Responsiveness */
@@media (max-width: 768px) {
.container {
Expand Down
Binary file added screenshots/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions wwwroot/css/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
/* Dark mode theme for Georgian Lari Converter */

/* Better font support for currency symbols */
@font-face {
font-family: 'Currency Fallback';
src: local('Arial Unicode MS'),
local('Lucida Sans Unicode'),
local('DejaVu Sans'),
local('Segoe UI Symbol'),
local('Noto Sans Symbols'),
local('Symbola');
unicode-range: U+20A0-20CF, U+20BE, U+20BF; /* Currency symbols */
}

:root {
--background: #0A0A0A;
--card: #141414;
Expand Down Expand Up @@ -32,6 +45,50 @@ html, body {
overflow-x: hidden;
}

/* Currency symbol styling for better cross-platform support */
.bitcoin-symbol,
.lari-symbol,
[class*="currency"] {
font-family: 'Currency Fallback', 'Arial Unicode MS', 'Lucida Sans Unicode', 'DejaVu Sans', 'Segoe UI Symbol', sans-serif;
}

/* Specific fixes for Georgian Lari */
.lari-symbol {
font-family: 'Sylfaen', 'BPG Arial', 'BPG Nino', 'Currency Fallback', sans-serif;
}

/* Fallback text for unsupported symbols */
.bitcoin-symbol:empty::after {
content: 'BTC';
font-size: 0.8em;
font-weight: bold;
}

.lari-symbol:empty::after {
content: 'GEL';
font-size: 0.8em;
}

/* Fallbacks when symbols are not supported */
body.no-bitcoin-symbol .bitcoin-symbol::after {
content: 'BTC';
font-size: 0.8em;
font-weight: bold;
}

body.no-bitcoin-symbol .bitcoin-symbol {
font-size: 0;
}

body.no-lari-symbol .lari-symbol::after {
content: 'GEL';
font-size: 0.8em;
}

body.no-lari-symbol .lari-symbol {
font-size: 0;
}

h1:focus {
outline: none;
}
Expand Down
26 changes: 26 additions & 0 deletions wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ <h1 class="loading-title">ფული</h1>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script>
// Check for currency symbol support and add fallbacks
function checkCurrencySymbolSupport() {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
context.font = '16px Arial';

// Test Bitcoin symbol
const bitcoinWidth = context.measureText('\u20BF').width;
const bitcoinSupported = bitcoinWidth > context.measureText('').width;

// Test Georgian Lari symbol
const lariWidth = context.measureText('\u20BE').width;
const lariSupported = lariWidth > context.measureText('').width;

// Add classes to body for CSS fallbacks
if (!bitcoinSupported) {
document.body.classList.add('no-bitcoin-symbol');
}
if (!lariSupported) {
document.body.classList.add('no-lari-symbol');
}
}

// Run on page load
document.addEventListener('DOMContentLoaded', checkCurrencySymbolSupport);

let chartInstance = null;

window.createChart = (canvasId, labels, data, currency) => {
Expand Down