Subh775 commited on
Commit
463cb88
·
1 Parent(s): 80d4d16

about section spacing, NaN % fix

Browse files
Files changed (1) hide show
  1. frontend/vehicles.html +18 -9
frontend/vehicles.html CHANGED
@@ -362,10 +362,10 @@
362
  <main class="flex-1 flex flex-col h-full min-w-0 p-4 gap-4">
363
 
364
  <!-- TAB: About -->
365
- <div id="tab-about" class="hidden flex-1 min-h-0 overflow-y-auto px-12 py-12">
366
- <div class="max-w-4xl mx-auto bg-black border border-slate-800 rounded-[2.5rem] p-12 shadow-2xl space-y-12">
367
- <div class="text-center pb-12 border-b border-slate-900">
368
- <p class="text-[13px] font-montserrat font-medium italic leading-relaxed max-w-2xl mx-auto"
369
  style="color:#a89f97">
370
  &ldquo;Traffic data has always existed on Indian roads &mdash; in the movement of every vehicle,
371
  every crossing, every congested junction.
@@ -374,7 +374,7 @@
374
  </p>
375
  </div>
376
 
377
- <div class="space-y-6 leading-relaxed text-sm text-center" style="color:#a89f97">
378
  <p>
379
  UrbanFlow is a computer vision system purpose-built for traffic analysis on Indian roads.
380
  It processes video footage and returns structured outputs &mdash; vehicle counts by class,
@@ -386,7 +386,7 @@
386
  and transport infrastructure assessment. Footage is submitted, inference runs in the cloud,
387
  and results are returned as structured KPI outputs and downloadable reports.
388
  </p>
389
- <div class="grid grid-cols-3 gap-8 pt-8 text-left border-t border-slate-900">
390
  <div class="space-y-4">
391
  <h4 class="font-bold text-[13px] uppercase tracking-wider" style="color:#f0ece6">What It Does</h4>
392
  <ul class="text-xs space-y-3 pl-1">
@@ -791,13 +791,22 @@
791
  // =========== Rolling Counter ===========
792
  function animateValue(obj, start, end, duration) {
793
  let startTimestamp = null;
 
 
 
 
794
  const step = (timestamp) => {
795
  if (!startTimestamp) startTimestamp = timestamp;
796
  const progress = Math.min((timestamp - startTimestamp) / duration, 1);
797
- // easeOutQuad
798
  const ease = progress * (2 - progress);
799
- const current = Math.floor(ease * (end - start) + start);
800
- obj.innerText = typeof end === 'string' && end.includes('%') ? current + '%' : current;
 
 
 
 
 
 
801
  if (progress < 1) {
802
  window.requestAnimationFrame(step);
803
  } else {
 
362
  <main class="flex-1 flex flex-col h-full min-w-0 p-4 gap-4">
363
 
364
  <!-- TAB: About -->
365
+ <div id="tab-about" class="hidden flex-1 min-h-0 overflow-y-auto">
366
+ <div class="h-full bg-black border border-slate-800 rounded-xl p-8 shadow-2xl space-y-10">
367
+ <div class="text-center">
368
+ <p class="text-[13px] font-montserrat font-bold italic leading-relaxed max-w-3xl mx-auto"
369
  style="color:#a89f97">
370
  &ldquo;Traffic data has always existed on Indian roads &mdash; in the movement of every vehicle,
371
  every crossing, every congested junction.
 
374
  </p>
375
  </div>
376
 
377
+ <div class="space-y-6 leading-relaxed text-sm text-center max-w-5xl mx-auto" style="color:#a89f97">
378
  <p>
379
  UrbanFlow is a computer vision system purpose-built for traffic analysis on Indian roads.
380
  It processes video footage and returns structured outputs &mdash; vehicle counts by class,
 
386
  and transport infrastructure assessment. Footage is submitted, inference runs in the cloud,
387
  and results are returned as structured KPI outputs and downloadable reports.
388
  </p>
389
+ <div class="grid grid-cols-3 gap-8 pt-8 text-left border-t border-slate-900 max-w-5xl mx-auto">
390
  <div class="space-y-4">
391
  <h4 class="font-bold text-[13px] uppercase tracking-wider" style="color:#f0ece6">What It Does</h4>
392
  <ul class="text-xs space-y-3 pl-1">
 
791
  // =========== Rolling Counter ===========
792
  function animateValue(obj, start, end, duration) {
793
  let startTimestamp = null;
794
+ const isPct = typeof end === 'string' && end.includes('%');
795
+ const endNum = isPct ? parseFloat(end) : end;
796
+ const startNum = parseFloat(start) || 0;
797
+
798
  const step = (timestamp) => {
799
  if (!startTimestamp) startTimestamp = timestamp;
800
  const progress = Math.min((timestamp - startTimestamp) / duration, 1);
 
801
  const ease = progress * (2 - progress);
802
+ const current = ease * (endNum - startNum) + startNum;
803
+
804
+ if (isPct) {
805
+ obj.innerText = current.toFixed(1) + '%';
806
+ } else {
807
+ obj.innerText = Math.floor(current);
808
+ }
809
+
810
  if (progress < 1) {
811
  window.requestAnimationFrame(step);
812
  } else {