viernes, 5 de enero de 2024

2 pruebas

PASA LA FLECHA DEL RATON POR ENCIMA SI LO VES EN PC TOCA CON EL DEDO SI LO VES EN TELEFONO MOVIL














PASA LA FLECHA DEL RATON POR ENCIMA SI LO VES EN PC TOCA CON EL DEDO SI LO VES EN TELEFONO MOVIL<html>
<head>
  <style>
    .circle {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background-color: red;
      position: relative;
    }

    .circle:hover .inner-circle {
      animation: grow 1s forwards;
    }

    .inner-circle {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background-color: white;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    @keyframes grow {
      from {
        transform: scale(0);
      }
      to {
        transform: scale(1);
      }
    }
  </style>
</head>
<body>
  <div class="circle">
    <div class="inner-circle"></div>
  </div>
</body>
</html>

Juego pruebas

import pygame pygame.init() screen = pygame.display.set_mode((400, 400)) squareX = 50 squareY = 50 circleX = 50 circleY = 50 while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() if event.type == pygame.MOUSEBUTTONDOWN: if squareX < mouse[0] < squareX + 50 and squareY < mouse[1] < squareY + 50: circleX = squareX + 25 circleY = squareY + 25 screen.fill((255, 255, 255)) pygame.draw.rect(screen, (0, 0, 0), (squareX, squareY, 50, 50)) pygame.draw.circle(screen, (0, 0, 0), (circleX, circleY), 25) circleY -= 1 pygame.display.update() let squareX = 50; let squareY = 50; let circleX = 50; let circleY = 50; function setup() { createCanvas(400, 400); } function draw() { background(220); rect(squareX, squareY, 50, 50); circle(circleX, circleY, 25); circleY -= 1; } function mousePressed() { if (mouseX > squareX && mouseX < squareX + 50 && mouseY > squareY && mouseY < squareY + 50) { circleX = squareX + 25; circleY = squareY + 25; } }let squareX = 50;
let squareY = 50;
let circleX = 50;
let circleY = 50;

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
  rect(squareX, squareY, 50, 50);
  circle(circleX, circleY, 25);
  circleY -= 1;
}

function mousePressed() {
  if (mouseX > squareX && mouseX < squareX + 50 && mouseY > squareY && mouseY < squareY + 50) {
    circleX = squareX + 25;
    circleY = squareY + 25;
  }
}

Lanzando toca pantalla

 <!DOCTYPE html>

<html>

<head>

<style>

  .cube {

    position: absolute;

    width: 50px;

    height: 50px;

    background-color: red;

    animation: move 2s linear infinite;

  }


  @keyframes move {

    from {

      transform: translate(0, 0);

    }

    to {

      transform: translate(0, 100vh);

    }

  }

</style>

</head>

<body>

  <script>

    document.addEventListener('touchstart', function(e) {

      var cube = document.createElement('div');

      cube.classList.add('cube');

      cube.style.left = e.touches[0].clientX + 'px';

      cube.style.top = e.touches[0].clientY + 'px';

      document.body.appendChild(cube);

    });

  </script>

</body>

</html>


Circulo girando

 <!DOCTYPE html>

<html>

<head>

<style>

  .ball {

    position: absolute;

    width: 10px;

    height: 150px;

    margin: 50px auto 0;

    border-radius: 50%;

    background: radial-gradient(circle at 65% 15%, white 1px, aqua 3%, darkblue 60%, aqua 100%);

    animation: rotate 2s linear infinite;

  }


  @keyframes rotate {

    from {

      transform: rotate(0deg);

    }

    to {

      transform: rotate(360deg);

    }

  }

</style>

</head>

<body>

  <div class="ball"></div>

</body>

</html>