-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1765 lines (1614 loc) · 66.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Robotaxi Simulator - Totally Self-Driving</title>
<link rel="stylesheet" href="styles.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YWK987RB6M"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-YWK987RB6M');
</script>
</head>
<body>
<header>
<h1>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M21,11l-2-7H5L3,11H2c0,0.5,0.4,1,1,1h1l-0.3,1.1C3.3,13.4,3,13.9,3,14.5V20c0,0.6,0.4,1,1,1h1
c0.6,0,1-0.4,1-1v-1h12v1c0,0.6,0.4,1,1,1h1c0.6,0,1-0.4,1-1v-5.5c0-0.6-0.3-1.1-0.7-1.4L20,12h1c0.6,0,1-0.5,1-1H21z M6.8,6h10.4
l1.4,5H5.4L6.8,6z M7,16c-0.8,0-1.5-0.7-1.5-1.5S6.2,13,7,13s1.5,0.7,1.5,1.5S7.8,16,7,16z M17,16c-0.8,0-1.5-0.7-1.5-1.5
S16.2,13,17,13s1.5,0.7,1.5,1.5S17.8,16,17,16z"/>
<path d="M9,8.5h6c0.3,0,0.5-0.2,0.5-0.5S15.3,7.5,15,7.5H9C8.7,7.5,8.5,7.7,8.5,8S8.7,8.5,9,8.5z"/>
</svg>
<span data-i18n="appTitle">Robotaxi Simulator - Totally Self-Driving</span>
</h1>
<div class="lang-toggle-container">
<span class="lang-label">EN</span>
<div class="lang-toggle" id="langToggle"></div>
<span class="lang-label">CN</span>
<button id="resetBtn" style="margin-left:10px; background:#ff6b6b;" data-i18n="resetBtn">Reset</button>
</div>
</header>
<main>
<div id="gameOverMsg" data-i18n="gameOverMsg">Game Over! You went broke. Hit "Reset" on the top right to start over.</div>
<div id="victoryMsg" data-i18n="victoryMsg">Congratulations! You've reached $1M! Alien Musk might be calling soon about that Mars trip! 🚀</div>
<div class="progress-container">
<div class="progress-header">
<div class="progress-title" data-i18n="progressTitle">Road to $1M - Mars Trip Challenge</div>
<div class="progress-value">$<span id="progressValue">0</span> / $1,000,000</div>
</div>
<div class="progress-bar">
<div class="progress-fill" id="progressFill" style="width: 0%"></div>
</div>
</div>
<div class="dashboard-container">
<div class="log-bar-container">
<div id="log"></div>
</div>
<div class="chart-container">
<canvas id="cashflowChart"></canvas>
</div>
</div>
<div class="stats-cards">
<div class="stat-card">
<h3 data-i18n="dayLabel">Day</h3>
<div class="stat-value" id="day">1</div>
</div>
<div class="stat-card">
<h3 data-i18n="cashLabel">Cash</h3>
<div class="stat-value" id="cash">0</div>
</div>
<div class="stat-card">
<h3 data-i18n="dailyExpenseLabel">Daily Expense</h3>
<div class="stat-value" id="dailyExpense">100</div>
</div>
<div class="stat-card">
<h3 data-i18n="playerHoursLabel">Player Hours Left</h3>
<div class="stat-value" id="playerHours">8</div>
</div>
<div class="stat-card">
<h3 data-i18n="carsOwnedLabel">Cars Owned</h3>
<div class="stat-value" id="numCars">0</div>
</div>
</div>
<div class="panels-container">
<div class="panel">
<div class="cars-header">
<div class="section-title" data-i18n="yourCars">Your Cars</div>
<div class="cars-header-buttons">
<button id="driveUnsupervisedBtn" style="display:none;" data-i18n="driveUnsupervisedBtn">Drive Unsupervised Fleet</button>
<button id="endDayBtn" data-i18n="endDayBtn">⏭ End Day</button>
<div class="pagination-settings">
<label for="carsPerPageSelect">Cars per page:</label>
<select id="carsPerPageSelect">
<option value="5">5</option>
<option value="10" selected>10</option>
<option value="15">15</option>
<option value="20">20</option>
</select>
</div>
</div>
</div>
<div class="swipe-hint" data-i18n="swipeHint">← Swipe →</div>
<div class="table-container">
<table id="car-list">
<thead>
<tr>
<th data-i18n="tableID">ID</th>
<th data-i18n="tableCar">Car</th>
<th data-i18n="tableHourRate">$/hr</th>
<th data-i18n="tableTSD">TSD</th>
<th data-i18n="tableCarHours">Car H</th>
<th data-i18n="tableDriveHours">Drive H</th>
<th data-i18n="tableCarActions">Car Actions</th>
<th data-i18n="tableTSDActions">TSD Actions</th>
</tr>
</thead>
<tbody id="car-list-body"></tbody>
</table>
<div id="paginationControls" class="pagination-controls"></div>
</div>
</div>
<div class="panel">
<div class="purchase-header">
<div class="section-title" data-i18n="buyMoreCars">Buy More Cars</div>
</div>
<div class="merged-row">
<div class="purchase-row-item">
<label data-i18n="selectModel">Select Model:</label>
<select id="fleetModelSelect"></select>
</div>
<div class="purchase-row-item">
<label data-i18n="selectTSD">TSD Configuration:</label>
<select id="tsdConfigSelect">
<option value="none" data-i18n="tsdConfigNone">No TSD</option>
<option value="subSupervised" data-i18n="tsdConfigSubSupervised">Subscribe Supervised ($3.33/day)</option>
<option value="subUnsupervised" data-i18n="tsdConfigSubUnsupervised">Subscribe Unsupervised ($10/day)</option>
<option value="buySupervised" data-i18n="tsdConfigBuySupervised">Buy Supervised ($8000)</option>
<option value="buyUnsupervised" data-i18n="tsdConfigBuyUnsupervised">Buy Unsupervised ($24000)</option>
</select>
</div>
<div class="purchase-row-item">
<label data-i18n="downPayment">Down Payment:</label>
<input type="range" id="downPaymentRange" min="0" value="0" step="100">
$<span id="downPaymentValue">0</span>
</div>
<div class="purchase-row-item">
<label data-i18n="loanTerm">Loan Term (Days):</label>
<input type="range" id="loanTermRange" min="30" max="120" value="30" step="1" data-i18n="loanTerm">
<span id="loanTermValue">30</span> days
</div>
</div>
<div class="merged-row">
<div class="purchase-row-item">
<label data-i18n="fullPrice">Full Price:</label>
<span id="fullPriceDisplay">$0</span>
</div>
<div class="purchase-row-item">
<label data-i18n="hourlyEarning">Est. Hourly Earning:</label>
<span id="dailyEarningDisplay">$0</span>
</div>
<div class="purchase-row-item">
<label data-i18n="dailyCost">Daily Cost (APR 120%):</label>
<span id="dailyCostDisplay">$0</span>
</div>
</div>
<div class="purchase-action">
<button id="buyFleetBtn" data-i18n="buySelectedModel">Buy Selected Model</button>
</div>
</div>
<div class="panel">
<div class="section-title" data-i18n="chooseInsurance">Choose Fleet Insurance</div>
<p style="font-size: 0.9em; margin: 10px 0;">
<span class="current-insurance"><span data-i18n="currentInsurance">Current Insurance</span>: <strong id="currentInsuranceDisplay" data-i18n="currentInsuranceNone">None</strong></span>
<span data-i18n="insuranceDescription">Different insurers have different costs and rejection rates. Daily cost is per car. TSD reduces risks for business expenses.</span>
</p>
<div class="insurance-container">
<label class="insurance-card geckgo">
<input type="radio" name="insurance" value="GeckGo">
<div class="insurance-content">
<div class="insurance-header">
<h3 data-i18n="insuranceGeckGo">GeckGo</h3>
<div class="rejection-badge" data-i18n="insuranceRejectionRate" data-rate="15">15% Rejection</div>
</div>
<div class="insurance-rates">
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceManual">Manual:</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="2.00">$2.00/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceSupervised">TSD (Sup):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="1.80">$1.80/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceUnsupervised">TSD (UnS):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="1.50">$1.50/car-day</span>
</div>
</div>
<div class="insurance-footer" data-i18n="insuranceGeckGoDesc">Lower cost, higher risk</div>
</div>
</label>
<label class="insurance-card progresso">
<input type="radio" name="insurance" value="Progresso">
<div class="insurance-content">
<div class="insurance-header">
<h3 data-i18n="insuranceProgresso">Progresso</h3>
<div class="rejection-badge" data-i18n="insuranceRejectionRate" data-rate="10">10% Rejection</div>
</div>
<div class="insurance-rates">
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceManual">Manual:</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="3.00">$3.00/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceSupervised">TSD (Sup):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="2.00">$2.00/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceUnsupervised">TSD (UnS):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="1.70">$1.70/car-day</span>
</div>
</div>
<div class="insurance-footer" data-i18n="insuranceProgressoDesc">Balanced cost & risk</div>
</div>
</label>
<label class="insurance-card allstat">
<input type="radio" name="insurance" value="AllStat">
<div class="insurance-content">
<div class="insurance-header">
<h3 data-i18n="insuranceAllStat">AllStat</h3>
<div class="rejection-badge" data-i18n="insuranceRejectionRate" data-rate="5">5% Rejection</div>
</div>
<div class="insurance-rates">
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceManual">Manual:</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="4.00">$4.00/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceSupervised">TSD (Sup):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="2.50">$2.50/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceUnsupervised">TSD (UnS):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="2.00">$2.00/car-day</span>
</div>
</div>
<div class="insurance-footer" data-i18n="insuranceAllStatDesc">Premium service, low risk</div>
</div>
</label>
<label class="insurance-card lemonaid">
<input type="radio" name="insurance" value="LemonAid">
<div class="insurance-content">
<div class="insurance-header">
<h3 data-i18n="insuranceLemonAid">LemonAid</h3>
<div class="rejection-badge" data-i18n="insuranceRejectionRate" data-rate="5">5% Rejection</div>
</div>
<div class="insurance-rates">
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceManual">Manual:</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="5.00">$5.00/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceSupervised">TSD (Sup):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="1.50">$1.50/car-day</span>
</div>
<div class="rate-item">
<span class="rate-label" data-i18n="insuranceUnsupervised">TSD (UnS):</span>
<span class="rate-value" data-i18n="insuranceCostPerDay" data-cost="1.00">$1.00/car-day</span>
</div>
</div>
<div class="insurance-footer" data-i18n="insuranceLemonAidDesc">TSD-focused pricing</div>
</div>
</label>
</div>
</div>
<div class="panel full-width">
<div class="section-title" data-i18n="instructionsTitle">Instructions & TSD Info</div>
<div class="instructions-grid">
<div class="instruction-card">
<div class="instruction-icon">🚗</div>
<h4 data-i18n="noTSDTitle">No TSD</h4>
<p data-i18n="noTSDDesc">1h drive = 1h player time</p>
</div>
<div class="instruction-card">
<div class="instruction-icon">👀</div>
<h4 data-i18n="supervisedTitle">TSD (Supervised)</h4>
<p data-i18n="supervisedDesc">1h drive = 0.5h player time</p>
</div>
<div class="instruction-card">
<div class="instruction-icon">🤖</div>
<h4 data-i18n="unsupervisedTitle">TSD (Unsupervised)</h4>
<p data-i18n="unsupervisedDesc">1h drive = 0h player time</p>
</div>
<div class="instruction-card">
<div class="instruction-icon">🔓</div>
<h4 data-i18n="unlockTitle">Unlock Requirements</h4>
<p data-i18n="unlockDesc">Unsupervised TSD requires owning at least 2 cars</p>
</div>
</div>
</div>
</div>
</main>
<script>
(function(){
const LANG_STRINGS = {
en: {
appTitle: "Robotaxi Simulator - Totally Self-Driving",
gameOverMsg: "Game Over! You went broke. Hit 'Reset' on the top right to start over.",
dayLabel: "Date",
cashLabel: "Cash:",
dailyExpenseLabel: "Daily Expense:",
playerHoursLabel: "Player Hours Left:",
carsOwnedLabel: "Cars Owned:",
paymentCycle: "Financing is paid daily. Once fully paid off, daily expense reduces.",
endDayBtn: "⏭ End Day",
yourCars: "Your Cars",
tableID: "ID",
tableCar: "Car",
tableHourRate: "$/hr",
tableTSD: "TSD",
tableCarHours: "Car H",
tableDriveHours: "Drive H",
tableDriveAction: "Drive",
tableCarActions: "Car Actions",
tableTSDActions: "TSD Actions",
tableSell: "Sell",
instructionsTitle: "Instructions & TSD Info",
noTSDTitle: "No TSD",
noTSDDesc: "1h drive = 1h player time",
supervisedTitle: "TSD (Supervised)",
supervisedDesc: "1h drive = 0.5h player time",
unsupervisedTitle: "TSD (Unsupervised)",
unsupervisedDesc: "1h drive = 0h player time",
unlockTitle: "Unlock Requirements",
unlockDesc: "Unsupervised TSD requires owning at least 2 cars",
buyMoreCars: "Buy More Cars",
selectModel: "Select Model:",
fullPrice: "Full Price:",
downPayment: "Down Payment:",
loanTerm: "Loan Term (Days):",
dailyCost: "Daily Cost (APR 120%):",
hourlyEarning: "Est. Hourly Earning:",
buySelectedModel: "Buy Selected Model",
tsdNone: "None",
tsdSupervised: "Supervised",
tsdUnsupervised: "Unsupervised",
subSupBtn: "Sub Sup(3.33/d)",
buySupBtn: "Buy Sup($8000)",
subUnSupBtn: "Sub UnSup($10/d)",
buyUnSupBtn: "Buy UnSup($24000)",
welcomeMsg: "Welcome to Robotaxi Simulator! 🚀 Manage your TSD per car and buy more cars!",
startCarMsg: "Alien Musk has given you a free Type Y taxi to start! He's watching closely - the fastest player to reach $1M might get invited to Mars for a lunch interview to run his Robotaxi department! 🚀",
invalidHoursMsg: "Invalid number of hours.",
notEnoughPlayerHoursMsg: "Not enough player hours left.",
driveCarMsg: "Drove {hours}h with {model} (#{id}, {tsd}), earned ${earnings}",
monthlyFeeMsg: "Subscription fees of ${amount} charged.",
brokeMsg: "You went broke! Game Over.",
dayEndedMsg: "Day ended. After expenses, you have ${cash}. Moving to Day {day}.",
subscribedSupMsg: "Car #{id}: TSD (Supervised) subscribed! ($3.33/day)",
boughtSupMsg: "Car #{id}: TSD (Supervised) bought out ($8000)!",
subscribedUnSupMsg: "Car #{id}: TSD (Unsupervised) subscribed! ($10/day)",
boughtUnSupMsg: "Car #{id}: TSD (Unsupervised) bought out ($24000)!",
cannotSubSupMsg: "Cannot subscribe TSD (Supervised) for this car.",
cannotBuySupMsg: "Cannot buy TSD (Supervised) for this car.",
cannotSubUnSupMsg: "Cannot subscribe TSD (Unsupervised) for this car.",
cannotBuyUnSupMsg: "Cannot buy TSD (Unsupervised) for this car.",
noModelSelectedMsg: "No model selected.",
noCashForDownMsg: "Not enough cash for down payment.",
brokeBuyMsg: "You are broke and cannot buy cars.",
purchasedCarMsg: "You purchased a {model}(#{id}){tsdInfo} for a down payment of ${down}. Daily cost: ${daily} for {term} days.",
sellConfirmMsg: "Sell {model}(#{id})?\nCar cost: ${carCost}\nTSD Buyout: ${tsdBuyout}\nTotal: ${total}\nSale price: ${salePrice}\nConfirm?",
driveUnsupervisedBtn: "Drive Unsupervised Fleet",
dayTemplate: "Day {day}",
chartTitle: "Daily Cash Flow",
minDownPaymentMsg: "Minimum down payment is 30% of the car price.",
currentInsurance: "Current Insurance",
currentInsuranceNone: "None",
insuranceGeckGo: "GeckGo",
insuranceProgresso: "Progresso",
insuranceAllStat: "AllStat",
insuranceLemonAid: "LemonAid",
businessExpenseMsg: "Unexpected Event ({cars} cars): {reason}! {insurance} {status}",
businessNoInsuranceMsg: "Unexpected Event ({cars} cars): {reason}! No insurance. Paid ${cost}",
insuranceRejected: "rejected claim. Paid full amount ${cost}",
insuranceApproved: "approved - covered ${covered}, you paid deductible ${deductible}",
personalExpenseMsg: "Unexpected Event: {reason}! Paid ${cost}",
personalReasons: [
"Your cat ordered luxury cat food on your phone while you were sleeping",
"Accidentally joined a premium cheese-of-the-month club",
"Had to buy a new phone after dropping yours while taking a selfie with a squirrel",
"Bought a 'learn to yodel' course that was non-refundable",
"Invested in a startup selling tiny hats for pigeons",
"Joined an exclusive cucumber appreciation society",
"Purchased a collection of vintage rubber ducks",
"Enrolled in a professional unicorn drawing workshop",
"Bought a time machine on eBay (turned out to be a microwave)",
"Sponsored a professional competitive napping athlete",
"Invested in a silent disco for introverted plants",
"Bought a premium subscription to a cloud-naming service",
"Enrolled in a masterclass on professional sock puppet theater",
"Purchased a luxury air guitar with invisible strings",
"Joined a premium meditation app for stressed goldfish"
],
businessReasons: [
"Car AI mistook a drive-through car wash for a waterpark adventure",
"Car tried to attend a robot dance competition during working hours",
"Vehicle GPS insisted on taking scenic routes through designer boutiques",
"Car AI developed an expensive coffee addiction at charging stations",
"Robot driver attempted to enter a self-driving demolition derby",
"Car insisted on premium fuel after watching luxury car commercials",
"Vehicle attempted to join a street racing flash mob",
"Car AI subscribed to unnecessary premium parking spots",
"Robot driver got scammed by a fake robot insurance salesman",
"Car tried to upgrade itself with unnecessary RGB lighting",
"Vehicle insisted on premium eco-friendly synthetic oil",
"Car AI enrolled in unnecessary defensive driving courses",
"Robot driver fell for a 'download more RAM' scam",
"Car attempted to start a robot union for better working conditions",
"Vehicle bought unnecessary 'car cologne' from a suspicious vendor"
],
chooseInsurance: "Choose Fleet Insurance",
insuranceDescription: "Different insurers have different costs and rejection rates. Daily cost is per car. TSD reduces risks for business expenses.",
insuranceRejectionRate: "{rate}% Rejection",
insuranceManual: "Manual:",
insuranceSupervised: "TSD (Sup):",
insuranceUnsupervised: "TSD (UnS):",
insuranceCostPerDay: "${cost}/car-day",
insuranceGeckGoDesc: "Lower cost, higher risk",
insuranceProgressoDesc: "Balanced cost & risk",
insuranceAllStatDesc: "Premium service, low risk",
insuranceLemonAidDesc: "TSD-focused pricing",
victoryMsg: "Congratulations! You've reached $1M! Alien Musk might be calling soon about that Mars trip! 🚀",
progressTitle: "Road to $1M - Mars Trip Challenge",
progressValue: "0 / $1,000,000",
welcomeChallenge: "Welcome to Robotaxi Simulator! 🚀 Can you reach $1M as fast as possible? The fastest players might get invited by Alien Musk for a Mars trip!",
fleetOperationMsg: "Fleet operation complete! {cars} cars earned ${earnings}",
// Newly added localization keys:
originalDownPayment: "Original Down Payment",
tsdPayments: "TSD Buyout Paid",
loanPaidSoFar: "Loan Paid So Far",
discountRate: "Discount Rate",
finalSellingPrice: "Final Selling Price",
selectTSD: "TSD Configuration:",
tsdConfigNone: "No TSD",
tsdConfigSubSupervised: "Subscribe Supervised ($3.33/day)",
tsdConfigSubUnsupervised: "Subscribe Unsupervised ($10/day)",
tsdConfigBuySupervised: "Buy Supervised ($8000)",
tsdConfigBuyUnsupervised: "Buy Unsupervised ($24000)",
resetBtn: "Reset",
resetConfirm: "Are you sure you want to reset? All progress will be lost.",
swipeHint: "← Swipe to see more →",
},
cn: {
appTitle: "机器人出租车模拟器 - 全自动驾驶",
gameOverMsg: "游戏结束!你破产了。点击右上角的'Reset'以重新开始。",
dayLabel: "日期",
cashLabel: "现金:",
dailyExpenseLabel: "每日支出:",
playerHoursLabel: "玩家剩余时间:",
carsOwnedLabel: "车辆拥有:",
paymentCycle: "融资每日支付。一旦完全还清,每日支出减少。",
endDayBtn: "结束今天",
yourCars: "您的车辆",
tableID: "ID",
tableCar: "车辆",
tableHourRate: "$/小时",
tableTSD: "TSD",
tableCarHours: "车辆小时",
tableDriveHours: "驾驶时间",
tableDriveAction: "驾驶",
tableCarActions: "车辆操作",
tableTSDActions: "TSD操作",
tableSell: "出售",
instructionsTitle: "说明和TSD信息",
noTSDTitle: "无TSD",
noTSDDesc: "1小时驾驶=1小时玩家时间",
supervisedTitle: "TSD(监督)",
supervisedDesc: "1小时驾驶=0.5小时玩家时间",
unsupervisedTitle: "TSD(非监督)",
unsupervisedDesc: "1小时驾驶=0小时玩家时间",
unlockTitle: "解锁要求",
unlockDesc: "非监督TSD需要拥有至少2辆车",
buyMoreCars: "购买更多车辆",
selectModel: "选择模型:",
fullPrice: "全价:",
downPayment: "首付:",
loanTerm: "贷款期限(天):",
dailyCost: "每日成本(APR 120%):",
hourlyEarning: "估计每小时收入:",
buySelectedModel: "购买选定的模型",
tsdNone: "无",
tsdSupervised: "监督",
tsdUnsupervised: "非监督",
subSupBtn: "Sub Sup(3.33/d)",
buySupBtn: "Buy Sup($8000)",
subUnSupBtn: "Sub UnSup($10/d)",
buyUnSupBtn: "Buy UnSup($24000)",
welcomeMsg: "欢迎使用机器人出租车模拟器!🚀 管理您的TSD每辆车并购买更多车辆!",
startCarMsg: "外星马斯克送了你一辆免费的Type Y出租车!他正密切关注 - 最快达到100万美的玩家可能会被邀请到火星共进午餐,并讨论加入他的机器人出租车部门!🚀",
invalidHoursMsg: "无效的小时数。",
notEnoughPlayerHoursMsg: "玩家时间不足。",
driveCarMsg: "驾驶了{hours}小时{model}(#{id},{tsd}),赚取了${earnings}。",
monthlyFeeMsg: "每月收取${amount}的费用。",
brokeMsg: "你破产了!游戏结束。",
dayEndedMsg: "今天结束。在费用后,你有${cash}。移动到第{day}天。",
subscribedSupMsg: "车辆#{id}:TSD(监督)已订阅!(每天$3.33)",
boughtSupMsg: "车辆#{id}:TSD(监督)已购买!($8000)",
subscribedUnSupMsg: "车辆#{id}:TSD(非监督)已订阅!(每天$10)",
boughtUnSupMsg: "车辆#{id}:TSD(非监督)已购买!($24000)",
cannotSubSupMsg: "无法订阅TSD(监督)此车辆。",
cannotBuySupMsg: "无法购买TSD(监督)此车辆。",
cannotSubUnSupMsg: "无法订阅TSD(非监督)此车辆。",
cannotBuyUnSupMsg: "无法购买TSD(非监督)此车辆。",
noModelSelectedMsg: "没有选择模型。",
noCashForDownMsg: "现金不足首付。",
brokeBuyMsg: "你破产了,无法购买车辆。",
purchasedCarMsg: "你以${down}首付购买了{model}(#{id}){tsdInfo}。每日成本:${daily},为期{term}天。",
sellConfirmMsg: "出售{model}(#{id})?\n车辆成本:${carCost}\nTSD购买:${tsdBuyout}\n总计:${total}\n销售价格:${salePrice}\n确认?",
driveUnsupervisedBtn: "驾驶非监督车辆",
dayTemplate: "第{day}天",
chartTitle: "每日现金流量",
minDownPaymentMsg: "最低首付为车辆价格的30%。",
currentInsurance: "当前保险",
currentInsuranceNone: "无",
insuranceGeckGo: "壁虎保险",
insuranceProgresso: "进步保险",
insuranceAllStat: "全州保险",
insuranceLemonAid: "柠檬保险",
businessExpenseMsg: "意外事件({cars}辆车):{reason}!{insurance} {status}",
businessNoInsuranceMsg: "意外事件({cars}辆车):{reason}!无保险。支付${cost}",
insuranceRejected: "拒绝理赔。支付全额${cost}",
insuranceApproved: "已批准 - 承保${covered},您支付免赔额${deductible}",
personalExpenseMsg: "意外事件:{reason}!支付${cost}",
personalReasons: [
"你的猫在你睡觉时用手机订购了豪华猫粮",
"不小心加入了高级奶酪月度订阅俱乐部",
"和松鼠自拍时摔坏了手机不得不买新的",
"购买了不可退款的'瑞士山地呼啸'课程",
"投资了一家为鸽子制作小帽子的创业公司",
"加入了一个高级黄瓜鉴赏协会",
"购买了一套复古橡皮鸭收藏",
"报名参加了专业独角兽绘画工作坊",
"在淘宝买了个时光机(结果是个微波炉)",
"赞助了一位职业午睡运动员",
"投资了一个面向内向植物的无声迪斯科",
"订阅了一个云朵命名高级服务",
"报名参加了专业袜子木偶剧大师班",
"购买了一把豪华隐形弦空气吉他",
"为焦虑的金鱼订阅了高级冥想应用"
],
businessReasons: [
"车载AI把自动洗车房当成了水上乐园",
"车子试图在工作时间参加机器人舞蹈比赛",
"车载导航坚持开车经过奢侈品商店",
"车载AI在充电站养成了昂贵的咖啡瘾",
"机器人司机试图参加无人驾驶碰碰车比赛",
"看了豪车广告后车子坚持要加高级燃料",
"车辆试图加入街头飙车快闪族",
"车载AI订阅了不必要的高级停车位",
"机器人司机被假机器人保险推销员骗了",
"车子试图给自己安装不必要的RGB灯光",
"车辆坚持使用高级环保合成机油",
"车载AI报名了不必要的防御性驾驶课程",
"机器人司机上当'下载更多内存'的骗局",
"车子试图成立机器人工会争取更好待遇",
"车辆从可疑小贩那里买了不必要的'车载香水'"
],
chooseInsurance: "选择车队保险",
insuranceDescription: "不同保险公司有不同的费率和拒赔率。每日费用按车计算。TSD可降低商业风险。",
insuranceRejectionRate: "{rate}% 拒赔率",
insuranceManual: "人工:",
insuranceSupervised: "有监督TSD:",
insuranceUnsupervised: "无监督TSD:",
insuranceCostPerDay: "$${cost}/车天",
insuranceGeckGoDesc: "低成本,高风险",
insuranceProgressoDesc: "成本风险均衡",
insuranceAllStatDesc: "优质服务,低风险",
insuranceLemonAidDesc: "TSD优惠定价",
victoryMsg: "恭喜你达到了$1M!外星人马斯克可能很快就会联系你关于火星之旅!🚀",
progressTitle: "火星之旅挑战",
progressValue: "0 / $1,000,000",
welcomeChallenge: "欢迎来到机器人出租车模拟器!🚀 看看你能多快达到100万美元?最快的玩家可能会被外星马斯克邀请去火星旅游!",
fleetOperationMsg: "车队运营完成!{cars}辆车赚取了${earnings}",
// Newly added localization keys:
originalDownPayment: "原始首付",
tsdPayments: "已支付的TSD买断费用",
loanPaidSoFar: "迄今还款额",
discountRate: "折扣率",
finalSellingPrice: "最终出售价格",
selectTSD: "TSD配置:",
tsdConfigNone: "无TSD",
tsdConfigSubSupervised: "订阅监督模式 ($3.33/天)",
tsdConfigSubUnsupervised: "订阅无监督模式 ($10/天)",
tsdConfigBuySupervised: "购买监督模式 ($8000)",
tsdConfigBuyUnsupervised: "购买无监督模式 ($24000)",
resetBtn: "重置",
resetConfirm: "确定要重置游戏吗?所有进度将被清除。",
swipeHint: "← 左右滑动以查看更多 →",
}
};
const CONFIG = {
baseDailyExpense: 100,
playerDailyHours: 8,
carDailyHours: 16,
apr: 1.20,
supervisedDailySub: 100/30,
unsupervisedDailySub: 300/30,
fleetModels: [
{ name: "Type S", cost: 75000 },
{ name: "Type 3", cost: 40000 },
{ name: "Type X", cost: 100000 },
{ name: "Type Y", cost: 45000 },
{ name: "FutureCab", cost: 25000 },
{ name: "FutureTruck", cost: 80000 }
],
subscriptionCosts: {
supervised: 100,
unsupervised: 300
},
buyoutCosts: {
supervised: 8000,
unsupervised: 24000
},
insuranceOptions: {
"GeckGo": {
rejectionRate: 0.15,
costs: [20.00, 18.00, 15.00]
},
"Progresso": {
rejectionRate: 0.10,
costs: [30.00, 20.00, 17.00]
},
"AllStat": {
rejectionRate: 0.05,
costs: [40.00, 25.00, 20.00]
},
"LemonAid": {
rejectionRate: 0.05,
costs: [50.00, 15.00, 10.00]
}
},
personalExpenseChance: 0.2,
personalBaseRange: [50, 300],
businessExpenseChanceBase: 0.1,
businessBaseRange: [500, 3000],
insuranceDeductible: 0.2
};
CONFIG.fleetModels.forEach(m => {
m.dailyIncome = m.cost * 0.0104;
});
let savedState = JSON.parse(localStorage.getItem('robotaxiState')) || {};
let currentLang = savedState.currentLang || 'en';
let day = savedState.day || 1;
let cash = savedState.cash || 0;
let playerHours = savedState.playerHours || CONFIG.playerDailyHours;
let cars = savedState.cars || [];
let logs = savedState.logs || [];
let nextCarId = savedState.nextCarId || 1;
let previousCash = savedState.previousCash !== undefined ? savedState.previousCash : cash;
let currentInsurance = savedState.currentInsurance || null;
// Add to the savedState initialization
let savedTsdConfig = savedState.savedTsdConfig || 'none';
// Add after fleetModelSelect initialization
const tsdConfigSelect = document.getElementById('tsdConfigSelect');
tsdConfigSelect.value = savedTsdConfig;
// Add event listener for TSD config changes
tsdConfigSelect.addEventListener('change', function() {
savedTsdConfig = tsdConfigSelect.value;
saveState();
updateFinanceDisplay();
});
// Data Migration for old saves:
cars.forEach(car => {
if (car.downPayment === undefined) {
let model = CONFIG.fleetModels.find(m => m.name === car.modelName);
if (model) {
// If the car is not financed or loan term is complete, down payment was the full price
if (!car.financed || (car.loanTermDays && car.daysPaid >= car.loanTermDays)) {
car.downPayment = model.cost;
} else {
car.downPayment = model.cost * 0.3;
}
} else {
car.downPayment = 0;
}
}
if (car.originalCost === undefined) {
let model = CONFIG.fleetModels.find(m => m.name === car.modelName);
car.originalCost = model ? model.cost : 0;
}
});
const dayEl = document.getElementById('day');
const cashEl = document.getElementById('cash');
const dailyExpenseEl = document.getElementById('dailyExpense');
const playerHoursEl = document.getElementById('playerHours');
const numCarsEl = document.getElementById('numCars');
const logEl = document.getElementById('log');
const endDayBtn = document.getElementById('endDayBtn');
const fleetModelSelect = document.getElementById('fleetModelSelect');
const buyFleetBtn = document.getElementById('buyFleetBtn');
const downPaymentRange = document.getElementById('downPaymentRange');
const downPaymentValue = document.getElementById('downPaymentValue');
const carListBody = document.getElementById('car-list-body');
const gameOverMsg = document.getElementById('gameOverMsg');
const fullPriceDisplay = document.getElementById('fullPriceDisplay');
const dailyEarningDisplay = document.getElementById('dailyEarningDisplay');
const loanTermRange = document.getElementById('loanTermRange');
const loanTermValue = document.getElementById('loanTermValue');
const dailyCostDisplay = document.getElementById('dailyCostDisplay');
const driveUnsupervisedBtn = document.getElementById('driveUnsupervisedBtn');
const langToggle = document.getElementById('langToggle');
const resetBtn = document.getElementById('resetBtn');
let cashflowData = savedState.cashflowData || {
labels: ['Day 1'],
datasets: [{
label: 'Daily Cash Flow',
data: [0],
borderColor: '#4834d4',
backgroundColor: 'rgba(72, 52, 212, 0.1)',
fill: true,
tension: 0.4
}]
};
const ctx = document.getElementById('cashflowChart').getContext('2d');
const cashflowChart = new Chart(ctx, {
type: 'line',
data: cashflowData,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: LANG_STRINGS[currentLang].chartTitle,
color: '#4834d4',
font: {
size: 16,
weight: 500
}
}
},
scales: {
y: {
beginAtZero: true,
grid: {
color: 'rgba(0, 0, 0, 0.05)'
}
},
x: {
grid: {
display: false
}
}
}
}
});
function trimChartData() {
const MAX_DAYS = 30;
if (cashflowData.labels.length > MAX_DAYS) {
cashflowData.labels = cashflowData.labels.slice(-MAX_DAYS);
cashflowData.datasets[0].data = cashflowData.datasets[0].data.slice(-MAX_DAYS);
}
}
function saveState() {
const state = {
currentLang,
day,
cash,
playerHours,
cars,
logs,
nextCarId,
previousCash,
cashflowData,
currentInsurance,
savedTsdConfig: savedTsdConfig
};
localStorage.setItem('robotaxiState', JSON.stringify(state));
}
function translateUI() {
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (key === 'insuranceRejectionRate') {
const rate = el.getAttribute('data-rate');
el.textContent = getLocalizedMsg(key, {rate: rate});
} else if (key === 'insuranceCostPerDay') {
const cost = el.getAttribute('data-cost');
el.textContent = getLocalizedMsg(key, {cost: cost});
} else {
el.textContent = LANG_STRINGS[currentLang][key];
}
});
// Add translation for reset button
resetBtn.textContent = LANG_STRINGS[currentLang].resetBtn;
}
function getLocalizedMsg(key, params={}){
let str = LANG_STRINGS[currentLang][key] || key;
for (let p in params){
str = str.replace(`{${p}}`, params[p]);
}
return str;
}
function getCarDailySubscription(car) {
if (car.unsupervisedOwned) return 0;
if (car.supervisedOwned) return 0;
if (car.unsupervisedSubscribed) return CONFIG.unsupervisedDailySub;
if (car.supervisedSubscribed) return CONFIG.supervisedDailySub;
return 0;
}
function getAverageTsdLevel(){
if(cars.length===0) return 0;
let sum = 0;
cars.forEach(c=>sum+=c.tsdLevel);
return sum / cars.length;
}
function getInsuranceDailyCostPerCar(){
if(!currentInsurance) return 0;
let avgTsd = getAverageTsdLevel();
let level = 0;
if(avgTsd>=1.5) level = 2;
else if(avgTsd>=0.5) level = 1;
else level = 0;
const option = CONFIG.insuranceOptions[currentInsurance];
return option.costs[level];
}
function getTotalDailyExpense(){
let financeSum = 0;
cars.forEach(car => {
financeSum += car.dailyPayment;
financeSum += getCarDailySubscription(car);
});
let insuranceCost = getInsuranceDailyCostPerCar() * cars.length;
return CONFIG.baseDailyExpense + financeSum + insuranceCost;
}
function updateUI(){
const template = LANG_STRINGS[currentLang].dayTemplate;
dayEl.textContent = template.replace('{day}', day);
cashEl.textContent = cash.toFixed(2);
dailyExpenseEl.textContent = getTotalDailyExpense().toFixed(2);
playerHoursEl.textContent = playerHours;
numCarsEl.textContent = cars.length;
updateFinanceDisplay();
renderCarList();
updateDriveUnsupervisedButton();
saveState();
const progressPercent = Math.min((cash / 1000000) * 100, 100);
document.getElementById('progressValue').textContent = Math.floor(cash).toLocaleString();
document.getElementById('progressFill').style.width = progressPercent + '%';
const victoryMsg = document.getElementById('victoryMsg');
if (cash >= 1000000 && victoryMsg.style.display !== 'block') {
victoryMsg.style.display = 'block';
gtag('event', 'victory', {
days_taken: day
});
}
}
function logMessage(key, emoji="ℹ️", params={}){
logs.push({key, emoji, params});
renderLogs();
saveState();
}
function renderLogs(){
logEl.innerHTML = '';
logs.forEach((entry) => {
const msg = getLocalizedMsg(entry.key, entry.params);
const div = document.createElement('div');
div.className = 'log-entry';
div.innerHTML = `<span class="emoji">${entry.emoji}</span> ${msg}`;
logEl.appendChild(div);
});
logEl.scrollTop = logEl.scrollHeight;
}
function getSelectedModel(){
const index = fleetModelSelect.selectedIndex;
if(index<0) return null;
return CONFIG.fleetModels[index];
}
function getTSDName(level){
if(level===0) return LANG_STRINGS[currentLang].tsdNone;
if(level===1) return LANG_STRINGS[currentLang].tsdSupervised;
if(level===2) return LANG_STRINGS[currentLang].tsdUnsupervised;
}
function getPlayerHourConsumption(tsdLevel, hoursDriven){
if(tsdLevel === 0) return hoursDriven;
if(tsdLevel === 1) return Math.ceil(hoursDriven * 0.5);
if(tsdLevel === 2) return 0;
}
function getMaxDriveHoursForCar(car){
let playerLimit;
if(car.tsdLevel === 0) {
playerLimit = playerHours;
} else if(car.tsdLevel === 1) {
playerLimit = 2 * playerHours;
} else {
playerLimit = Infinity;
}
return Math.min(car.carHoursLeft, playerLimit);
}
function attemptDrive(car, hoursToDrive) {
if(hoursToDrive <= 0 || hoursToDrive > car.carHoursLeft){
logMessage('invalidHoursMsg',"❌");
return false;
}
let neededPlayerHours = getPlayerHourConsumption(car.tsdLevel, hoursToDrive);
if(neededPlayerHours > playerHours){
logMessage('notEnoughPlayerHoursMsg',"❌");
return false;
}
playerHours -= neededPlayerHours;
car.carHoursLeft -= hoursToDrive;
let earnings = hoursToDrive * car.hourlyRate;
cash += earnings;
logMessage('driveCarMsg',"🚕",{hours: hoursToDrive, model:car.modelName, id:car.id, tsd:getTSDName(car.tsdLevel), earnings:earnings.toFixed(2)});
updateUI();
return true;
}
function addDriveListeners(tr, car){
const driveBtn = tr.querySelector(`#fleet-driveCar-${car.id}`);
const hoursInput = tr.querySelector(`#fleet-driveHours-${car.id}`);
const hoursValueLabel = tr.querySelector(`#fleet-driveValue-${car.id}`);
const maxHours = getMaxDriveHoursForCar(car);
hoursInput.max = maxHours.toString();
function updateValueLabel(){
hoursValueLabel.textContent = hoursInput.value + "h";
}
hoursInput.addEventListener('input', updateValueLabel);
driveBtn.addEventListener('click', () => {
let hoursToDrive = parseInt(hoursInput.value) || 0;
attemptDrive(car, hoursToDrive);
});
updateValueLabel();
}
function addTSDListeners(td, car) {
const superviseSubBtn = td.querySelector(`.supervise-sub-${car.id}`);
const superviseBuyBtn = td.querySelector(`.supervise-buy-${car.id}`);
const unsuperviseSubBtn = td.querySelector(`.unsupervise-sub-${car.id}`);
const unsuperviseBuyBtn = td.querySelector(`.unsupervise-buy-${car.id}`);
function canSubscribeSupervised(){
return car.tsdLevel===0 && !car.supervisedOwned && !car.supervisedSubscribed;
}
function canBuySupervised(){
return car.tsdLevel===0 && !car.supervisedOwned && !car.supervisedSubscribed && cash>=CONFIG.buyoutCosts.supervised;
}
function canSubscribeUnsupervised(){
return car.tsdLevel<2 && !car.unsupervisedOwned && !car.unsupervisedSubscribed && cars.length >= 2;
}
function canBuyUnsupervised(){