PKAKU Moments
Real People. Real Moments.
Loading real PKAKU moments…
/* PKAKU peacock background */
#pkaku-live-home {
–pk-gold: #E5B94F;
–pk-ivory: #FFF4D6;
width: 100vw;
max-width: 100vw;
margin-left: calc(50% – 50vw);
padding: 12px 0 20px;
box-sizing: border-box;
font-family: inherit;
color: var(–pk-ivory);
background-color: #031C19;
background-image:
radial-gradient(ellipse at 12% 12%, rgba(0, 117, 112, .48), transparent 34%),
radial-gradient(ellipse at 88% 20%, rgba(0, 67, 83, .55), transparent 35%),
radial-gradient(ellipse at 15% 78%, rgba(0, 92, 73, .45), transparent 32%),
radial-gradient(ellipse at 90% 85%, rgba(0, 105, 104, .38), transparent 34%),
repeating-linear-gradient(
125deg,
transparent 0px,
transparent 34px,
rgba(190, 145, 48, .045) 36px,
transparent 39px,
transparent 66px
),
linear-gradient(145deg, #031C19, #073F3B 48%, #021916);
background-attachment: fixed;
}
#pkaku-live-home *,
#pkaku-live-home *::before,
#pkaku-live-home *::after {
box-sizing: border-box;
}
#pkaku-live-home .pk-home-heading {
text-align: center;
padding: 4px 10px 12px;
}
#pkaku-live-home .pk-home-heading h2 {
color: var(–pk-ivory);
font-size: clamp(22px, 2.5vw, 30px);
line-height: 1.2;
margin: 0 0 5px;
font-weight: 750;
}
#pkaku-live-home .pk-home-heading p {
color: var(–pk-ivory);
margin: 0;
font-size: 13px;
}
#pk-home-status {
color: var(–pk-ivory);
text-align: center;
padding: 5px 8px 10px;
font-size: 13px;
}
#pk-home-gallery {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
gap: 22px;
padding: 0;
margin: 0;
}
#pk-home-gallery .pk-home-card {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
margin: 0;
padding: 0;
border: 0;
background: transparent;
}
/* Keep the existing photo size and shape */
.pk-home-photo-wrap {
position: relative;
display: inline-flex;
justify-content: center;
align-items: center;
width: fit-content;
max-width: 100%;
height: min(68vh, 650px);
min-height: 220px;
margin: 0 auto;
padding: 0;
border: 0;
background: transparent;
line-height: 0;
overflow: visible;
/* Bold gold outline without changing image dimensions */
outline: 4px solid #D9A638;
outline-offset: -4px;
border-radius: 10px;
box-shadow:
0 0 0 2px #8C621B,
0 0 15px rgba(255, 190, 55, .65),
0 0 30px rgba(218, 157, 39, .25);
}
.pk-home-photo-wrap img,
.pk-home-photo-wrap video {
display: block;
width: auto;
height: 100%;
max-width: 100%;
max-height: 100%;
margin: 0 auto;
padding: 0;
border: 0;
border-radius: 10px;
box-shadow: none;
object-fit: contain;
object-position: center;
background: transparent;
}
/* Moment name and creator stay in their existing positions */
.pk-home-top {
position: absolute;
z-index: 3;
top: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 13px 14px;
line-height: 1.3;
background: linear-gradient(
180deg,
rgba(0, 20, 17, .82),
rgba(0, 20, 17, .38),
transparent
);
pointer-events: none;
}
.pk-home-name {
color: #FFF4D6;
font-size: 14px;
font-weight: 750;
min-width: 0;
overflow-wrap: anywhere;
text-shadow: 0 1px 4px #000;
}
.pk-home-creator {
color: #FFF4D6;
font-size: 12px;
font-weight: 650;
text-align: right;
min-width: 0;
overflow-wrap: anywhere;
text-shadow: 0 1px 4px #000;
}
/* Bravo and Report remain at the bottom of each photo */
.pk-home-bottom {
position: absolute;
z-index: 3;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 13px 14px;
background: linear-gradient(
0deg,
rgba(0, 20, 17, .88),
rgba(0, 20, 17, .42),
transparent
);
}
.pk-home-action {
appearance: none;
border: 0;
border-radius: 0;
background: transparent;
color: #FFF4D6;
font-family: inherit;
font-size: 13px;
font-weight: 700;
padding: 5px 0;
cursor: pointer;
white-space: nowrap;
text-shadow: 0 1px 4px #000;
box-shadow: none;
pointer-events: auto;
}
.pk-home-action:hover {
color: var(–pk-gold);
background: transparent;
}
.pk-home-action:focus-visible {
outline: 2px solid var(–pk-gold);
outline-offset: 4px;
}
.pk-home-action:disabled {
opacity: .65;
cursor: wait;
}
.pk-home-action .pk-symbol {
margin-right: 5px;
font-size: 14px;
}
.pk-home-empty {
color: var(–pk-ivory);
text-align: center;
padding: 24px 12px;
}
/* Mobile */
@media (max-width: 600px) {
#pkaku-live-home {
padding: 8px 0 16px;
background-attachment: scroll;
}
#pkaku-live-home .pk-home-heading {
padding-bottom: 8px;
}
#pk-home-gallery {
gap: 16px;
}
.pk-home-photo-wrap {
height: 58vh;
min-height: 200px;
max-width: 100%;
outline-width: 3px;
border-radius: 8px;
box-shadow:
0 0 0 1px #8C621B,
0 0 11px rgba(255, 190, 55, .6);
}
.pk-home-photo-wrap img,
.pk-home-photo-wrap video {
border-radius: 8px;
}
.pk-home-top {
padding: 9px;
gap: 6px;
}
.pk-home-name {
font-size: 12px;
}
.pk-home-creator {
font-size: 11px;
}
.pk-home-bottom {
padding: 9px;
}
.pk-home-action {
font-size: 12px;
}
}
(async function () {
const WORKER = “https://pkaku-upload-api.pkakuapp.workers.dev”;
const firebaseConfig = {
apiKey: “AIzaSyDwnVZGKJgS8C6vsHrXpjZp1abIjqbf2is”,
authDomain: “pkaku-88191.firebaseapp.com”,
projectId: “pkaku-88191”,
storageBucket: “pkaku-88191.firebasestorage.app”,
messagingSenderId: “53208719537”,
appId: “1:53208719537:web:a28b6472668cb11337c290”,
measurementId: “G-35Q1371RMV”
};
const root = document.getElementById(“pkaku-live-home”);
const gallery = document.getElementById(“pk-home-gallery”);
const status = document.getElementById(“pk-home-status”);
if (!root || !gallery || !status) return;
try {
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
const auth = firebase.auth();
if (!auth.currentUser) {
await auth.signInAnonymously();
}
async function getToken() {
if (!auth.currentUser) {
await auth.signInAnonymously();
}
return auth.currentUser.getIdToken();
}
function makeAction(label, symbol) {
const button = document.createElement(“button”);
button.type = “button”;
button.className = “pk-home-action”;
const icon = document.createElement(“span”);
icon.className = “pk-symbol”;
icon.textContent = symbol;
button.append(icon, document.createTextNode(label));
return button;
}
async function loadMoments() {
const response = await fetch(
WORKER + “/public-moments?limit=30”,
{ cache: “no-store” }
);
if (!response.ok) {
throw new Error(
“Could not load public moments (” + response.status + “)”
);
}
const data = await response.json();
const moments = Array.isArray(data.moments)
? data.moments
: [];
gallery.innerHTML = “”;
const displayable = moments.filter(
moment => moment && moment.id && moment.objectKey
);
if (!displayable.length) {
const empty = document.createElement(“div”);
empty.className = “pk-home-empty”;
empty.textContent = “New moments are coming soon.”;
gallery.appendChild(empty);
status.textContent = “”;
return;
}
displayable.forEach(moment => {
const card = document.createElement(“article”);
card.className = “pk-home-card”;
const photoWrap = document.createElement(“div”);
photoWrap.className = “pk-home-photo-wrap”;
const mediaUrl =
WORKER + “/media?key=” +
encodeURIComponent(moment.objectKey);
const mediaType = String(
moment.mediaType || “”
).toLowerCase();
const isVideo =
mediaType.includes(“video”) ||
mediaType.includes(“mp4”) ||
mediaType.includes(“webm”);
if (isVideo) {
const video = document.createElement(“video”);
video.src = mediaUrl;
video.controls = true;
video.playsInline = true;
video.preload = “metadata”;
video.setAttribute(
“aria-label”,
moment.momentName || “PKAKU video moment”
);
photoWrap.appendChild(video);
} else {
const img = document.createElement(“img”);
img.src = mediaUrl;
img.alt =
(moment.momentName || “PKAKU moment”) +
” — ” +
(moment.creatorName || “PKAKU creator”);
img.loading = “lazy”;
img.decoding = “async”;
photoWrap.appendChild(img);
}
const top = document.createElement(“div”);
top.className = “pk-home-top”;
const momentName = document.createElement(“span”);
momentName.className = “pk-home-name”;
momentName.textContent =
moment.momentName || “PKAKU Moment”;
const creator = document.createElement(“span”);
creator.className = “pk-home-creator”;
creator.textContent =
moment.creatorName || “PKAKU Creator”;
top.append(momentName, creator);
const bottom = document.createElement(“div”);
bottom.className = “pk-home-bottom”;
const report = makeAction(“Report”, “⚑”);
const bravo = makeAction(“Bravo”, “♥”);
report.addEventListener(“click”, async event => {
event.preventDefault();
event.stopPropagation();
const comment = prompt(
“Please explain why you are reporting this moment (at least 20 characters):”
);
if (comment === null) return;
if (comment.trim().length {
event.preventDefault();
event.stopPropagation();
bravo.disabled = true;
try {
const token = await getToken();
const result = await fetch(
WORKER + “/bravo”,
{
method: “POST”,
headers: {
“Content-Type”: “application/json”,
“Authorization”: “Bearer ” + token
},
body: JSON.stringify({
momentId: moment.id
})
}
);
if (!result.ok) {
throw new Error(“Bravo could not be submitted”);
}
bravo.textContent = “♥ Bravo ✓”;
} catch (error) {
bravo.disabled = false;
alert(
error.message || “Bravo could not be submitted”
);
}
});
bottom.append(report, bravo);
photoWrap.append(top, bottom);
card.appendChild(photoWrap);
gallery.appendChild(card);
});
status.textContent =
“Discover real moments shared by the PKAKU community”;
}
await loadMoments();
} catch (error) {
console.error(“PKAKU Home gallery:”, error);
status.textContent =
“Unable to load moments right now. Please refresh and try again.”;
}
})();