Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
drawing esp with css and javascript

I'm trying to draw an ESP dynamically with javascript. I'm going to tinker with this for a long time, but I wanted to get some ideas on it.

Our components will be:

  1. container
  2. health
  3. bar lines

What I have in mind will look something like this:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
    <style>
      body {
        background: transparent;
      }
      .esp-box {
        position: absolute;
        border: 2px dotted rgb(255, 165, 0, .5);
        border-left: none;
        height: 300px;
        width: 150px;
        top: 30vh;
        left: 30vh;
      }
      .esp-box .health-bar {
        height: 100%;
        background: rgb(60, 60, 60, 0.5);
        width: 5px;
      }
      .esp-box .health-bar .plus{
        height: 60%;
        background: rgb(60, 179, 113, 0.5);
        width: 5px;
      }
      .esp-box .health-bar .minus{
        height: 40%;
        background: rgb(255, 0, 0, 0.5);
        width: 5px;
      }
      .line {
        border-top: 1px dotted rgb(255, 165, 0, .5);
        position: absolute;
        top: 9%;
        left: 23%;
        width: 50vh;
        transform: skewY(-40deg);
      }
    </style>
  </head>
  <body>
    <div class="esp-box">
      <div class="health-bar">
        <div class="plus">
        </div>
        <div class="minus">
        </div>
      </div>
    </div>
    <div class="line">

    </div>
  </body>
</html>

https://jsfiddle.net/xgw4jheo/

Aim: Replacing the container and lines in a dynamic and coordinated way with messages passed to javascript.

The lifebar is really easy, but the container and lines make me think a bit. Do you think this can be done?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda