-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfertilizer.html
More file actions
2127 lines (1851 loc) · 63.2 KB
/
Copy pathfertilizer.html
File metadata and controls
2127 lines (1851 loc) · 63.2 KB
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 class="no-js">
<head>
<meta charset="utf-8"/>
<!-- Remove the next script block to serve this page instead of redirecting to Fertilator -->
<script>
(function () {
if (location.protocol === 'http:' || location.protocol === 'https:') {
location.replace('/fertilator');
}
})();
</script>
<link rel="canonical" href="/fertilator" />
<title>Fertilizer - ehryk.github.com</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/ -->
<meta name="description" content="Fertilizer" />
<meta name="keywords" content="Fertilizer,Ehryk" />
<meta name="author" content="Eric Menze" />
<meta property="og:url" content="http://ehryk.github.com/fertilizer.html" />
<meta property="og:title" content="Fertilizer - ehryk.github.com" />
<meta property="og:image" content="img/Ehryk.png" />
<meta property="og:description" content="Fertilizer" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" media="all" href="css/main.css"/>
<style>
:root {
--page-max-width: 1500px;
}
.selectors {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 1.5rem;
margin: 1rem auto 1.5rem;
max-width: var(--page-max-width);
}
.toggle-selector {
position: relative;
display: inline-flex;
background: rgba(0, 0, 0, 0.35);
border-radius: 999px;
padding: 4px;
border: 1px solid #444;
}
.toggle-selector button {
position: relative;
z-index: 1;
background: transparent;
border: none;
color: #99CCFF;
cursor: pointer;
padding: 0.55rem 1.1rem;
font-family: Arial, sans-serif;
font-size: 14px;
white-space: nowrap;
transition: color 0.2s ease;
}
.toggle-selector button:hover {
color: #FF8800;
}
.toggle-selector button.active {
color: #fff;
}
.toggle-selector button.active:hover {
color: #fff;
}
.toggle-slider {
position: absolute;
top: 4px;
left: 4px;
height: calc(100% - 8px);
background: #920E15;
border-radius: 999px;
transition: transform 0.25s ease, width 0.25s ease;
z-index: 0;
pointer-events: none;
}
.fertilizer-table-wrap {
max-width: var(--page-max-width);
margin: 0 auto 2rem;
padding: 0 1rem;
}
.fertilizer-table-wrap h3 {
font-size: 18px;
margin: 0 0 0.75rem;
}
.fertilizer-table {
width: 100%;
border-collapse: collapse;
font-family: Arial, sans-serif;
font-size: 14px;
}
.fertilizer-table th,
.fertilizer-table td {
border: 1px solid #555;
padding: 0.5rem 0.65rem;
text-align: center;
vertical-align: middle;
}
.fertilizer-table th {
background: rgba(0, 0, 0, 0.45);
font-weight: 600;
}
.fertilizer-table td.stage-number {
text-align: center;
font-weight: 600;
width: 2.5rem;
min-width: 2.5rem;
white-space: nowrap;
}
.fertilizer-table td.stage-label {
text-align: left;
white-space: nowrap;
min-width: 9rem;
}
.fertilizer-table tbody tr:nth-child(even) {
background: rgba(0, 0, 0, 0.2);
}
.fertilizer-table tfoot td {
background: rgba(0, 0, 0, 0.45);
font-weight: 600;
}
.fertilizer-table tfoot td.stage-label {
text-align: center;
}
.fertilizer-table tfoot td.total-ok {
color: #8f8;
}
.fertilizer-table tfoot td.total-warn {
color: #f88;
}
.fertilizer-table.output-table tfoot td.foot-output-season-total {
color: #9f9;
font-weight: 700;
}
.fertilizer-table.seasonal-targets-table tfoot td.seasonal-targets-total {
color: #9f9;
font-weight: 700;
}
.fertilizer-table.seasonal-targets-table tfoot td.stage-label {
text-align: center;
}
.fertilizer-table.product-table tfoot td.foot-season-result {
color: #99CCFF;
font-weight: 700;
}
.fertilizer-table.product-table tfoot td.foot-post-plant-max {
color: #ffc285;
font-weight: 700;
}
.fertilizer-table.product-table tfoot td.foot-product-max {
color: #f99;
font-weight: 700;
}
.fertilizer-table.nutrient-totals-table td.stage-label {
text-align: center;
}
.fertilizer-table.nutrient-totals-table tbody tr.row-target td {
color: #9f9;
font-weight: 700;
}
.fertilizer-table.nutrient-totals-table tbody tr.row-result td {
color: #99CCFF;
font-weight: 700;
}
.fertilizer-table.nutrient-totals-table tbody tr.row-maximum td {
color: #f99;
font-weight: 700;
}
.pct-input {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.15rem;
}
.pct-input input {
width: 3.25rem;
padding: 0.25rem 0.35rem;
border: 1px solid #666;
border-radius: 4px;
background: rgba(255, 255, 255, 0.9);
color: #222;
text-align: right;
font-size: 14px;
}
.pct-input input:focus {
outline: 2px solid #99CCFF;
border-color: #99CCFF;
}
.pct-input span {
color: #ccc;
font-size: 13px;
}
.unit-controls {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 1.5rem;
max-width: var(--page-max-width);
margin: 0 auto 2rem;
padding: 0 1rem;
}
#unit-selector button {
font-size: 13px;
padding: 0.5rem 0.85rem;
}
.row-length-field {
display: inline-flex;
align-items: center;
gap: 0.5rem;
font-family: Arial, sans-serif;
font-size: 14px;
color: #fff;
white-space: nowrap;
}
.row-length-field input {
width: 4.5rem;
padding: 0.35rem 0.5rem;
border: 1px solid #666;
border-radius: 4px;
background: rgba(255, 255, 255, 0.9);
color: #222;
text-align: right;
font-size: 14px;
}
.row-length-field input:focus {
outline: 2px solid #99CCFF;
border-color: #99CCFF;
}
.season-totals-wrap {
max-width: var(--page-max-width);
margin: 0 auto 1.5rem;
padding: 0 1rem;
}
.season-totals-wrap h3 {
font-size: 18px;
margin: 0 0 0.75rem;
}
.season-totals {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.75rem 1.25rem;
}
.season-total-field {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-family: Arial, sans-serif;
font-size: 14px;
color: #fff;
}
.season-total-field input {
width: 4.5rem;
padding: 0.35rem 0.5rem;
border: 1px solid #666;
border-radius: 4px;
background: rgba(255, 255, 255, 0.9);
color: #222;
text-align: right;
font-size: 14px;
}
.season-total-field input:focus {
outline: 2px solid #99CCFF;
border-color: #99CCFF;
}
.output-table-wrap {
max-width: var(--page-max-width);
margin: 0 auto 2rem;
padding: 0 1rem;
}
.output-table-wrap h3 {
font-size: 18px;
margin: 0 0 0.75rem;
}
.fertilizer-table.output-table td.amount-cell,
.fertilizer-table.product-table td.amount-cell {
font-variant-numeric: tabular-nums;
}
.fertilizer-table.product-table th {
white-space: normal;
line-height: 1.25;
}
.row-dimension-field.is-hidden,
.row-length-dimension-field.is-hidden {
display: none;
}
.spec-panel-wrap {
max-width: var(--page-max-width);
margin: 0 auto 1.5rem;
padding: 0 1rem;
}
.spec-panel {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.25rem;
font-family: Arial, sans-serif;
font-size: 14px;
}
.fertilizer-table-wrap,
.output-table-wrap,
.product-table-wrap,
.spec-card {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
@media (max-width: 960px) {
.spec-panel {
grid-template-columns: 1fr;
}
}
@media (max-width: 768px) {
h1 {
font-size: 2rem;
margin: 0.75rem 0 1rem;
padding: 0 0.5rem;
line-height: 1.1;
}
.selectors,
.unit-controls {
flex-direction: column;
align-items: stretch;
gap: 1rem;
margin-bottom: 1.25rem;
padding: 0 0.75rem;
}
.toggle-selector {
display: flex;
width: 100%;
max-width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.toggle-selector button {
flex: 1 1 auto;
padding: 0.55rem 0.75rem;
font-size: 12px;
line-height: 1.25;
min-height: 2.75rem;
}
#unit-selector button {
flex: 0 0 auto;
font-size: 11px;
padding: 0.5rem 0.65rem;
white-space: nowrap;
}
#stage-selector button {
white-space: normal;
}
.fertilizer-table-wrap,
.output-table-wrap,
.season-totals-wrap,
.spec-panel-wrap,
.unit-controls {
padding: 0 0.75rem;
}
.spec-card {
padding: 0.85rem 0.75rem;
}
.fertilizer-table-wrap h3,
.output-table-wrap h3,
.season-totals-wrap h3 {
font-size: 1rem;
}
.fertilizer-table {
font-size: 12px;
}
.fertilizer-table th,
.fertilizer-table td {
padding: 0.35rem 0.45rem;
}
.fertilizer-table td.stage-label {
white-space: normal;
min-width: 6.5rem;
max-width: 8.5rem;
font-size: 11px;
line-height: 1.3;
hyphens: auto;
}
.fertilizer-table.product-table th {
font-size: 10px;
padding: 0.35rem 0.3rem;
}
.fertilizer-table.sources-table {
min-width: 34rem;
}
.fertilizer-table.product-table {
min-width: 64rem;
}
.fertilizer-table.output-table,
.fertilizer-table.application-totals-table,
.fertilizer-table-wrap > .fertilizer-table {
min-width: 26rem;
}
.pct-input input,
.target-input,
.season-total-field input,
.row-length-field input {
font-size: 16px;
min-height: 2.25rem;
}
.season-totals {
justify-content: flex-start;
gap: 0.65rem 1rem;
}
.row-length-field {
justify-content: space-between;
width: 100%;
white-space: normal;
}
}
@media (max-width: 480px) {
.toggle-selector button {
font-size: 11px;
padding: 0.5rem 0.55rem;
}
#unit-selector button {
font-size: 10px;
}
}
.spec-card {
background: rgba(0, 0, 0, 0.3);
border: 1px solid #555;
border-radius: 8px;
padding: 1rem 1.15rem;
}
.spec-card h3 {
font-size: 16px;
margin: 0 0 0.75rem;
text-align: left;
}
.spec-card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
}
.spec-card-header h3 {
margin: 0;
}
.spec-card-header.is-spaced {
margin-top: 1rem;
}
.spec-expander {
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
padding: 0;
border: 1px solid #444;
border-radius: 999px;
background: rgba(0, 0, 0, 0.35);
color: #99CCFF;
font-size: 1.1rem;
line-height: 1;
cursor: pointer;
transition: color 0.2s ease, background 0.2s ease;
}
.spec-expander:hover {
color: #FF8800;
background: rgba(0, 0, 0, 0.5);
}
.spec-collapse-panel.is-collapsed {
display: none;
}
.spec-collapse-panel:not(.is-collapsed) {
margin-top: 0.75rem;
}
.spec-grid {
display: grid;
grid-template-columns: auto 1fr;
gap: 0.35rem 1rem;
margin: 0;
}
.spec-grid dt {
color: #99CCFF;
font-weight: 600;
margin: 0;
}
.spec-grid dd {
margin: 0;
color: #eee;
}
.sources-table {
width: 100%;
margin-top: 0.5rem;
}
.sources-table td:first-child {
text-align: left;
}
.seasonal-targets-table {
width: 100%;
margin-top: 0.5rem;
}
.seasonal-targets-table td:first-child {
text-align: left;
}
.target-input {
width: 4.5rem;
padding: 0.3rem 0.45rem;
border: 1px solid #666;
border-radius: 4px;
background: rgba(255, 255, 255, 0.9);
color: #222;
text-align: right;
font-size: 14px;
}
.target-input:focus {
outline: 2px solid #99CCFF;
border-color: #99CCFF;
}
th[data-nutrient-header],
.seasonal-targets-table td.stage-label[title],
.sources-table td.stage-label[title],
.product-table th[title],
.season-total-field[title] {
cursor: help;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<h1>Fertilator</h1>
<h5>Made by Eric and Arianne (not Kevin) - for more: <a href="https://github.com/Ehryk">github</a>, <a href="http://www.ericmenze.com/cv/portfolios/">portfolio</a>, or <a href="mailto:ehryk42@gmail.com">email</a>.</h5>
<div class="spec-panel-wrap">
<div class="spec-panel">
<div class="spec-card">
<div class="spec-card-header">
<h3>Growing Specifications</h3>
<button
type="button"
class="spec-expander"
id="growing-specs-expander"
aria-expanded="false"
aria-controls="growing-specs-panel"
aria-label="Expand Growing Specifications"
title="Expand Growing Specifications"
>+</button>
</div>
<div class="spec-collapse-panel is-collapsed" id="growing-specs-panel">
<dl class="spec-grid" id="growing-specs"></dl>
</div>
<div class="spec-card-header is-spaced">
<h3>Seasonal Targets</h3>
<button
type="button"
class="spec-expander"
id="seasonal-targets-expander"
aria-expanded="true"
aria-controls="seasonal-targets-panel"
aria-label="Collapse Seasonal Targets"
title="Collapse Seasonal Targets"
>−</button>
</div>
<div class="spec-collapse-panel" id="seasonal-targets-panel">
<table class="fertilizer-table seasonal-targets-table" id="seasonal-targets-table">
<thead>
<tr>
<th>Nutrient</th>
<th>Target (lb/acre)</th>
<th>Maximum (lb/acre)</th>
</tr>
</thead>
<tbody id="seasonal-targets-body"></tbody>
<tfoot>
<tr>
<td class="stage-label seasonal-targets-total">Total</td>
<td class="seasonal-targets-total" id="seasonal-targets-total-target"></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="spec-card">
<div class="spec-card-header">
<h3>Fertilizers</h3>
<button
type="button"
class="spec-expander"
id="fertilizers-expander"
aria-expanded="true"
aria-controls="fertilizers-panel"
aria-label="Collapse Fertilizers"
title="Collapse Fertilizers"
>−</button>
</div>
<div class="spec-collapse-panel" id="fertilizers-panel">
<table class="fertilizer-table sources-table" id="sources-table">
<thead>
<tr>
<th>Source</th>
<th>Analysis (N-P-K)</th>
<th>Maximum (lb/acre)</th>
<th>Post-Plant (lb/acre)</th>
</tr>
</thead>
<tbody id="sources-table-body"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="selectors">
<div class="toggle-selector" id="crop-selector" data-key="crop">
<button type="button" class="toggle-option active" data-value="everything-else">Everything Else</button>
<button type="button" class="toggle-option" data-value="tomatoes">Tomatoes</button>
<span class="toggle-slider" aria-hidden="true"></span>
</div>
<div class="toggle-selector" id="stage-selector" data-key="stage">
<button type="button" class="toggle-option active" data-value="normal">Normal (6-stage)</button>
<button type="button" class="toggle-option" data-value="extended">Extended (7-stage)</button>
<span class="toggle-slider" aria-hidden="true"></span>
</div>
</div>
<div class="fertilizer-table-wrap">
<h3>Stage Percentages</h3>
<table class="fertilizer-table" id="fertilizer-table">
<thead>
<tr>
<th colspan="2">Stage</th>
<th data-nutrient-header="N">N</th>
<th data-nutrient-header="P">P<sub>2</sub>O<sub>5</sub></th>
<th data-nutrient-header="K">K<sub>2</sub>O</th>
<th data-nutrient-header="Ca">Ca</th>
<th data-nutrient-header="Mg">Mg</th>
<th data-nutrient-header="S">S</th>
</tr>
</thead>
<tbody id="fertilizer-table-body"></tbody>
<tfoot>
<tr>
<td class="stage-label" colspan="2">Total Checks:</td>
<td id="total-N"></td>
<td id="total-P"></td>
<td id="total-K"></td>
<td id="total-Ca"></td>
<td id="total-Mg"></td>
<td id="total-S"></td>
</tr>
</tfoot>
</table>
</div>
<div class="unit-controls">
<div class="toggle-selector" id="unit-selector" data-key="unit">
<button type="button" class="toggle-option active" data-value="lb-acre">lb/acre</button>
<button type="button" class="toggle-option" data-value="grams-sqft">grams/square foot</button>
<button type="button" class="toggle-option" data-value="grams-linear-ft">grams/linear foot</button>
<button type="button" class="toggle-option" data-value="grams-row">grams/row</button>
<span class="toggle-slider" aria-hidden="true"></span>
</div>
<label class="row-length-field row-length-dimension-field" for="row-length">
Row Length (feet)
<input type="number" id="row-length" value="25" min="0" step="0.1" />
</label>
<label class="row-length-field row-dimension-field" for="row-width">
Bed Width (feet)
<input type="number" id="row-width" value="2.5" min="0" step="0.1" />
</label>
</div>
<div class="season-totals-wrap">
<h3>Season Totals (<span id="season-totals-unit-label">lb/acre</span>)</h3>
<div class="season-totals" id="season-totals"></div>
</div>
<div class="output-table-wrap">
<h3>Stage Targets (<span id="output-unit-label">lb/acre</span>)</h3>
<table class="fertilizer-table output-table" id="fertilizer-output-table">
<thead>
<tr>
<th colspan="2">Stage</th>
<th data-nutrient-header="N">N</th>
<th data-nutrient-header="P">P<sub>2</sub>O<sub>5</sub></th>
<th data-nutrient-header="K">K<sub>2</sub>O</th>
<th data-nutrient-header="Ca">Ca</th>
<th data-nutrient-header="Mg">Mg</th>
<th data-nutrient-header="S">S</th>
</tr>
</thead>
<tbody id="fertilizer-output-body"></tbody>
<tfoot>
<tr>
<td class="stage-label foot-output-season-total" colspan="2">Season Total</td>
<td id="output-total-N"></td>
<td id="output-total-P"></td>
<td id="output-total-K"></td>
<td id="output-total-Ca"></td>
<td id="output-total-Mg"></td>
<td id="output-total-S"></td>
</tr>
</tfoot>
</table>
</div>
<div class="output-table-wrap product-table-wrap">
<h3>Fertilizer Application (<span id="product-unit-label">lb/acre</span>)</h3>
<table class="fertilizer-table product-table" id="fertilizer-product-table">
<thead id="product-table-head"></thead>
<tbody id="product-table-body"></tbody>
<tfoot id="product-table-foot"></tfoot>
</table>
</div>
<div class="output-table-wrap">
<h3>Nutrient Totals (<span id="nutrient-totals-unit-label">lb/acre</span>)</h3>
<table class="fertilizer-table application-totals-table nutrient-totals-table" id="application-totals-table">
<thead>
<tr>
<th></th>
<th data-nutrient-header="N">N</th>
<th data-nutrient-header="P">P<sub>2</sub>O<sub>5</sub></th>
<th data-nutrient-header="K">K<sub>2</sub>O</th>
<th data-nutrient-header="Ca">Ca</th>
<th data-nutrient-header="Mg">Mg</th>
<th data-nutrient-header="S">S</th>
</tr>
</thead>
<tbody id="application-totals-body"></tbody>
</table>
</div>
<footer>
<hr />
<p>© Eric Menze 2026</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/jquery@4.0.0/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
<script>
(function () {
var NUTRIENTS = ['N', 'P', 'K', 'Ca', 'Mg', 'S'];
var SQFT_PER_ACRE = 43560;
var GRAMS_PER_LB = 453.59237;
var UNIT_LABELS = {
'lb-acre': 'lb/acre',
'grams-sqft': 'grams/square foot',
'grams-linear-ft': 'grams/linear foot',
'grams-row': 'grams/row'
};
var NUTRIENT_LABELS = {
N: 'N',
P: 'P<sub>2</sub>O<sub>5</sub>',
K: 'K<sub>2</sub>O',
Ca: 'Ca',
Mg: 'Mg',
S: 'S'
};
var NUTRIENT_INFO = {
N: 'Nitrogen drives leafy growth, proteins, and chlorophyll production.',
P: 'Phosphorus (as P₂O₅) supports root development, flowering, fruit set, and energy transfer.',
K: 'Potassium (as K₂O) regulates water balance, disease resistance, and fruit quality.',
Ca: 'Calcium strengthens cell walls and helps prevent blossom-end rot and tip burn.',
Mg: 'Magnesium is the core of chlorophyll and essential for photosynthesis.',
S: 'Sulfur supports protein and amino acid formation, flavor, and stress tolerance.'
};
var GROWING_SPECS = {
soilType: 'Silty Sandy Loam',
organicMatter: '>2%',
compost: 'Approximately 2.5 cubic feet incorporated',
bedWidthIn: 30,
rowCentersIn: 48,
plantSpacingIn: 24,
bedHeight: 'Raised 4–6 inches',
irrigation: 'Drip Irrigation',
fertigation: 'None',
applicationMethod: 'Manual Broadcast Applications'
};
var SEASONAL_TARGETS = [
{ key: 'N', label: 'Nitrogen (N)', target: 110, maxLbAcre: null },
{ key: 'P', label: 'Phosphate (P<sub>2</sub>O<sub>5</sub>)', target: 50, maxLbAcre: null },
{ key: 'K', label: 'Potash (K<sub>2</sub>O)', target: 200, maxLbAcre: null },
{ key: 'Ca', label: 'Calcium (Ca)', target: 120, maxLbAcre: null },
{ key: 'Mg', label: 'Magnesium (Mg)', target: 40, maxLbAcre: null },
{ key: 'S', label: 'Sulfur (S)', target: 40, maxLbAcre: 48 }
];
var FERTILIZER_SOURCES = [
{ name: 'Urea', formula: 'CO(NH₂)₂', description: 'Concentrated nitrogen fertilizer that converts to plant-available forms in soil.', analysis: '46-0-0', N: 46, P: 0, K: 0, Ca: 0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Monoammonium Phosphate (MAP)', formula: 'NH₄H₂PO₄', description: 'Water-soluble phosphorus with a small amount of ammonium nitrogen.', analysis: '11-52-0', N: 11, P: 52, K: 0, Ca: 0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: 0 },
{ name: 'Diammonium Phosphate (DAP)', formula: '(NH₄)₂HPO₄', description: 'Common blended-grade phosphorus and ammonium nitrogen source.', analysis: '18-46-0', N: 18, P: 46, K: 0, Ca: 0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: 0 },
{ name: 'Triple Superphosphate (TSP)', formula: 'Ca(H₂PO₄)₂', description: 'Concentrated phosphorus source for early root and bloom development.', analysis: '0-46-0', N: 0, P: 46, K: 0, Ca: 0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Potassium Chloride (MOP)', formula: 'KCl', description: 'Muriate of potash; economical potassium source, but adds chloride.', analysis: '0-0-60', N: 0, P: 0, K: 60, Ca: 0, Mg: 0, S: 0, maxLbAcre: 0, postPlantMaxLbAcre: null },
{ name: 'Potassium Nitrate', formula: 'KNO₃', description: 'Water-soluble potassium and nitrate nitrogen source.', analysis: '13-0-46', N: 13, P: 0, K: 46, Ca: 0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Calcium Nitrate', formula: 'Ca(NO₃)₂·4H₂O', description: 'Highly soluble source of nitrate nitrogen and calcium.', analysis: '15.5-0-0 + 19.0% Ca', N: 15.5, P: 0, K: 0, Ca: 19.0, Mg: 0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Dolomitic Lime', formula: 'CaCO₃ + MgCO₃', description: 'Raises soil pH while supplying calcium and magnesium.', analysis: '25.0% Ca, 10.0% Mg', N: 0, P: 0, K: 0, Ca: 25.0, Mg: 10.0, S: 0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Epsom Salt', formula: 'MgSO₄·7H₂O', description: 'Magnesium sulfate; fast-acting source of magnesium and sulfur.', analysis: '10.0% Mg, 13.0% S', N: 0, P: 0, K: 0, Ca: 0, Mg: 10.0, S: 13.0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Gypsum', formula: 'CaSO₄·2H₂O', description: 'Calcium sulfate that adds calcium and sulfur without changing soil pH.', analysis: '23.3% Ca, 18.6% S', N: 0, P: 0, K: 0, Ca: 23.3, Mg: 0, S: 18.6, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Ammonium Sulfate', formula: '(NH₄)₂SO₄', description: 'Supplies ammonium nitrogen and sulfur; acidifies soil over time.', analysis: '21-0-0 + 24.0% S', N: 21, P: 0, K: 0, Ca: 0, Mg: 0, S: 24.0, maxLbAcre: null, postPlantMaxLbAcre: null },
{ name: 'Potassium Sulfate', formula: 'K₂SO₄', description: 'Sulfate of potash; supplies potassium and sulfur without chloride.', analysis: '0-0-50 + 17.5% S', N: 0, P: 0, K: 50, Ca: 0, Mg: 0, S: 17.5, maxLbAcre: null, postPlantMaxLbAcre: null }
];
var STAGE_LABELS_TOMATOES = [
'1. Preplant / Bedding',
'2. Early Vegetative',
'3. Rapid Vine Stretch',
'4. Early Fruit Set',
'5. Heavy Continuous Load',
'6. Extended Mid-Harvest',
'7. Final Taper / Wrap-up'
];
var STAGE_LABELS_EVERYTHING_ELSE_6 = [
'1. Preplant / Bedding',
'2. Early Vegetative',
'3. Rapid Vegetative',
'4. Flowering / Fruit Set',
'5. Heavy Fruit Load',
'6. Peak Ripening'
];
var TOMATOES_EXTENDED = [
{ stage: STAGE_LABELS_TOMATOES[0], N: 10, P: 65, K: 15, Ca: 40, Mg: 45, S: 15 },
{ stage: STAGE_LABELS_TOMATOES[1], N: 10, P: 10, K: 5, Ca: 10, Mg: 10, S: 10 },
{ stage: STAGE_LABELS_TOMATOES[2], N: 20, P: 10, K: 15, Ca: 15, Mg: 15, S: 20 },
{ stage: STAGE_LABELS_TOMATOES[3], N: 20, P: 10, K: 20, Ca: 15, Mg: 10, S: 20 },
{ stage: STAGE_LABELS_TOMATOES[4], N: 20, P: 5, K: 25, Ca: 10, Mg: 10, S: 15 },
{ stage: STAGE_LABELS_TOMATOES[5], N: 15, P: 0, K: 15, Ca: 7, Mg: 7, S: 15 },
{ stage: STAGE_LABELS_TOMATOES[6], N: 5, P: 0, K: 5, Ca: 3, Mg: 3, S: 5 }
];
var EVERYTHING_ELSE_NORMAL = [
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[0], N: 10, P: 70, K: 15, Ca: 40, Mg: 40, S: 15 },
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[1], N: 15, P: 10, K: 10, Ca: 10, Mg: 10, S: 10 },
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[2], N: 25, P: 10, K: 15, Ca: 15, Mg: 15, S: 25 },
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[3], N: 25, P: 10, K: 25, Ca: 20, Mg: 15, S: 25 },
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[4], N: 15, P: 0, K: 25, Ca: 10, Mg: 15, S: 15 },
{ stage: STAGE_LABELS_EVERYTHING_ELSE_6[5], N: 10, P: 0, K: 10, Ca: 5, Mg: 5, S: 10 }
];
function cloneRows(rows) {
return rows.map(function (row) {
var copy = { stage: row.stage };
NUTRIENTS.forEach(function (nutrient) {
copy[nutrient] = row[nutrient];
});
return copy;
});
}
function blankRows(stageLabels) {
return stageLabels.map(function (label) {
var row = { stage: label };
NUTRIENTS.forEach(function (nutrient) {
row[nutrient] = 0;
});
return row;
});
}
var defaults = {
'tomatoes-extended': cloneRows(TOMATOES_EXTENDED),
'tomatoes-normal': cloneRows(TOMATOES_EXTENDED.slice(0, 6)),
'everything-else-extended': blankRows(STAGE_LABELS_TOMATOES),
'everything-else-normal': cloneRows(EVERYTHING_ELSE_NORMAL)
};
var state = {
crop: 'everything-else',
stage: 'normal',
unit: 'lb-acre',
rowLength: 25,
rowWidth: GROWING_SPECS.bedWidthIn / 12,
rowCenters: GROWING_SPECS.rowCentersIn / 12,
plantSpacing: GROWING_SPECS.plantSpacingIn / 12
};
var seasonTotalsLbAcre = {};
SEASONAL_TARGETS.forEach(function (target) {
seasonTotalsLbAcre[target.key] = target.target;
});
var tableCache = {};
var tableBody = document.getElementById('fertilizer-table-body');
var outputBody = document.getElementById('fertilizer-output-body');
var productHead = document.getElementById('product-table-head');
var productBody = document.getElementById('product-table-body');