-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDaily_code.html
More file actions
77 lines (70 loc) · 2.81 KB
/
Copy pathDaily_code.html
File metadata and controls
77 lines (70 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Printable Library Desk Numbers</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Times New Roman', Times, serif
}
/* Styles for printing */
@media print {
.no-print {
display: none;
}
.printable-area {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
page-break-inside: avoid;
}
.grid-cell {
border: 3px solid #ef4444 !important; /* Red-500 */
box-shadow: none !important;
}
}
</style>
</head>
<body class="bg-gray-100 flex flex-col items-center justify-center min-h-screen p-4">
<div class="w-full max-w-4xl bg-white rounded-lg shadow-lg p-8 printable-area">
<!-- Grid container -->
<div id="number-grid" class="grid grid-cols-4 gap-6">
<!-- Script generates grid cells here -->
</div>
</div>
<div class="no-print mt-8 flex space-x-4">
<button onclick="window.print()" class="bg-blue-600 text-white font-bold py-3 px-6 rounded-lg hover:bg-blue-700 transition duration-300 shadow-lg transform hover:scale-105">
Print Sheet
</button>
</div>
<script>
const gridContainer = document.getElementById('number-grid');
/**
* Creates the initial grid of numbers from 1 to 16.
*/
function createInitialGrid() {
gridContainer.innerHTML = ''; // Clear previous grid
for (let i = 1; i <= 16; i++) {
const cell = document.createElement('div');
// The main cell is a flex container that centers its content.
cell.className = 'grid-cell border-4 border-red-500 rounded-lg flex items-center justify-center p-2 aspect-square shadow-md transition-shadow hover:shadow-xl';
const number = document.createElement('span');
number.className = 'text-5xl md:text-7xl font-bold text-gray-800';
number.textContent = i;
cell.appendChild(number); // Add the number directly to the cell
gridContainer.appendChild(cell);
}
}
// --- Initial Setup ---
window.onload = () => {
createInitialGrid();
};
</script>
</body>
</html>