Skip to content

Commit

Permalink
Move show data to another page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajad Jalilian committed Jan 8, 2024
1 parent 081c434 commit 0f14178
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 46 deletions.
60 changes: 60 additions & 0 deletions Data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html dir="rtl">

<head>
<script src="functions.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="./index.css">
<title>All Data</title>

</head>

<body>
<div class="container pt-5 d-flex justify-content-center align-items-center flex-column">

<div class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<a href="/index.html" target="_self" rel="noopener noreferrer">خانه</a>
</div>
</div>

<div class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<a href="https://github.com/SajadJalilian/RealMoney" target="_blank"
rel="noopener noreferrer">github</a>
</div>
</div>
<div class="d-flex justify-content-between align-items-center">
<div x-data="{ data: fetchData() , rawData : '' }">
<button x-on:click="rawData = showData()" class="btn btn-primary">
نمایش تمام داده‌ها
</button>
<template x-if="rawData">
<pre x-text="JSON.stringify(rawData, null, 2)"></pre>
<ul>
<template x-for="item in rawData.items">
<li x-text="item.name"></li>
</template>
</ul>
</template>
</div>
</div>
</div>


<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'G-VL6DSZLQG3');
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VL6DSZLQG3"></script>
<script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
</body>

</html>
1 change: 1 addition & 0 deletions functions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function fetchData() {
debugger
return fetch('https://cdn.jsdelivr.net/gh/SamadiPour/rial-exchange-rates-archive@data/jalali_all.min.json')
.then(response => response.json())
.then(data => {
Expand Down
73 changes: 27 additions & 46 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<!DOCTYPE html>
<html dir="rtl">
<html dir="rtl">

<head>
<script src="functions.js"></script>

<!-- Google tag (gtag.js) -->





<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="./index.css">


<link rel="stylesheet" href="./index.css">
<title>محاسبه‌گر ارزش واقعی پول امروز</title>

</head>
Expand All @@ -23,17 +14,16 @@

<div class="container pt-5 d-flex justify-content-center align-items-center flex-column">



<div class="d-flex justify-content-between align-items-center">

<div class="pt-3 col-3">
<h3>چطور کار میکنه؟</h3>
<p>
آرشیو ما از 1391/12/17 وجود داره.
</p>
<p>
ما به زمان گذشته سفر می‌کنیم و با پولی که به ما دادی «سکه‌ی بهار آزادی» می‌خریم. بعد دوباره به زمان حال
ما به زمان گذشته سفر می‌کنیم و با پولی که به ما دادی «سکه‌ی بهار آزادی» می‌خریم. بعد دوباره به زمان
حال
برمی‌گردیم و سکه‌ها رو می‌فروشیم و پولی که به دست اومده رو به شما نشون می‌دیم.
</p>
</div>
Expand All @@ -52,61 +42,52 @@ <h1 class="">پول واقعی</h1>
<input type="number" x-model="userInputRial" placeholder="مبلغ به تومان">
<br>
<div class="d-flex justify-content-center align-items-center mt-3">
<input type="number" min="01" max="31" x-model="userInputDay" placeholder="روز" class="ms-2">
<input type="number" min="01" max="12" x-model="userInputMonth" placeholder="ماه" class="ms-2">
<input type="number" min="1391" x-model="userInputYear" placeholder="سال" class="ms-2">
<button x-on:click="calcResult = calculateSum(userInputRial, userInputYear, userInputMonth, userInputDay)"
class="btn btn-primary d-flex justify-content-center align-items-center" style="width: 100px; height: 30px;">
محاسبه‌
</button>
<input type="number" min="01" max="31" x-model="userInputDay" placeholder="روز" class="ms-2">
<input type="number" min="01" max="12" x-model="userInputMonth" placeholder="ماه" class="ms-2">
<input type="number" min="1391" x-model="userInputYear" placeholder="سال" class="ms-2">
<button
x-on:click="calcResult = calculateSum(userInputRial, userInputYear, userInputMonth, userInputDay)"
class="btn btn-primary d-flex justify-content-center align-items-center"
style="width: 100px; height: 30px;">
محاسبه‌
</button>
</div>



<p class="mt-3">آخرین قیمت سکه بهار آزادی: <span type="number" x-text="calcResult.lastUsdValue"
class="text-primary ms-2"></span></p>
<p>قیمت سکه بهار آزادی در تاریخی که وارد شده: <span type="number" x-text="calcResult.usdValueOnDate"
class="text-primary"></span>
</p>

<p>ارزش مبلغ وارد شده در امروز: <span x-text="calcResult.value" class="text-danger" type="number"></span>

<p>ارزش مبلغ وارد شده در امروز: <span x-text="calcResult.value" class="text-danger"
type="number"></span>
</p>

<button x-on:click="rawData = showData()" class="btn btn-primary">
نمایش تمام داده‌ها
</button>
<template x-if="rawData">
<pre x-text="JSON.stringify(rawData, null, 2)"></pre>
<ul>
<template x-for="item in rawData.items">
<li x-text="item.name"></li>
</template>
</ul>
</template>

</div>
</div>

</div>

<div class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<a href="https://github.com/SajadJalilian/RealMoney" target="_blank" rel="noopener noreferrer">github</a>

<a href="/Data.html" target="_self" rel="noopener noreferrer">
مشاهده تمام دیتا
</a>
</div>
</div>


<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'G-VL6DSZLQG3');
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VL6DSZLQG3"></script>
<script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VL6DSZLQG3"></script>
<script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
</body>

</html>

0 comments on commit 0f14178

Please sign in to comment.