fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.12s 54596KB
stdin
import { useState } from "react";

const flashcards = [
  { front: "Grupo 1 – Alcalinos", back: "Li, Na, K, Rb, Cs, Fr — 'LiNa Kiere Robar Cesio a Francio'" },
  { front: "Grupo 2 – Alcalinotérreos", back: "Be, Mg, Ca, Sr, Ba, Ra — 'BeMi CaSa BaRRa'" },
  { front: "Grupo 13 – Térreos", back: "B, Al, Ga, In, Tl — 'BAlGa InTa'" },
  { front: "Grupo 14 – Carbonoides", back: "C, Si, Ge, Sn, Pb — 'Casi GeSeNa PeBe'" },
  { front: "Grupo 15 – Nitrogenoides", back: "N, P, As, Sb, Bi — 'No Pases A eSte BaR'" },
  { front: "Grupo 16 – Anfígenos", back: "O, S, Se, Te, Po — 'OSeTe Po'" },
  { front: "Grupo 17 – Halógenos", back: "F, Cl, Br, I, At — 'FeliCidad BRIllATo'" },
  { front: "Grupo 18 – Gases nobles", back: "He, Ne, Ar, Kr, Xe, Rn, Og — 'HeNAr KreXeRo'" }
];

export default function FlashcardApp() {
  const [index, setIndex] = useState(0);
  const [showBack, setShowBack] = useState(false);

  const next = () => {
    setShowBack(false);
    setIndex((index + 1) % flashcards.length);
  };

  return (
    <div className="min-h-screen flex flex-col items-center justify-center p-6 bg-gray-100">
      <h1 className="text-3xl font-bold mb-6">Flashcards – Tabla Periódica</h1>

      <div
        className="w-80 h-48 bg-white shadow-xl rounded-2xl flex items-center justify-center text-center p-4 cursor-pointer transition-transform hover:scale-105"
        onClick={() => setShowBack(!showBack)}
      >
        <p className="text-lg font-semibold">
          {showBack ? flashcards[index].back : flashcards[index].front}
        </p>
      </div>

      <button
        className="mt-6 px-6 py-2 bg-blue-500 text-white rounded-xl shadow hover:bg-blue-600"
        onClick={next}
      >
        Siguiente
      </button>
    </div>
  );
}
stdout
Standard output is empty