Calculator Tools Calculator Tools
Create

Poki os Jogos

Jan 5, 2024

About this app

Encontre jogos divertidos no Poki

Poki os Jogos Buscar

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Poki os Jogos</title>
<meta name="description" content="Encontre jogos divertidos no Poki">
<meta name="keywords" content="jogos, divertidos, poki">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Function to search for games
function searchGames() {
var searchInput = document.getElementById("search-input").value;
var gamesContainer = document.getElementById("games-container");
gamesContainer.innerHTML = "";

// Make an API call to search for games
$.ajax({
url: "https://api.poki.com/poki/games?search=" + searchInput,
type: "GET",
success: function(response) {
var games = response.games;

// Display the games
for (var i = 0; i < games.length; i++) {
var game = games[i];
var gameCard = document.createElement("div");
gameCard.classList.add("game-card");
gameCard.innerHTML = "<img src='" + game.thumbnail + "' alt='" + game.name + "'><h3>" + game.name + "</h3>";
gamesContainer.appendChild(gameCard);
}
},
error: function(error) {
console.log("Error:", error);
}
});
}

// Event listener for search button click
var searchButton = document.getElementById("search-button");
searchButton.addEventListener("click", function() {
searchGames();
});

// Event listener for enter key press in search input
var searchInput = document.getElementById("search-input");
searchInput.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
searchGames();
}
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
/* App CSS Goes Here */
body {
background-color: #f5f5f5;
font-family: 'Roboto', sans-serif;
}

.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}

.search-container {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}

.search-input {
width: 300px;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
outline: none;
}

.search-button {
margin-left: 10px;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}

.search-button:hover {
background-color: #0056b3;
}

.games-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
grid-gap: 20px;
}

.game-card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
cursor: pointer;
}

.game-card img {
width: 100%;
max-height: 200px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 10px;
}

.game-card h3 {
font-size: 16px;
font-weight: 600;
text-align: center;
}

.game-card:hover {
transform: translateY(-5px);
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div class="search-container">
<input id="search-input" class="search-input" type="text" placeholder="Digite o nome do jogo">
<button id="search-button" class="search-button" type="button">Buscar</button>
</div>
<div id="games-container" class="games-container">
<!-- Game cards will be dynamically added here -->
</div>
</div>
</body>
</html>