crux2006 commited on
Commit
2bd2701
·
verified ·
1 Parent(s): 751be76

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +484 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Getiri Hesaplama
3
- emoji: 💻
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: getiri-hesaplama
3
+ emoji: 🐳
4
+ colorFrom: red
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,484 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="tr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Fon Getiri Hesaplayıcı</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #6b73ff 0%, #000dff 100%);
12
+ }
13
+ .result-card {
14
+ box-shadow: 0 10px 30px rgba(0, 13, 255, 0.2);
15
+ transition: all 0.3s ease;
16
+ }
17
+ .result-card:hover {
18
+ transform: translateY(-5px);
19
+ }
20
+ input[type="range"] {
21
+ -webkit-appearance: none;
22
+ height: 8px;
23
+ border-radius: 4px;
24
+ background: #e0e0e0;
25
+ }
26
+ input[type="range"]::-webkit-slider-thumb {
27
+ -webkit-appearance: none;
28
+ width: 20px;
29
+ height: 20px;
30
+ border-radius: 50%;
31
+ background: #4f46e5;
32
+ cursor: pointer;
33
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
34
+ }
35
+ .tab-active {
36
+ position: relative;
37
+ }
38
+ .tab-active:after {
39
+ content: '';
40
+ position: absolute;
41
+ bottom: -1px;
42
+ left: 0;
43
+ right: 0;
44
+ height: 3px;
45
+ background: #4f46e5;
46
+ }
47
+ </style>
48
+ </head>
49
+ <body class="bg-gray-50 min-h-screen">
50
+ <div class="container mx-auto px-4 py-12">
51
+ <div class="max-w-4xl mx-auto">
52
+ <div class="text-center mb-12">
53
+ <h1 class="text-4xl font-bold text-gray-800 mb-3">Fon Getiri Hesaplayıcı</h1>
54
+ <p class="text-lg text-gray-600">Yatırımınızın potansiyel getirisini kolayca hesaplayın</p>
55
+ </div>
56
+
57
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8">
58
+ <div class="flex border-b border-gray-200">
59
+ <button id="simple-tab" class="tab-active px-6 py-4 font-medium text-indigo-600 focus:outline-none">Basit Hesaplayıcı</button>
60
+ <button id="advanced-tab" class="px-6 py-4 font-medium text-gray-500 hover:text-indigo-600 focus:outline-none">Gelişmiş Hesaplayıcı</button>
61
+ </div>
62
+
63
+ <div id="simple-calculator" class="p-8">
64
+ <div class="grid md:grid-cols-2 gap-8 mb-8">
65
+ <div>
66
+ <label for="initial-investment" class="block text-sm font-medium text-gray-700 mb-2">Başlangıç Yatırımı (₺)</label>
67
+ <div class="relative">
68
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
69
+ <i class="fas fa-lira-sign text-gray-400"></i>
70
+ </div>
71
+ <input type="number" id="initial-investment" class="pl-8 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" value="10000" min="0">
72
+ </div>
73
+ </div>
74
+ <div>
75
+ <label for="monthly-contribution" class="block text-sm font-medium text-gray-700 mb-2">Aylık Katkı (₺)</label>
76
+ <div class="relative">
77
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
78
+ <i class="fas fa-lira-sign text-gray-400"></i>
79
+ </div>
80
+ <input type="number" id="monthly-contribution" class="pl-8 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" value="500" min="0">
81
+ </div>
82
+ </div>
83
+ <div>
84
+ <label for="annual-return" class="block text-sm font-medium text-gray-700 mb-2">Beklenen Yıllık Getiri (%)</label>
85
+ <div class="relative">
86
+ <input type="range" id="annual-return-slider" class="w-full" min="1" max="30" step="0.5" value="7">
87
+ <div class="flex justify-between mt-2">
88
+ <span class="text-xs text-gray-500">1%</span>
89
+ <span id="annual-return-value" class="font-medium">7%</span>
90
+ <span class="text-xs text-gray-500">30%</span>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ <div>
95
+ <label for="investment-period" class="block text-sm font-medium text-gray-700 mb-2">Yatırım Süresi (Yıl)</label>
96
+ <div class="relative">
97
+ <input type="range" id="investment-period-slider" class="w-full" min="1" max="40" step="1" value="10">
98
+ <div class="flex justify-between mt-2">
99
+ <span class="text-xs text-gray-500">1</span>
100
+ <span id="investment-period-value" class="font-medium">10</span>
101
+ <span class="text-xs text-gray-500">40</span>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="flex justify-center">
108
+ <button id="calculate-btn" class="gradient-bg text-white px-8 py-3 rounded-full font-medium hover:opacity-90 transition duration-300 shadow-lg flex items-center">
109
+ <i class="fas fa-calculator mr-2"></i> Getiriyi Hesapla
110
+ </button>
111
+ </div>
112
+ </div>
113
+
114
+ <div id="advanced-calculator" class="p-8 hidden">
115
+ <div class="grid md:grid-cols-2 gap-8 mb-8">
116
+ <div>
117
+ <label for="initial-investment-adv" class="block text-sm font-medium text-gray-700 mb-2">Başlangıç Yatırımı (₺)</label>
118
+ <div class="relative">
119
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
120
+ <i class="fas fa-lira-sign text-gray-400"></i>
121
+ </div>
122
+ <input type="number" id="initial-investment-adv" class="pl-8 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" value="10000" min="0">
123
+ </div>
124
+ </div>
125
+ <div>
126
+ <label for="contribution-frequency" class="block text-sm font-medium text-gray-700 mb-2">Katkı Sıklığı</label>
127
+ <select id="contribution-frequency" class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border">
128
+ <option value="12">Aylık</option>
129
+ <option value="4">Üç Aylık</option>
130
+ <option value="2">Altı Aylık</option>
131
+ <option value="1">Yıllık</option>
132
+ </select>
133
+ </div>
134
+ <div>
135
+ <label for="contribution-amount" class="block text-sm font-medium text-gray-700 mb-2">Katkı Miktarı (₺)</label>
136
+ <div class="relative">
137
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
138
+ <i class="fas fa-lira-sign text-gray-400"></i>
139
+ </div>
140
+ <input type="number" id="contribution-amount" class="pl-8 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" value="500" min="0">
141
+ </div>
142
+ </div>
143
+ <div>
144
+ <label for="return-type" class="block text-sm font-medium text-gray-700 mb-2">Getiri Türü</label>
145
+ <select id="return-type" class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border">
146
+ <option value="compound">Bileşik Getiri</option>
147
+ <option value="simple">Basit Getiri</option>
148
+ </select>
149
+ </div>
150
+ <div>
151
+ <label for="annual-return-adv" class="block text-sm font-medium text-gray-700 mb-2">Beklenen Yıllık Getiri (%)</label>
152
+ <div class="relative">
153
+ <input type="range" id="annual-return-slider-adv" class="w-full" min="1" max="30" step="0.5" value="7">
154
+ <div class="flex justify-between mt-2">
155
+ <span class="text-xs text-gray-500">1%</span>
156
+ <span id="annual-return-value-adv" class="font-medium">7%</span>
157
+ <span class="text-xs text-gray-500">30%</span>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ <div>
162
+ <label for="investment-period-adv" class="block text-sm font-medium text-gray-700 mb-2">Yatırım Süresi (Yıl)</label>
163
+ <div class="relative">
164
+ <input type="range" id="investment-period-slider-adv" class="w-full" min="1" max="40" step="1" value="10">
165
+ <div class="flex justify-between mt-2">
166
+ <span class="text-xs text-gray-500">1</span>
167
+ <span id="investment-period-value-adv" class="font-medium">10</span>
168
+ <span class="text-xs text-gray-500">40</span>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ <div>
173
+ <label for="inflation-rate" class="block text-sm font-medium text-gray-700 mb-2">Enflasyon Oranı (%)</label>
174
+ <div class="relative">
175
+ <input type="range" id="inflation-rate-slider" class="w-full" min="0" max="10" step="0.1" value="2.5">
176
+ <div class="flex justify-between mt-2">
177
+ <span class="text-xs text-gray-500">0%</span>
178
+ <span id="inflation-rate-value" class="font-medium">2.5%</span>
179
+ <span class="text-xs text-gray-500">10%</span>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ <div>
184
+ <label for="management-fee" class="block text-sm font-medium text-gray-700 mb-2">Yönetim Ücreti (%)</label>
185
+ <div class="relative">
186
+ <input type="range" id="management-fee-slider" class="w-full" min="0" max="5" step="0.1" value="1">
187
+ <div class="flex justify-between mt-2">
188
+ <span class="text-xs text-gray-500">0%</span>
189
+ <span id="management-fee-value" class="font-medium">1%</span>
190
+ <span class="text-xs text-gray-500">5%</span>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <div class="flex justify-center">
197
+ <button id="calculate-btn-adv" class="gradient-bg text-white px-8 py-3 rounded-full font-medium hover:opacity-90 transition duration-300 shadow-lg flex items-center">
198
+ <i class="fas fa-calculator mr-2"></i> Gelişmiş Getiriyi Hesapla
199
+ </button>
200
+ </div>
201
+ </div>
202
+ </div>
203
+
204
+ <div id="result-section" class="hidden">
205
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8">
206
+ <div class="p-8">
207
+ <h2 class="text-2xl font-bold text-gray-800 mb-6">Yatırım Sonuçları</h2>
208
+
209
+ <div class="grid md:grid-cols-3 gap-6 mb-8">
210
+ <div class="result-card bg-indigo-50 p-6 rounded-lg">
211
+ <div class="flex items-center mb-3">
212
+ <div class="p-3 rounded-full bg-indigo-100 text-indigo-600 mr-4">
213
+ <i class="fas fa-coins text-xl"></i>
214
+ </div>
215
+ <h3 class="text-lg font-semibold text-gray-800">Toplam Yatırım</h3>
216
+ </div>
217
+ <p id="total-invested" class="text-3xl font-bold text-indigo-600">₺0</p>
218
+ </div>
219
+
220
+ <div class="result-card bg-green-50 p-6 rounded-lg">
221
+ <div class="flex items-center mb-3">
222
+ <div class="p-3 rounded-full bg-green-100 text-green-600 mr-4">
223
+ <i class="fas fa-chart-line text-xl"></i>
224
+ </div>
225
+ <h3 class="text-lg font-semibold text-gray-800">Toplam Getiri</h3>
226
+ </div>
227
+ <p id="total-returns" class="text-3xl font-bold text-green-600">₺0</p>
228
+ </div>
229
+
230
+ <div class="result-card bg-purple-50 p-6 rounded-lg">
231
+ <div class="flex items-center mb-3">
232
+ <div class="p-3 rounded-full bg-purple-100 text-purple-600 mr-4">
233
+ <i class="fas fa-piggy-bank text-xl"></i>
234
+ </div>
235
+ <h3 class="text-lg font-semibold text-gray-800">Gelecek Değer</h3>
236
+ </div>
237
+ <p id="future-value" class="text-3xl font-bold text-purple-600">₺0</p>
238
+ </div>
239
+ </div>
240
+
241
+ <div class="mb-8">
242
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Yıllık Detaylar</h3>
243
+ <div class="overflow-x-auto">
244
+ <table class="min-w-full divide-y divide-gray-200">
245
+ <thead class="bg-gray-50">
246
+ <tr>
247
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Yıl</th>
248
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Yatırım</th>
249
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Getiri</th>
250
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Toplam Değer</th>
251
+ </tr>
252
+ </thead>
253
+ <tbody id="yearly-breakdown" class="bg-white divide-y divide-gray-200">
254
+ <!-- Sonuçlar buraya eklenecek -->
255
+ </tbody>
256
+ </table>
257
+ </div>
258
+ </div>
259
+
260
+ <div class="flex justify-center">
261
+ <button id="reset-btn" class="bg-gray-200 text-gray-700 px-6 py-2 rounded-full font-medium hover:bg-gray-300 transition duration-300 flex items-center">
262
+ <i class="fas fa-redo mr-2"></i> Hesaplayıcıyı Sıfırla
263
+ </button>
264
+ </div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </div>
270
+
271
+ <script>
272
+ document.addEventListener('DOMContentLoaded', function() {
273
+ // Sekme geçişi
274
+ const simpleTab = document.getElementById('simple-tab');
275
+ const advancedTab = document.getElementById('advanced-tab');
276
+ const simpleCalculator = document.getElementById('simple-calculator');
277
+ const advancedCalculator = document.getElementById('advanced-calculator');
278
+
279
+ simpleTab.addEventListener('click', function() {
280
+ simpleTab.classList.add('tab-active');
281
+ simpleTab.classList.remove('text-gray-500');
282
+ simpleTab.classList.add('text-indigo-600');
283
+ advancedTab.classList.remove('tab-active');
284
+ advancedTab.classList.add('text-gray-500');
285
+ advancedTab.classList.remove('text-indigo-600');
286
+ simpleCalculator.classList.remove('hidden');
287
+ advancedCalculator.classList.add('hidden');
288
+ });
289
+
290
+ advancedTab.addEventListener('click', function() {
291
+ advancedTab.classList.add('tab-active');
292
+ advancedTab.classList.remove('text-gray-500');
293
+ advancedTab.classList.add('text-indigo-600');
294
+ simpleTab.classList.remove('tab-active');
295
+ simpleTab.classList.add('text-gray-500');
296
+ simpleTab.classList.remove('text-indigo-600');
297
+ advancedCalculator.classList.remove('hidden');
298
+ simpleCalculator.classList.add('hidden');
299
+ });
300
+
301
+ // Kaydırıcı değer güncellemeleri
302
+ const annualReturnSlider = document.getElementById('annual-return-slider');
303
+ const annualReturnValue = document.getElementById('annual-return-value');
304
+ const investmentPeriodSlider = document.getElementById('investment-period-slider');
305
+ const investmentPeriodValue = document.getElementById('investment-period-value');
306
+
307
+ annualReturnSlider.addEventListener('input', function() {
308
+ annualReturnValue.textContent = this.value + '%';
309
+ });
310
+
311
+ investmentPeriodSlider.addEventListener('input', function() {
312
+ investmentPeriodValue.textContent = this.value;
313
+ });
314
+
315
+ // Gelişmiş kaydırıcı değer güncellemeleri
316
+ const annualReturnSliderAdv = document.getElementById('annual-return-slider-adv');
317
+ const annualReturnValueAdv = document.getElementById('annual-return-value-adv');
318
+ const investmentPeriodSliderAdv = document.getElementById('investment-period-slider-adv');
319
+ const investmentPeriodValueAdv = document.getElementById('investment-period-value-adv');
320
+ const inflationRateSlider = document.getElementById('inflation-rate-slider');
321
+ const inflationRateValue = document.getElementById('inflation-rate-value');
322
+ const managementFeeSlider = document.getElementById('management-fee-slider');
323
+ const managementFeeValue = document.getElementById('management-fee-value');
324
+
325
+ annualReturnSliderAdv.addEventListener('input', function() {
326
+ annualReturnValueAdv.textContent = this.value + '%';
327
+ });
328
+
329
+ investmentPeriodSliderAdv.addEventListener('input', function() {
330
+ investmentPeriodValueAdv.textContent = this.value;
331
+ });
332
+
333
+ inflationRateSlider.addEventListener('input', function() {
334
+ inflationRateValue.textContent = this.value + '%';
335
+ });
336
+
337
+ managementFeeSlider.addEventListener('input', function() {
338
+ managementFeeValue.textContent = this.value + '%';
339
+ });
340
+
341
+ // Hesaplama fonksiyonları
342
+ function formatCurrency(amount) {
343
+ return new Intl.NumberFormat('tr-TR', { style: 'currency', currency: 'TRY' }).format(amount);
344
+ }
345
+
346
+ function calculateSimpleReturns() {
347
+ const initialInvestment = parseFloat(document.getElementById('initial-investment').value) || 0;
348
+ const monthlyContribution = parseFloat(document.getElementById('monthly-contribution').value) || 0;
349
+ const annualReturn = parseFloat(annualReturnSlider.value) / 100;
350
+ const years = parseInt(investmentPeriodSlider.value);
351
+
352
+ let totalInvested = initialInvestment;
353
+ let totalValue = initialInvestment;
354
+ const yearlyData = [];
355
+
356
+ for (let year = 1; year <= years; year++) {
357
+ // Yıllık katkıları ekle
358
+ totalInvested += monthlyContribution * 12;
359
+
360
+ // Yıllık getiriyi hesapla
361
+ const yearlyReturn = totalValue * annualReturn;
362
+ totalValue += yearlyReturn + (monthlyContribution * 12);
363
+
364
+ yearlyData.push({
365
+ year: year,
366
+ invested: totalInvested,
367
+ returns: totalValue - totalInvested,
368
+ totalValue: totalValue
369
+ });
370
+ }
371
+
372
+ return {
373
+ totalInvested: totalInvested,
374
+ totalReturns: totalValue - totalInvested,
375
+ futureValue: totalValue,
376
+ yearlyData: yearlyData
377
+ };
378
+ }
379
+
380
+ function calculateAdvancedReturns() {
381
+ const initialInvestment = parseFloat(document.getElementById('initial-investment-adv').value) || 0;
382
+ const contributionAmount = parseFloat(document.getElementById('contribution-amount').value) || 0;
383
+ const contributionFrequency = parseInt(document.getElementById('contribution-frequency').value);
384
+ const returnType = document.getElementById('return-type').value;
385
+ const annualReturn = parseFloat(annualReturnSliderAdv.value) / 100;
386
+ const years = parseInt(investmentPeriodSliderAdv.value);
387
+ const inflationRate = parseFloat(inflationRateSlider.value) / 100;
388
+ const managementFee = parseFloat(managementFeeSlider.value) / 100;
389
+
390
+ let totalInvested = initialInvestment;
391
+ let totalValue = initialInvestment;
392
+ const yearlyData = [];
393
+ const periodsPerYear = contributionFrequency;
394
+ const periods = years * periodsPerYear;
395
+ const periodReturn = Math.pow(1 + annualReturn, 1/periodsPerYear) - 1;
396
+ const periodFee = managementFee / periodsPerYear;
397
+
398
+ for (let period = 1; period <= periods; period++) {
399
+ // Her dönem başında katkı ekle
400
+ if (period > 1) {
401
+ totalInvested += contributionAmount;
402
+ totalValue += contributionAmount;
403
+ }
404
+
405
+ // Dönem getirisini hesapla
406
+ if (returnType === 'compound') {
407
+ totalValue = totalValue * (1 + periodReturn);
408
+ } else {
409
+ // Basit faiz - sadece başlangıç yatırımına
410
+ if (period % periodsPerYear === 0) {
411
+ totalValue += initialInvestment * annualReturn;
412
+ }
413
+ }
414
+
415
+ // Yönetim ücretini uygula
416
+ totalValue = totalValue * (1 - periodFee);
417
+
418
+ // Yıllık verileri kaydet
419
+ if (period % periodsPerYear === 0) {
420
+ const year = period / periodsPerYear;
421
+ yearlyData.push({
422
+ year: year,
423
+ invested: totalInvested,
424
+ returns: totalValue - totalInvested,
425
+ totalValue: totalValue
426
+ });
427
+ }
428
+ }
429
+
430
+ // Enflasyon için ayarla
431
+ const inflationFactor = Math.pow(1 + inflationRate, years);
432
+ const realFutureValue = totalValue / inflationFactor;
433
+
434
+ return {
435
+ totalInvested: totalInvested,
436
+ totalReturns: totalValue - totalInvested,
437
+ futureValue: totalValue,
438
+ realFutureValue: realFutureValue,
439
+ yearlyData: yearlyData
440
+ };
441
+ }
442
+
443
+ // Sonuçları göster
444
+ function displayResults(results) {
445
+ document.getElementById('total-invested').textContent = formatCurrency(results.totalInvested);
446
+ document.getElementById('total-returns').textContent = formatCurrency(results.totalReturns);
447
+ document.getElementById('future-value').textContent = formatCurrency(results.futureValue);
448
+
449
+ const yearlyBreakdown = document.getElementById('yearly-breakdown');
450
+ yearlyBreakdown.innerHTML = '';
451
+
452
+ results.yearlyData.forEach(data => {
453
+ const row = document.createElement('tr');
454
+ row.innerHTML = `
455
+ <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${data.year}</td>
456
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(data.invested)}</td>
457
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(data.returns)}</td>
458
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(data.totalValue)}</td>
459
+ `;
460
+ yearlyBreakdown.appendChild(row);
461
+ });
462
+
463
+ document.getElementById('result-section').classList.remove('hidden');
464
+ }
465
+
466
+ // Hesapla butonları için event listener'lar
467
+ document.getElementById('calculate-btn').addEventListener('click', function() {
468
+ const results = calculateSimpleReturns();
469
+ displayResults(results);
470
+ });
471
+
472
+ document.getElementById('calculate-btn-adv').addEventListener('click', function() {
473
+ const results = calculateAdvancedReturns();
474
+ displayResults(results);
475
+ });
476
+
477
+ // Sıfırla butonu
478
+ document.getElementById('reset-btn').addEventListener('click', function() {
479
+ document.getElementById('result-section').classList.add('hidden');
480
+ });
481
+ });
482
+ </script>
483
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=crux2006/getiri-hesaplama" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
484
+ </html>