Git Product home page Git Product logo

softviz-semaphores's Introduction

Hi there, it's Djalil

A software engineer(ing graduate).
  • ๐ŸŒฑ Iโ€™m currently learning Python/Odoo (see contact_travel) relearning Vue.

  • ๐Ÿ“ I write stuff on blog.djalil.me

  • ๐Ÿ’ฌ Ask me about web stuff or dev in general ig

Connect with me:

abdeldjalilhebal djalilhebal djalilhebal djalilhebal

Languages and Tools:

java javascript nodejs express nextjs puppeteer jest linux git bash react vuejs electron apachecordova

postgresql mongodb redis

softviz-semaphores's People

Contributors

djalilhebal avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tammyporter1111

softviz-semaphores's Issues

Make it more accessible

Since this is supposed to be an educational tool, it should be accessible to all students.

  • Use semantic HTML

  • Make the animation speed configurable

  • Add an alt to the visual representation

Use ARIA Live Regions, something like:

<div id="narration" role="region" aria-live="polite">
  Car #123: Crossing the intersection
</div>

Make it responsive and mobile-friendly

The animation "scene" is the most offending part because it is defined in absolute size units (pixels):

Either change the size unites or maybe just use SVG (#1)

photo_2020-05-16_06-19-31

Replace the HTML drawing with SVG

Instead of drawing with HTML and CSS (display: flex and order: <calculatedPosition>), use SVG and set 'calculatedPosition' manually using CSS translate(x, y)

  • Recreate the 'scene' with SVG

    • Basic layout: images/scene.svg
    • Dynamic elements (the first comment shows a possible approach)
    • Add transform: translate animations (see the broken code below)
  • CSS: Use only cheaply animated props, like opacity and transform translate

  • CSS: Use cubic-bezier easing to create more natural car movements


$elem.style.setProperty("--position", index + 1);
[data-state] {
  transform: translate(calc(var(--position) * var(--delta-x) * 1vw), 10px);
}

[data-direction="west"] {
  --delta-x: 50;
  --delta-y: 0;
}

[data-direction="south"] {
  --delta-x: 45;
  --delta-y: 0;
}

[data-state="new"] {
  opacity: 0;
}

[data-state="leave"] {
  opacity: 1;
  animation: 5s leaving infinite;
}

/*
.sim[data-state="running"] .vehicle[data-state=leave] {
  animate leaving!
}

.sim[data-state="collision"] #crash-area {
  opacity: 1;
}
*/

@keyframes leaving {
  50% {
    opacity: 1;
    transform: translate(calc(var(--delta-x) * 2vw), -40px);
  }

  100% {
    opacity: 0;
    transform: translate(calc(var(--delta-x) * 10vw), calc(var(--delta-y) * 10vw));
  }
}

The Stop and Restart buttons don't work

As mentioned in the "Warnings" section:

The 'stop' and 'restart' functionalities are not fully implemented and so you will need to refresh the page to test different algorithms (TO BE FIXED later).
(You can still call Sim.stop() from the console and it will kinda work.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.