Compare commits

...

16 Commits

Author SHA1 Message Date
Kumi
58c376da3c
Revert "chore: optimize CSS imports and PurgeCSS config"
This reverts commit 035da04bf8.
2024-09-04 08:10:41 +02:00
Kumi
2de9892040
Revert "feat(build): optimize output with minification and compression"
This reverts commit 83a23fc66e.
2024-09-04 08:10:17 +02:00
Kumi
83a23fc66e
feat(build): optimize output with minification and compression
Switched to 'production' mode in webpack to enable optimizations. Integrated 'css-minimizer-webpack-plugin' and 'terser-webpack-plugin' for CSS and JS minification, respectively. Updated 'mini-css-extract-plugin' and added various dev dependencies to support new build processes. Adjusted output filenames and resolved dependencies to latest versions.

These changes reduce the bundle size and improve load times, enhancing overall performance.
2024-09-04 08:07:58 +02:00
Kumi
035da04bf8
chore: optimize CSS imports and PurgeCSS config
Switched to non-minified Bootstrap CSS for improved readability during development. Updated Webpack MiniCssExtractPlugin filename pattern to handle multiple CSS outputs more gracefully. Enhanced PurgeCSSPlugin configuration by incorporating JS paths and limiting removal to specific Bootstrap classes to avoid issues with dynamic class usage.
2024-09-04 08:03:45 +02:00
Kumi
ab4e1ad044
Merge remote-tracking branch 'upstream/main' 2024-08-30 10:23:27 +02:00
Kumi
7a8b1f21cf
refactor: move HTML to template file
Separated HTML content from index.php into templates/index.php for improved organization and maintainability. This change helps to keep business logic and presentation code separate, making the codebase easier to navigate and modify.
2024-08-30 10:14:56 +02:00
Kumi
aa9cdf8a8a
feat(ui): add custom behavior to fiat buttons
Enhanced the fiat currency buttons to include event listeners. When a button is clicked, it now updates the select box value and triggers the appropriate conversion function (XMR to Fiat or Fiat to XMR). The browser's address bar is also updated to reflect the selected currency. This improves the user experience by making currency selection more intuitive and dynamic.
2024-08-30 09:38:34 +02:00
Kumi
0f891ba6ea
refactor: streamline language file loading
Simplified the logic for loading language files by consolidating into a single loop. Now, the base English file and potential browser language files are loaded in sequence, ensuring a more efficient and clearer process. Removed redundant checks and code for language alias handling.
2024-08-30 09:18:56 +02:00
Kumi
38586826e2
feat(language): improve language detection and file loading
Simplify and enhance language detection and file loading mechanism:
- Parse primary language from browser settings more accurately.
- Remove redundant scanning of language files.
- Load default English language file as a base.
- Add support for region-specific language files if available.
- Remove unused language strings from various translation files.

These changes enhance the robustness and efficiency of language handling, ensuring better support for user language preferences.
2024-08-30 09:16:07 +02:00
Kumi
25f6bb423e
feat: improve language recognition and alias handling
Updated browser language detection to handle full locale strings and
mapped various Chinese variants to simplified or traditional Chinese.
Renamed language files for consistency with the new alias system.

This improves support for a wider array of language settings, ensuring
users receive content in their preferred language variant when possible.
2024-08-30 08:28:20 +02:00
Luke
289da3d30b
Add files via upload 2024-08-29 15:12:58 +02:00
Luke
1a3832a343
rtl support 2024-08-29 12:59:38 +02:00
Kumi
d18fcd803c
fix(config): update default GitHub URL to new repository
Updated the default GitHub URL in the configuration to point to the new repository at git.private.coffee. Ensures users are directed to the correct project location for up-to-date resources and issue tracking.
2024-08-28 15:21:36 +02:00
Kumi
90f6f6ce3e
feat: auto-generate coingecko.json on first run
Added logic to check for the existence of 'coingecko.json' and generate it by executing 'coingecko.php' if it doesn't exist. This ensures that the necessary data file is available on first run, preventing potential errors or missing data.
2024-08-28 15:20:33 +02:00
Kumi
57a7bca599
docs: update currency conversion URLs
Updated the currency conversion URLs to the new `monerooo.private.coffee` site. This change ensures users are directed to the current and actively maintained service. Updated examples maintain consistency and improve user experience.
2024-08-28 15:09:49 +02:00
Kumi
fa78a41944
docs: extensively update and reorganize README
Expanded README with detailed sections including usage, features, installation, configuration, and contribution guidelines. Enhanced documentation provides clarity on converting XMR to/from fiat, office application integrations, and new project enhancements. This makes the project more accessible for users and contributors.
2024-08-28 12:31:41 +02:00
11 changed files with 389 additions and 245 deletions

156
README.md
View File

