82 lines
2.7 KiB
HTML
82 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>PDF Viewer</title>
|
|
<script type="module" src="./js/main.js"></script>
|
|
</head>
|
|
<body x-data="gameManager" class="p-4">
|
|
|
|
<template x-if="isLoading">
|
|
<div class="alert alert-info" role="alert">
|
|
Loading game data...
|
|
</div>
|
|
</template>
|
|
|
|
<template x-if="error">
|
|
<div class="alert alert-danger" role="alert" x-text="error"></div>
|
|
</template>
|
|
|
|
<template x-if="gameData && !isLoading && !error">
|
|
<div>
|
|
<p>Game Ready!</p>
|
|
<p>Session ID: <code x-text="gameData.session_id"></code></p>
|
|
<p>First Client ID: <code x-text="gameData.client_id"></code></p>
|
|
</div>
|
|
</template>
|
|
|
|
<template x-if="gameData && !isLoading && !error">
|
|
<div>
|
|
<p>Current Score: <strong x-text="gameData.score"></strong></p>
|
|
<p>Status: <span x-text="gameData.status"></span></p>
|
|
<p>Session ID: <code x-text="gameData.session_id"></code></p>
|
|
<p>Client ID to process: <code x-text="gameData.client_id"></code></p>
|
|
|
|
<hr>
|
|
|
|
<div x-show="gameData.status !== 'gameover'">
|
|
<h4>Make Decision:</h4>
|
|
<button
|
|
type="button"
|
|
class="btn btn-success me-2"
|
|
@click="submitDecision('Accept')"
|
|
:disabled="isLoading">
|
|
Accept
|
|
</button>
|
|
<button
|
|
type="button"
|
|
class="btn btn-danger"
|
|
@click="submitDecision('Reject')"
|
|
:disabled="isLoading">
|
|
Reject
|
|
</button>
|
|
</div>
|
|
|
|
<div x-show="gameData.status === 'gameover'" class="alert alert-warning mt-3">
|
|
Game Over! Final Score: <strong x-text="gameData.score"></strong>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<div class="container py-4 px-3 mx-auto">
|
|
<h1>Hello, Bootstrap and Vite!</h1>
|
|
<button class="btn btn-primary">Primary button</button>
|
|
</div>
|
|
<div x-data="pdfViewer()" class="space-y-4">
|
|
<button @click="loadPdf" class="px-4 py-2 bg-blue-500 text-white rounded">Load PDF</button>
|
|
|
|
<template x-if="pdfUrl">
|
|
<iframe
|
|
:src="pdfUrl"
|
|
type="application/pdf"
|
|
width="100%"
|
|
height="600px"
|
|
class="border border-gray-400 rounded"
|
|
></iframe>
|
|
</template>
|
|
</div>
|
|
</body>
|
|
</html>
|