enmi12/glossaire/js/make-big-graph-projects.js
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 0 d970ebf37754
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>

var programs = 'commercial urbanism public-space culture body-culture health education housing hotel media'.split(' '),
    programsLen = programs.length,
    statuses = 'idea in-progress under-construction completed'.split(' '),
    statusesLen = statuses.length;

function randInt(num) {
  return Math.floor( Math.random() * num );
}

function getChar() {
  var code;
  if ( Math.random() < 0.05 ) {
    // number
    code = randInt(10) + 48;
  } else {
    // alpha
    code = randInt(24) + 65;
  }
  return String.fromCharCode(code);
}

function makeBigGraphProject() {
  var year = 2001 + randInt(11),
      i = Math.floor( Math.random() * 2  + 3 ),
      title = '';
  while (i--) {
    title += getChar();
  }
  var program = programs[ randInt( programsLen ) ];
      status = statuses[ randInt( statusesLen ) ];
      scale = randInt(20);

  project = '<div class="project ' + program + '" ' + 
    'data-year="' + year + '" ' +
    'data-program="' + program + '" ' +
    'data-scale="' + scale + '" ' +
    'data-status="' + status + '" ' +
    '><div class="icon"></div>' + 
    '<p class="title">' + title + '</p>' +
    '</div>';

  return project;
}