@ -1,25 +1,153 @@
![Favicon - moner.ooo](/img/apple-touch-icon-152x152.png)
# Moner.ooo
Add a new language or an improvement via '[Pull request](https://github.com/nice42q/moner.ooo/pulls)' or report a Bug via '[Issues](https://github.com/nice42q/moner.ooo/issues)'.
The language is selected according to the Web-Browser language set; if the language is not available, English is displayed by default.
Moner.ooo is a web application for converting Monero (XMR) to various fiat currencies and vice versa. It provides almost real-time exchange rates and supports multiple languages based on the user's browser settings.
###### Display your favorite currency directly
[moner.ooo/?in=usd](https://moner.ooo/?in=usd)
This is a fork of the original project by [nice42q](https://github.com/nice42q/moner.ooo) with some modifications, including:
###### Use XMR (Monero) prices data for Office (Excel, Calc)
Select field A1 and go to DataLink to external data... → input the URL (https://moner.ooo/) and confirm with Enter. Confirm the import options and then select HTML_1.
- Improved webpack configuration.
- Support for JS-less operation.
- Improved translations and translation handling.
- Automatic exchange rate updates.
- Automatic update of available currencies.
- Configuration file for customizing the application.
3600 seconds = 1 hour
## Table of Contents
(Example with Picture [kuno.anne.media](https://kuno.anne.media/donate/onml/))
- [Features](#features)
- [Usage](#usage)
- [Installation](#installation)
- [Configuration](#configuration)
- [Development](#development)
- [Contributing](#contributing)
- [Acknowledgements](#acknowledgements)
###### Webserver sponsored by
[![Servers Guru](/img/servers-guru.svg)](https://servers.guru/)
## Features
###### Domain (9 Years) sponsored by
[kuno.anne.media](https://kuno.anne.media/donate/onml/)
- Conversion between Monero (XMR) and multiple fiat currencies.
- Multi-language support.
- User-friendly interface.
- Fetches currencies and exchange rates from CoinGecko API.
- Fully functional without JavaScript. Even better with JavaScript enabled.
- Customizable configuration.
Thanks for the support.
## Usage
The Website uses Bootstrap.
### Convert XMR to Fiat
To convert XMR to a fiat currency, simply visit:
```
https://monerooo.private.coffee/?in=USD
```
Replace `USD` with your preferred currency code. You can also specify the amount of XMR to convert:
```
https://monerooo.private.coffee/?in=USD&xmr=1
```
The `xmr` parameter specifies the amount of XMR to convert.
### Convert Fiat to XMR
To convert a fiat currency to XMR, visit:
```
https://monerooo.private.coffee/?in=USD&fiat=1&direction=1
```
The `fiat` parameter specifies the amount of fiat currency to convert. The `direction` parameter is set to `1` to indicate conversion from fiat to XMR.
### Use XMR Prices Data in Office Applications
1. Select field A1.
2. Go to `Data``Link to external data...`.
3. Input the URL `https://moner.ooo/` and confirm.
4. Confirm the import options and select `HTML_1`.
For an example, see [kuno.anne.media](https://kuno.anne.media/donate/onml/).
## Installation
### Prerequisites
- PHP
- Node.js and npm
- PHP-enabled web server (e.g. Caddy, Nginx, Apache)
### Steps
1. Clone the repository:
```sh
git clone https://github.com/nice42q/moner.ooo.git
cd moner.ooo
```
2. Install JavaScript dependencies:
```sh
npm install
```
3. Build the project:
```sh
npm run build
```
4. Point your web server to the repository directory.
## Configuration
Create a `config.php` file in the root directory to customize the application. Example:
```php
<?php
return [
'servers_guru' => false,
'attribution' => 'Powered by Moner.ooo',
'preferred_currencies' => ['USD', 'EUR', 'GBP'],
'github_url' => 'https://git.private.coffee/kumi/moner.ooo/',
'footer_links' => [
['url' => 'https://example.com', 'text' => 'Example Link']
],
];
```
### Fetching Exchange Rates
Exchange rates are fetched from the CoinGecko API. The `coingecko.php` file handles the API requests and attempts to update exchange rates every 5 seconds. Due to the rate limits of the CoinGecko API, actual update intervals may vary and are closer to 60 seconds.
## Contributing
We welcome contributions! Heres how you can help:
1. Fork the repository.
2. Create a new branch for your feature or bugfix:
```sh
git checkout -b my-feature-branch
```
3. Make your changes.
4. Commit your changes:
```sh
git commit -m "Description of my changes"
```
5. Push to the branch:
```sh
git push origin my-feature-branch
```
6. Create a pull request.
## Acknowledgements
- [Bootstrap](https://getbootstrap.com/)
- [CoinGecko API](https://www.coingecko.com/en/api)

212
index.php
View File

@ -9,6 +9,12 @@ $currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$parentUrl = dirname($currentUrl);
// Get currency data from JSON
if (!file_exists('coingecko.json')) {
// Special case: First run.
exec('php coingecko.php');
sleep(1);
}
$api_cg = json_decode(file_get_contents('coingecko.json'), true);
// Configuration file
@ -20,7 +26,7 @@ if (file_exists('config.php')) {
$display_servers_guru = isset($config['servers_guru']) && $config['servers_guru'] === true;
$attribution = isset($config['attribution']) ? $config['attribution'] : '';
$preferred_currencies = isset($config['preferred_currencies']) ? $config['preferred_currencies'] : [];
$github_url = isset($config['github_url']) ? $config['github_url'] : 'https://github.com/rottenwheel/moner.ooo/';
$github_url = isset($config['github_url']) ? $config['github_url'] : 'https://git.private.coffee/kumi/moner.ooo/';
// Extract the keys
$currencies = array_map('strtoupper', array_keys($api_cg));
@ -36,24 +42,40 @@ foreach ($currencies as $currency) {
$exchangeRates[$currency] = $api_cg[strtolower($currency)]['lastValue'];
}
// Get the browser language
$lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : "en";
if ($lang == 'zh' || $lang == 'pt') {
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);
}
// Scan the lang/ directory for available language files
$langFiles = glob('lang/*.php');
$acceptLang = [];
foreach ($langFiles as $file) {
$langCode = basename($file, '.php');
$acceptLang[] = strtolower($langCode);
}
// Check if the browser language is available, otherwise use English
$lang = in_array($lang, $acceptLang) ? $lang : 'en';
// Get the primary language from the browser
$lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "en";
$lang = explode(",", $lang)[0];
$lang = explode(";", $lang)[0];
$lang = strtolower($lang);
require_once "lang/{$lang}.php";
// Aliases for different Chinese variants
$aliases = [
'zh' => 'zh-hans',
'zh-hk' => 'zh-hant',
'zh-tw' => 'zh-hant',
'zh-cn' => 'zh-hans',
'zh-sg' => 'zh-hans',
'zh-mo' => 'zh-hant',
];
if (isset($aliases[$lang])) {
$lang = $aliases[$lang];
}
// Load the language files
// Take English as a base, then overwrite with the browser language
// E.g.: First load en.php, then de.php, then de-at.php
$language_code = explode('-', $lang)[0];
$language_files = ["en", $language_code, $lang];
foreach ($language_files as $language_file) {
if (file_exists('lang/' . $language_file . '.php')) {
require_once 'lang/' . $language_file . '.php';
}
}
// Calculation through GET parameters
$xmr_in = isset($_GET["in"]) ? strtoupper(htmlspecialchars($_GET["in"])) : 'EUR';
$xmr_amount = isset($_GET["xmr"]) ? floatval($_GET["xmr"]) : 1;
@ -81,155 +103,7 @@ foreach (array_reverse($preferred_currencies) as $currency) {
array_unshift($currencies, $currency);
}
}
// Output the HTML
require 'templates/index.php';
?>
<!DOCTYPE html>
<html lang="<?php echo $lang_meta; ?>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<title lang="<?php echo $lang_meta; ?>"><?php echo $page_title; ?></title>
<meta name="description" lang="<?php echo $lang_meta; ?>" content="<?php echo $meta_description; ?>" />
<meta name="keywords" lang="<?php echo $lang_meta; ?>" content="<?php echo $meta_keywords; ?>" />
<meta property="og:title" content="<?php echo $page_title; ?>" />
<meta property="og:description" content="<?php echo $meta_description; ?>" />
<meta property="og:image" content="<?php echo $parentUrl; ?>/img/mstile-310x150.png" />
<meta property="og:type" content="website" />
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="img/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="img/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="img/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="img/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="img/apple-touch-icon-152x152.png" />
<link rel="apple-touch-startup-image" href="img/favicon-196x196.png" />
<link rel="icon" type="image/png" href="img/favicon-196x196.png" sizes="196x196" />
<link rel="icon" type="image/png" href="img/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="img/favicon-128.png" sizes="128x128" />
<meta name="application-name" content="Moner.ooo" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-TileImage" content="img/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="img/mstile-70x70.png" />
<meta name="msapplication-square150x150logo" content="img/mstile-150x150.png" />
<meta name="msapplication-wide310x150logo" content="img/mstile-310x150.png" />
<meta name="msapplication-square310x310logo" content="img/mstile-310x310.png" />
<meta name="theme-color" content="#193e4c" />
<meta name="apple-mobile-web-app-title" content="Moner.ooo" />
<meta name="apple-mobile-web-app-status-bar-style" content="#193e4c" />
<link href="css/main.css" rel="stylesheet" />
</head>
<body>
<div class="container pt-4">
<div class="row">
<div class="col-12">
<div class="cursor-default text-center text-white">
<h1 lang="<?php echo $lang_meta; ?>"><span style="color:#4d4d4d;">&darr;</span>&nbsp;<span style="color:#ff6600;" title="Monero">XMR</span>&nbsp;<?php echo $title_h1; ?>&nbsp;<span style="color:#4d4d4d;">&darr;</span></h1>
<div class="fiat-btns table-responsive">
<table class="table table-sm table-borderless">
<tbody>
<?php
$chunks = array_chunk($currencies, 10);
foreach ($chunks as $chunk) {
echo "<tr>";
foreach ($chunk as $currency) {
$currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency;
echo "<td><a href=\"/?in={$currency}\" class=\"btn btn-light\" title=\"{$currencyName}\" data-toggle=\"tooltip\" data-bs-html=\"true\" data-placement=\"top\">{$currency}</a></td>";
}
echo "</tr>";
echo "<tr style=\"display:none;\">";
foreach ($chunk as $currency) {
echo "<td>" . str_replace(".", ",", $exchangeRates[$currency]) . "</td>";
}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<hr class="gold" />
<form method="get" action="">
<div class="input-group mb-3">
<button id="copyXMRBtn" class="btn-outline-secondary input-group-text clipboard-copy" title="<?php echo $clipboard_copy_tooltip; ?>" data-toggle="tooltip" data-bs-html="true" data-placement="top">&#128203;</button>
<input class="form-control" id="xmrInput" name="xmr" type="text" spellcheck="false" autocorrect="off" inputmode="numeric" aria-label="<?php echo $l_xmrInput; ?>" aria-describedby="basic-addon-xmr" value="<?php echo $xmr_value; ?>">
<input class="input-group-text" id="basic-addon-xmr" type="text" value="XMR" aria-label="Monero" disabled>
</div>
<div class="equals-box mb-3">
<button id="convertXMRToFiat" type="submit" name="direction" value="0" class="btn btn-arrow">
<span class="equals-text">&darr;</span>
</button>
<button type="button" class="btn btn-equals">
<span class="equals-text cursor-default">=</span>
</button>
<button id="convertFiatToXMR" type="submit" name="direction" value="1" class="btn btn-arrow">
<span class="equals-text">&uarr;</span>
</button>
</div>
<div class="fiatDiv input-group mb-3">
<button id="copyFiatBtn" class="btn-outline-secondary input-group-text clipboard-copy" title="<?php echo $clipboard_copy_tooltip; ?>" data-toggle="tooltip" data-bs-html="true" data-placement="top">&#128203;</button>
<input class="form-control" id="fiatInput" name="fiat" type="text" spellcheck="false" autocorrect="off" inputmode="numeric" aria-label="<?php echo $l_fiatInput; ?>" value="<?php echo $fiat_value; ?>">
<select class="input-group-text cursor-pointer" id="selectBox" name="in" aria-label="<?php echo $l_fiatSelect; ?>">
<?php
foreach ($currencies as $currency) {
$selected = $currency == $xmr_in ? 'selected' : '';
$currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency;
echo "<option {$selected} value=\"{$currency}\">{$currencyName}</option>";
}
?>
</select>
</div>
</form>
<noscript>
<div class="alert alert-warning" role="alert">
Looks like you have JavaScript disabled. You can still use this tool, but you won't be able to use the &#128203; buttons to automatically copy the results to your clipboard.<br />
Use the &darr; button to convert XMR to fiat, or the &uarr; button to convert fiat to XMR.
</div>
</noscript>
<hr class="gold" />
<small class="cursor-default text-white text-info" lang="<?php echo $lang_meta; ?>">
<?php echo $info;
if ($display_servers_guru) {
echo $servers_guru;
};
echo $attribution; ?>
</small>
<hr />
<?php
$footer_links = "";
if (isset($config['footer_links']) && !empty($config['footer_links'])) {
foreach ($config['footer_links'] as $link) {
$footer_links .= '<a href="' . $link['url'] . '" class="text-white" target="_blank" rel="noopener noreferrer">' . $link['text'] . '</a> | ';
}
}
?>
<small class="cursor-default text-white" lang="<?php echo $lang_meta; ?>">
<?php echo $footer_links . $getmonero . $countrymonero; ?>
</small>
</div>
</div>
</div>
<script src="js/main.js"></script>
</body>
</html>

View File

@ -1,4 +1,3 @@
```php
<?php
// For the HTML meta specification, e.g. <!DOCTYPE html><html lang="en">
$lang_meta = "cs"; // https://www.w3schools.com/tags/ref_language_codes.asp
@ -17,10 +16,6 @@ $servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='te
$clipboard_copy_tooltip = "Kopírovat do schránky";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
// Tooltip Titel
$l_eur = "Euro";
$l_btc = "Bitcoin";
@ -88,4 +83,3 @@ $getmonero = '<a class="text-white" href="https://www.getmonero.org/" hreflang="
$countrymonero = ' | <a class="text-white" href="https://t.me/monero" hreflang="en" target="_blank" rel="external">Telegram - Monero XMR</a>';
?>
```

View File

@ -2,23 +2,24 @@
// For the HTML meta specification, e.g. <!DOCTYPE html><html lang="en">
$lang_meta = "el"; // https://www.w3schools.com/tags/ref_language_codes.asp
$page_title = "Μετατροπή XMR σε EUR/BTC/CHF/USD και πολλά άλλα"; // The browser tab title or search engine title
$meta_description = "Η ζωντανή συναλλαγματική ισοτιμία του Monero σε πολλά διαφορετικά νομίσματα, δωρεάν για όλους."; // Search engine description / text
$meta_keywords = "Monero, XMR, fiat, αξία, ισοτιμία, ζωντανή, μετατροπή"; // Search engine keywords
$page_title = "XMR μετατροπή σε EUR/BTC/CHF/USD και πολλά άλλα"; // The browser tab title or search engine title
$meta_description = "Η ζωντανή ισοτιμία του Monero σε πολλά διαφορετικά νομίσματα, δωρεάν για όλους."; // Search engine description / text
$meta_keywords = "Monero, XMR, fiat, αξία, ισοτιμία, ζωντανά, ανταλλαγή, μετατροπή"; // Search engine keywords
$title_h1 = "μετατροπή σε"; // ↓ XMR [...] ↓
$moneroooTable = "Service provided by <a href='https://moner.ooo/'>Moner.ooo</a>, Data provided by <a href='https://www.coingecko.com/en/coins/monero' hreflang='en' rel='external'>CoinGecko</a>";
$moneroooTable = "Υπηρεσία παρέχεται από <a href='https://moner.ooo/'>Moner.ooo</a>, Δεδομένα παρέχονται από <a href='https://www.coingecko.com/el/coins/monero' hreflang='el' rel='external'>CoinGecko</a>";
// Info Text
$info = "Οι ισοτιμίες σε αυτή την ιστοσελίδα είναι μόνο για ενημερωτικούς σκοπούς. Δεν είναι εγγυημένο ότι είναι ακριβείς και υπόκεινται σε αλλαγές χωρίς προειδοποίηση. Οι ισοτιμίες ενημερώνονται κάθε 5 δευτερόλεπτα. Τελευταία ενημέρωση στις <u title='Ώρες:Λεπτά:Δευτερόλεπτα (ώ:λλ:δδ)'>".$time."</u> ώρα, Ευρώπη/Βερολίνο. Δεδομένα παρέχονται από <a class='text-white' href='https://www.coingecko.com/el/coins/monero' hreflang='el' rel='external' target='_blank'>CoinGecko</a>.<br/><a target='_blank' href='https://kuno.anne.media/donate/onml/' rel='external' hreflang='en'><img loading='lazy' src='./img/kuno-monero-26x26.png' width='17' height='17' alt='Kuno - Σελίδα δωρεών Moner.ooo'></a>&nbsp;<a target='_blank' href='https://kuno.anne.media/' class='text-white' rel='external' hreflang='en'>Kuno Συγκέντρωση κεφαλαίων με Monero</a> | <a class='text-white' href='https://github.com/nice42q/moner.ooo' hreflang='en' rel='external' target='_blank'>GitHub</a> | <a style='text-decoration:none; font-weight:bold;' class='text-white' href='https://servers.guru/' hreflang='en' rel='external' target='_blank'>Φιλοξενία ιστότοπου παρέχεται από<img loading='lazy' src='./img/servers-guru.svg' height='19' alt='Servers Guru' title='Servers Guru' /></a>";
$info = "Οι συναλλαγματικές ισοτιμίες σε αυτόν τον ιστότοπο είναι μόνο για ενημερωτικούς σκοπούς. Δεν εγγυώνται την ακρίβεια τους και υπόκεινται σε αλλαγές χωρίς προειδοποίηση. Οι συναλλαγματικές ισοτιμίες ενημερώνονται περίπου μία φορά το λεπτό. Τελευταία ενημέρωση στις <u title='Ώρες:Λεπτά:Δευτερόλεπτα (hh:mm:ss)'>".$time."</u>, Europe/Berlin. Δεδομένα παρέχονται από <a class='text-white' href='https://www.coingecko.com/el/coins/monero' hreflang='el' rel='external' target='_blank'>CoinGecko</a>.<br/><a target='_blank' href='https://kuno.anne.media/donate/onml/' rel='external' hreflang='en'><img loading='lazy' src='./img/kuno-monero-26x26.png' width='17' height='17' alt='Kuno - Moner.ooo donation page'></a>&nbsp;<a target='_blank' href='https://kuno.anne.media/' class='text-white' rel='external' hreflang='en'>Kuno Fundraise with Monero</a> | <a class='text-white' href='{$github_url}' hreflang='en' rel='external' target='_blank'>GitHub</a>";
$servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='text-white' href='https://servers.guru/' hreflang='en' rel='external' target='_blank'>Webhosting provided by<img loading='lazy' src='./img/servers-guru.svg' height='19' alt='Servers Guru' title='Servers Guru' /></a>";
$clipboard_copy_tooltip = "Αντιγραφή στο πρόχειρο";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
$l_fiatSelect = "Επιλογή νομίσματος";
$l_fiatInput = "Πεδίο εισαγωγής αξίας fiat";
$l_xmrInput = "Πεδίο εισαγωγής αξίας Monero";
// Tooltip Titel
$l_eur = "Ευρώ";
@ -30,45 +31,45 @@ $l_gbp = "Λίρα στερλίνα";
$l_rub = "Ρωσικό Ρούβλι";
$l_jpy = "Γιεν";
$l_try = "Τουρκική Λίρα";
$l_cad = "Δολάριο Καναδά";
$l_aud = "Δολάριο Αυστραλίας";
$l_cad = "Κανανδικό Δολάριο";
$l_aud = "Αυστραλιανό Δολάριο";
$l_hkd = "Δολάριο Χονγκ Κονγκ";
$l_sgd = "Δολάριο Σιγκαπούρης";
$l_pln = "Ζλότι";
$l_zar = "Ραντ Νότιας Αφρικής";
$l_inr = "Ρουπία Ινδίας";
$l_pln = "Ζλότυ";
$l_zar = "Νότιο Αφρικανικό Ραντ";
$l_inr = "Ινδική Ρουπία";
$l_aed = "Ντιρχάμ ΗΑΕ";
$l_eth = "Ethereum";
$l_uah = "Γρίβνα";
$l_krw = "Γουόν Νότιας Κορέας";
$l_brl = "Ρεάλ Βραζιλίας";
$l_myr = "Ρινγκίτ Μαλαισίας";
$l_krw = "Νοτιοκορεατικό Γουόν";
$l_brl = "Βραζιλιάνικο Ρεάλ";
$l_myr = "Μαλαισιανό Ρίνγκιτ";
$l_cny = "Ρενμίνμπι";
$l_xag = "Ασήμι (τροία ουγγιά)";
$l_xau = "Χρυσός (τροία ουγγιά)";
$l_vnd = "Ντονγκ Βιετνάμ";
$l_vef = "Μπολιβάρ Βενεζουέλας";
$l_xag = "Ασήμι (τρόι ουγγιά)";
$l_xau = "Χρυσός (τρόι ουγγιά)";
$l_vnd = "Βιετναμέζικο Ντονγκ";
$l_vef = "Βενεζουελανικό Μπολιβάρ";
$l_thb = "Μπατ";
$l_sar = "Ριάλ Σαουδικής Αραβίας";
$l_sek = "Κορώνα Σουηδίας";
$l_pkr = "Ρουπία Πακιστάν";
$l_sar = "Σαουδαραβικό Ριάλ";
$l_sek = "Σουηδική Κορώνα";
$l_pkr = "Πακιστανική Ρουπία";
$l_nzd = "Δολάριο Νέας Ζηλανδίας";
$l_php = "Πέσο Φιλιππίνων";
$l_nok = "Κορώνα Νορβηγίας";
$l_nok = "Νορβηγική Κορώνα";
$l_lkr = "Ρουπία Σρι Λάνκα";
$l_mmk = "Κυάτ Μιανμάρ";
$l_huf = "Φιορίνι Ουγγαρίας";
$l_ils = "Νέο Σέκελ Ισραήλ";
$l_kwd = "Δηνάριο Κουβέιτ";
$l_ngn = "Νάιρα Νιγηρίας";
$l_huf = "Ουγγρικό Φιορίνι";
$l_ils = "Νέο Ισραηλινό Σέκελ";
$l_kwd = "Κουβεϊτιανό Δηνάριο";
$l_ngn = "Ναϊρα Νιγηρίας";
$l_idr = "Ρουπία Ινδονησίας";
$l_twd = "Νέο Δολάριο Ταϊβάν";
$l_ars = "Πέσο Αργεντινής";
$l_bdt = "Τάκα Μπαγκλαντές";
$l_bhd = "Δηνάριο Μπαχρέιν";
$l_bmd = "Δολάριο Βερμούδων";
$l_czk = "Κορώνα Τσεχίας";
$l_dkk = "Κορώνα Δανίας";
$l_czk = "Τσεχική Κορώνα";
$l_dkk = "Δανική Κορώνα";
$l_clp = "Πέσο Χιλής";
$l_mxn = "Πέσο Μεξικού";
$l_bch = "Bitcoin Cash";
@ -83,7 +84,7 @@ $l_gel = "Λάρι Γεωργίας";
$l_xdr = "Ειδικά Τραβηκτικά Δικαιώματα";
// More Monero links
$getmonero = '<a class="text-white" href="https://www.getmonero.org/el/" hreflang="el" target="_blank" rel="external">Επίσημος ιστότοπος</a> | <a class="text-white" href="https://ccs.getmonero.org/" hreflang="en" target="_blank" rel="external">Community Crowdfunding System (CCS)</a> | <a class="text-white" href="https://www.monero.observer/resources/" hreflang="en" target="_blank" rel="external">Monero Observer</a> | <a class="text-white" href="https://www.monerotalk.live/" hreflang="en" target="_blank" rel="external">Monero Talk</a>';
$getmonero = '<a class="text-white" href="https://www.getmonero.org/el/" hreflang="el" target="_blank" rel="external">Επίσημος ιστότοπος</a> | <a class="text-white" href="https://ccs.getmonero.org/" hreflang="en" target="_blank" rel="external">Σύστημα Κοινοτικής Χρηματοδότησης (CCS)</a> | <a class="text-white" href="https://www.monero.observer/resources/" hreflang="en" target="_blank" rel="external">Monero Observer</a> | <a class="text-white" href="https://www.monerotalk.live/" hreflang="en" target="_blank" rel="external">Monero Talk</a>';
$countrymonero = ' | <a class="text-white" href="https://t.me/monerogr" hreflang="en" target="_blank" rel="external">Telegram - Monero Greece</a>';
?>

View File

@ -16,10 +16,6 @@ $servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='te
$clipboard_copy_tooltip = "Copiar al portapapeles";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
// Tooltip Titel
$l_eur = "Euro";
$l_btc = "Bitcoin";

View File

@ -1,6 +1,6 @@
<?php
// For the HTML meta specification, e.g. <!DOCTYPE html><html lang="en">
$lang_meta = "fa"; // https://www.w3schools.com/tags/ref_language_codes.asp
$lang_meta = "fa\" dir=\"rtl"; // https://www.w3schools.com/tags/ref_language_codes.asp
$page_title = "تبدیل XMR به EUR/BTC/CHF/USD و بسیاری دیگر"; // The browser tab title or search engine title
$meta_description = "نرخ تبادل زنده مونرو در ارزهای مختلف، رایگان برای همه."; // Search engine description / text
@ -16,10 +16,6 @@ $servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='te
$clipboard_copy_tooltip = "کپی به کلیپ‌بورد";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
// Tooltip Titel
$l_eur = "یورو";
$l_btc = "بیت‌کوین";
@ -83,7 +79,7 @@ $l_gel = "لاری گرجستان";
$l_xdr = "حقوق برداشت ویژه";
// More Monero links
$getmonero = '<a class="text-white" href="https://www.getmonero.org/" hreflang="en" target="_blank" rel="external">وبسایت رسمی</a> | <a class="text-white" href="https://ccs.getmonero.org/" hreflang="en" target="_blank" rel="external">سیستم تأمین مالی جمعی جامعه (CCS)</a> | <a class="text-white" href="https://www.monero.observer/resources/" hreflang="en" target="_blank" rel="external">ناظر مونرو</a> | <a class="text-white" href="https://www.monerotalk.live/" hreflang="en" target="_blank" rel="external">گفتگوی مونرو</a>';
$countrymonero = ' | <a class="text-white" href="https://t.me/monero" hreflang="en" target="_blank" rel="external">تلگرام - مونرو XMR</a>';
$getmonero = '<a class="text-white" href="https://www.monerotalk.live/" hreflang="en" target="_blank" rel="external">Monero Talk</a> | <a class="text-white" href="https://www.monero.observer/resources/" hreflang="en" target="_blank" rel="external">Monero Observer</a> | <a class="text-white" href="https://ccs.getmonero.org/" hreflang="en" target="_blank" rel="external">Community Crowdfunding System (CCS)</a> | <a class="text-white" href="https://www.getmonero.org/" hreflang="en" target="_blank" rel="external">Official website</a>';
$countrymonero = '';
?>

View File

@ -16,10 +16,6 @@ $servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='te
$clipboard_copy_tooltip = "Copia negli appunti";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
// Tooltip Titel
$l_eur = "Euro";
$l_btc = "Bitcoin";

View File

@ -1,6 +1,6 @@
<?php
// For the HTML meta specification, e.g. <!DOCTYPE html><html lang="en">
$lang_meta = "pt"; // https://www.w3schools.com/tags/ref_language_codes.asp
$lang_meta = "pt-BR"; // https://www.w3schools.com/tags/ref_language_codes.asp
$page_title = "Converter XMR para BRL/EUR/BTC/USD e muito mais"; // The browser tab title or search engine title
$meta_description = "A cotação em tempo real de Monero em várias moedas, de graça a todos."; // Search engine description / text

View File

@ -1,6 +1,6 @@
<?php // Translator Winslow SorenEricMent(逸雩)
// For the HTML meta specification, e.g. <!DOCTYPE html><html lang="en">
$lang_meta = "zh"; // https://www.w3schools.com/tags/ref_language_codes.asp
$lang_meta = "zh-Hans"; // https://www.w3schools.com/tags/ref_language_codes.asp
$page_title = "门罗币与欧元/BTC/CHF/美元等币种汇率"; // The browser tab title or search engine title
$meta_description = "门罗币实时多币种汇率,免费提供。"; // Search engine description / text
@ -14,12 +14,6 @@ $moneroooTable = "Service provided by <a href='https://moner.ooo/'>Moner.ooo</a>
$info = "本站提供的汇率仅供参考。其精确程度不被保证,且可能在您不注意的情况下发生变更。汇率大约每分钟更新一次。最近一次在 Europe/Berlin 时间 <u title='Hours:Minutes:Seconds (hh:mm:ss)'>".$time."</u> 。数据由 <a class='text-white' href='https://www.coingecko.com/zh/%E6%95%B0%E5%AD%97%E8%B4%A7%E5%B8%81/%E9%97%A8%E7%BD%97%E5%B8%81' hreflang='zh' rel='external' target='_blank'>CoinGecko</a>。<br/><a target='_blank' href='https://kuno.anne.media/donate/onml/' rel='external' hreflang='en'><img loading='lazy' src='./img/kuno-monero-26x26.png' width='17' height='17' alt='Kuno - Moner.ooo donation page'></a>&nbsp;<a target='_blank' href='https://kuno.anne.media/' class='text-white' rel='external' hreflang='en'>Kuno Fundraise with Monero</a> | <a class='text-white' href='{$github_url}' hreflang='en' rel='external' target='_blank'>GitHub</a>";
$servers_guru = " | <a style='text-decoration:none; font-weight:bold;' class='text-white' href='https://servers.guru/' hreflang='en' rel='external' target='_blank'>Webhosting provided by<img loading='lazy' src='./img/servers-guru.svg' height='19' alt='Servers Guru' title='Servers Guru' /></a>";
$clipboard_copy_tooltip = "Copy to clipboard";
$l_fiatSelect = "Currency choice";
$l_fiatInput = "Fiat value input field";
$l_xmrInput = "Monero value input field";
// Tooltip Titel
$l_eur = "欧元";
$l_btc = "比特币";

View File

@ -24,6 +24,21 @@ document.addEventListener('DOMContentLoaded', function () {
const selectBox = document.getElementById('selectBox');
const convertXMRToFiatBtn = document.getElementById('convertXMRToFiat');
const convertFiatToXMRBtn = document.getElementById('convertFiatToXMR');
const fiatButtons = document.querySelectorAll('.fiat-btn');
// Add event listeners for the currency buttons
fiatButtons.forEach(button => {
button.addEventListener('click', (e) => {
e.preventDefault();
selectBox.value = button.textContent;
if (lastModifiedField === 'xmr') {
xmrConvert();
} else {
fiatConvert();
}
history.pushState(null, '', `?in=${button.textContent}`);
});
});
// Add event listeners for the copy buttons
copyXMRBtn.addEventListener('click', copyToClipBoardXMR);

150
templates/index.php Normal file
View File

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="<?php echo $lang_meta; ?>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<title lang="<?php echo $lang_meta; ?>"><?php echo $page_title; ?></title>
<meta name="description" lang="<?php echo $lang_meta; ?>" content="<?php echo $meta_description; ?>" />
<meta name="keywords" lang="<?php echo $lang_meta; ?>" content="<?php echo $meta_keywords; ?>" />
<meta property="og:title" content="<?php echo $page_title; ?>" />
<meta property="og:description" content="<?php echo $meta_description; ?>" />
<meta property="og:image" content="<?php echo $parentUrl; ?>/img/mstile-310x150.png" />
<meta property="og:type" content="website" />
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="img/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="img/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="img/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="img/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="img/apple-touch-icon-152x152.png" />
<link rel="apple-touch-startup-image" href="img/favicon-196x196.png" />
<link rel="icon" type="image/png" href="img/favicon-196x196.png" sizes="196x196" />
<link rel="icon" type="image/png" href="img/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="img/favicon-128.png" sizes="128x128" />
<meta name="application-name" content="Moner.ooo" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-TileImage" content="img/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="img/mstile-70x70.png" />
<meta name="msapplication-square150x150logo" content="img/mstile-150x150.png" />
<meta name="msapplication-wide310x150logo" content="img/mstile-310x150.png" />
<meta name="msapplication-square310x310logo" content="img/mstile-310x310.png" />
<meta name="theme-color" content="#193e4c" />
<meta name="apple-mobile-web-app-title" content="Moner.ooo" />
<meta name="apple-mobile-web-app-status-bar-style" content="#193e4c" />
<link href="css/main.css" rel="stylesheet" />
</head>
<body>
<div class="container pt-4">
<div class="row">
<div class="col-12">
<div class="cursor-default text-center text-white">
<h1 lang="<?php echo $lang_meta; ?>"><span style="color:#4d4d4d;">&darr;</span>&nbsp;<span style="color:#ff6600;" title="Monero">XMR</span>&nbsp;<?php echo $title_h1; ?>&nbsp;<span style="color:#4d4d4d;">&darr;</span></h1>
<div class="fiat-btns table-responsive">
<table class="table table-sm table-borderless">
<tbody>
<?php
$chunks = array_chunk($currencies, 10);
foreach ($chunks as $chunk) {
echo "<tr>";
foreach ($chunk as $currency) {
$currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency;
echo "<td><a href=\"/?in={$currency}\" class=\"btn btn-light fiat-btn\" title=\"{$currencyName}\" data-toggle=\"tooltip\" data-bs-html=\"true\" data-placement=\"top\">{$currency}</a></td>";
}
echo "</tr>";
echo "<tr style=\"display:none;\">";
foreach ($chunk as $currency) {
echo "<td>" . str_replace(".", ",", $exchangeRates[$currency]) . "</td>";
}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<hr class="gold" />
<form method="get" action="">
<div class="input-group mb-3">
<button id="copyXMRBtn" class="btn-outline-secondary input-group-text clipboard-copy" title="<?php echo $clipboard_copy_tooltip; ?>" data-toggle="tooltip" data-bs-html="true" data-placement="top">&#128203;</button>
<input class="form-control" id="xmrInput" name="xmr" type="text" spellcheck="false" autocorrect="off" inputmode="numeric" aria-label="<?php echo $l_xmrInput; ?>" aria-describedby="basic-addon-xmr" value="<?php echo $xmr_value; ?>">
<input class="input-group-text" id="basic-addon-xmr" type="text" value="XMR" aria-label="Monero" disabled>
</div>
<div class="equals-box mb-3">
<button id="convertXMRToFiat" type="submit" name="direction" value="0" class="btn btn-arrow">
<span class="equals-text">&darr;</span>
</button>
<button type="button" class="btn btn-equals">
<span class="equals-text cursor-default">=</span>
</button>
<button id="convertFiatToXMR" type="submit" name="direction" value="1" class="btn btn-arrow">
<span class="equals-text">&uarr;</span>
</button>
</div>
<div class="fiatDiv input-group mb-3">
<button id="copyFiatBtn" class="btn-outline-secondary input-group-text clipboard-copy" title="<?php echo $clipboard_copy_tooltip; ?>" data-toggle="tooltip" data-bs-html="true" data-placement="top">&#128203;</button>
<input class="form-control" id="fiatInput" name="fiat" type="text" spellcheck="false" autocorrect="off" inputmode="numeric" aria-label="<?php echo $l_fiatInput; ?>" value="<?php echo $fiat_value; ?>">
<select class="input-group-text cursor-pointer" id="selectBox" name="in" aria-label="<?php echo $l_fiatSelect; ?>">
<?php
foreach ($currencies as $currency) {
$selected = $currency == $xmr_in ? 'selected' : '';
$currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency;
echo "<option {$selected} value=\"{$currency}\">{$currencyName}</option>";
}
?>
</select>
</div>
</form>
<noscript>
<div class="alert alert-warning" role="alert">
Looks like you have JavaScript disabled. You can still use this tool, but you won't be able to use the &#128203; buttons to automatically copy the results to your clipboard.<br />
Use the &darr; button to convert XMR to fiat, or the &uarr; button to convert fiat to XMR.
</div>
</noscript>
<hr class="gold" />
<small class="cursor-default text-white text-info" lang="<?php echo $lang_meta; ?>">
<?php echo $info;
if ($display_servers_guru) {
echo $servers_guru;
};
echo $attribution; ?>
</small>
<hr />
<?php
$footer_links = "";
if (isset($config['footer_links']) && !empty($config['footer_links'])) {
foreach ($config['footer_links'] as $link) {
$footer_links .= '<a href="' . $link['url'] . '" class="text-white" target="_blank" rel="noopener noreferrer">' . $link['text'] . '</a> | ';
}
}
?>
<small class="cursor-default text-white" lang="<?php echo $lang_meta; ?>">
<?php echo $footer_links . $getmonero . $countrymonero; ?>
</small>
</div>
</div>
</div>
<script src="js/main.js"></script>
</body>
</html>