$url = "https://randomuser.me/api/?results=8&nat=br";
$resposta = file_get_contents($url);
if ($resposta === false) {
echo "Erro ao acessar a API";
exit;
}
$dados = json_decode($resposta, true);
if (!isset($dados['results'])) {
echo "Erro na API";
exit;
}
main{
font-family: Arial, Helvetica, sans-serif;
width: 80%;
margin: 0 auto;
line-height: 25px;
}
.card-user {
border-radius: 20px;
padding: 20px;
margin-bottom: 20px;
min-height: 250px;
text-align: center;
background: #ffffff;
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
transition: transform 0.2s;
}
.card-user:hover {
transform: scale(1.05);
}
.card-user img {
border-radius: 50%;
width: 100px;
margin-bottom: 10px;
}
.nome {
font-weight: bold;
font-size: 1.2rem;
}
.info {
font-size: 0.9rem;
color: #555;
}