-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
123 lines (104 loc) · 2.83 KB
/
index.php
File metadata and controls
123 lines (104 loc) · 2.83 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
$unixDay = (string) floor(time() / 86400);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unix Day</title>
<style>
/* Minimal CSS Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #ffffff; /* white */
color: #0a0a0a; /* neutral-950 */
font-family: system-ui, sans-serif;
}
/* Imitating Tailwind classes from provided HTML */
.min-h-svh {
min-height: 100svh;
}
.flex {
display: flex;
}
.flex-col {
flex-direction: column;
}
.m-auto {
margin: auto;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.p-4 {
padding: 1rem;
}
.text-4xl {
font-size: 2.25rem;
line-height: 2.5rem;
}
h1 {
font-weight: normal;
}
.copy-button {
appearance: none;
cursor: pointer;
background: transparent;
color: inherit;
font: inherit;
padding: 0.25rem 0.5rem;
border: 1px solid transparent;
border-radius: 0.5rem;
transition: all 0.1s ease-in-out;
user-select: none;
}
.copy-button:hover {
background-color: #f5f5f5; /* neutral-100 */
}
.copy-button:active {
opacity: 0.7;
transform: scale(0.97);
}
.copy-button:focus-visible {
outline: 2px solid #0a0a0a;
outline-offset: 2px;
}
.tracking-tight {
letter-spacing: -0.025em;
}
.text-balance {
text-wrap: balance;
}
</style>
</head>
<body>
<div class="mx-auto flex min-h-svh flex-col">
<div class="m-auto p-4">
<h1 class="text-4xl tracking-tight text-balance">
<button type="button" class="copy-button" aria-label="Copy Unix day to clipboard" data-value="<?php echo $unixDay; ?>" onclick="copyUnixDay(this)">
<?php echo $unixDay; ?>
</button>
</h1>
</div>
</div>
<script>
async function copyUnixDay(el) {
const text = el.dataset.value || el.innerText.trim();
if (!navigator.clipboard || !navigator.clipboard.writeText) {
return;
}
try {
await navigator.clipboard.writeText(text);
} catch (error) {
// Intentionally silent: no visible copy feedback.
}
}
</script>
</body>
</html>