my boot.js
$(document).ready(function() {
particleground(document.getElementById('particles-foreground'), {
dotColor: 'rgba(255, 255, 255, 1)',
lineColor: 'rgba(255, 255, 255, 0.05)',
minSpeedX: 0.3,
maxSpeedX: 0.6,
minSpeedY: 0.3,
maxSpeedY: 0.6,
density: 50000,
curvedLines: false,
proximity: 250,
parallaxMultiplier: 10,
particleRadius: 4,
});
particleground(document.getElementById('particles-background'), {
dotColor: 'rgba(255, 255, 255, 0.5)',
lineColor: 'rgba(255, 255, 255, 0.05)',
minSpeedX: 0.075,
maxSpeedX: 0.15,
minSpeedY: 0.075,
maxSpeedY: 0.15,
density: 30000,
curvedLines: false,
proximity: 20,
parallaxMultiplier: 20,
particleRadius: 2,
});
});
const dialogueTextsStatic = [
"Welcome to Matrix™",
"Find all your essentials here to get started.",
"More than 4 accounts per device will result in reduced grind!",
"Sign up with Matrix above to manage with ease.",
"Good luck, Matrix."
];
const dialogueTextElem = document.getElementById("dialogue-text");
let dialogueIndex = 0;
let charIndex = 0;
const typingSpeed = 50; // ms per character
const pauseBetweenLines = 1500; // ms pause after full text is displayed
// --- Time injection helper ---
let injectedTime = null;
function getNow() {
return injectedTime ? new Date(injectedTime) : new Date();
}
// To inject time externally:
// window.injectTimeForDialogues = function(dateOrISOString) { injectedTime = new Date(dateOrISOString); }
//////////////////////////////////////////////////////////
// Utility functions
function getUTCDateAt(hour, minute, dayOffset = 0, baseDate = null) {
const now = baseDate ? new Date(baseDate) : getNow();
return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + dayOffset, hour, minute, 0));
}
function addDays(date, days) {
const d = new Date(date);
d.setUTCDate(d.getUTCDate() + days);
return d;
}
function getNextWeeklyUTCDate(targetDay, hour, minute, baseDate = null) {
const now = baseDate ? new Date(baseDate) : getNow();
const todayDay = now.getUTCDay();
const todayUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hour, minute, 0));
let daysToAdd = (targetDay + 7 - todayDay) % 7;
if (daysToAdd === 0 && todayUTC <= now) {
daysToAdd = 7;
}
return addDays(todayUTC, daysToAdd);
}
function getNextDailyUTCDate(hour, minute, baseDate = null) {
const now = baseDate ? new Date(baseDate) : getNow();
const todayUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hour, minute, 0));
if (todayUTC > now) return todayUTC;
else return addDays(todayUTC, 1);
}
function formatTimeDiff(diffMs) {
if (diffMs < 0) return "0 seconds";
const totalSeconds = Math.floor(diffMs / 1000);
const days = Math.floor(totalSeconds / (3600 * 24));
const hours = Math.floor((totalSeconds % (3600 * 24)) / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
const parts = [];
if (days > 0) parts.push(days + (days === 1 ? " day" : " days"));
if (hours > 0) parts.push(hours + (hours === 1 ? " hour" : " hours"));
if (minutes > 0) parts.push(minutes + (minutes === 1 ? " minute" : " minutes"));
if (seconds > 0) parts.push(seconds + (seconds === 1 ? " second" : " seconds"));
return parts.slice(0, 3).join(", ") || "0 seconds";
}
// Server reset daily at 00:00 GMT
function getServerResetDialogue() {
const nowUTC = getNow();
const nextReset = getNextDailyUTCDate(0, 0);
const diff = nextReset - nowUTC;
return Server will reset in ${formatTimeDiff(diff)}.;
}
// Maintenance daily at 02:00 GMT
function getMaintenanceDialogue() {
const nowUTC = getNow();
const nextMaintenance = getNextDailyUTCDate(2, 0);
const diff = nextMaintenance - nowUTC;
return Maintenance in ${formatTimeDiff(diff)}.;
}
//////////////////////////////////////////////////////////
// Seven Beasts challenge (Tue/Thu/Sat)
const sevenBeastsDays = [2, 4, 6]; // Tuesday, Thursday, Saturday
const sevenBeastsWindowsTemplate = [
{ openH: 9, openM: 0, startH: 9, startM: 30, endH: 10, endM: 30 },
{ openH: 21, openM: 0, startH: 21, startM: 30, endH: 22, endM: 30 },
];
function getUpcomingSevenBeastsSessions() {
const now = getNow();
let sessions = [];
for (let dayOffset = 0; dayOffset < 7; dayOffset++) {
let dayCandidate = (now.getUTCDay() + dayOffset) % 7;
if (!sevenBeastsDays.includes(dayCandidate)) continue;
let baseDate = addDays(new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())), dayOffset);
sevenBeastsWindowsTemplate.forEach(ws => {
let open = new Date(Date.UTC(baseDate.getUTCFullYear(), baseDate.getUTCMonth(), baseDate.getUTCDate(), ws.openH, ws.openM, 0));
let start = new Date(Date.UTC(baseDate.getUTCFullYear(), baseDate.getUTCMonth(), baseDate.getUTCDate(), ws.startH, ws.startM, 0));
let end = new Date(Date.UTC(baseDate.getUTCFullYear(), baseDate.getUTCMonth(), baseDate.getUTCDate(), ws.endH, ws.endM, 0));
sessions.push({ open, start, end });
});
}
sessions.sort((a, b) => a.open - b.open);
return sessions;
}
function getSevenBeastsDialogues() {
const now = getNow();
const sessions = getUpcomingSevenBeastsSessions();
for (const session of sessions) {
if (now < session.open) {
let untilOpen = session.open - now;
let color = untilOpen <= 30 * 60 * 1000 ? "yellow" : null;
return {
willOpen: { text: Seven Beasts gate will open in ${formatTimeDiff(untilOpen)}., color },
hasOpened: null,
};
}
if (now >= session.open && now < session.start) {
let remainGate = session.start - now;
return {
willOpen: null,
hasOpened: { text: Seven Beasts gate has opened for ${formatTimeDiff(remainGate)} — enter now!, color: "green" },
};
}
if (now >= session.start && now < session.end) {
let remainLive = session.end - now;
return {
willOpen: null,
hasOpened: { text: Seven Beasts challenge is live for ${formatTimeDiff(remainLive)} — gates closed!, color: "red" },
};
}
}
let nextSessionDay = getNextWeeklyUTCDate(sevenBeastsDays[0], sevenBeastsWindowsTemplate[0].openH, sevenBeastsWindowsTemplate[0].openM, now);
let diff = nextSessionDay - now;
return {
willOpen: { text: Seven Beasts challenge is not scheduled soon. Next gate will open in ${formatTimeDiff(diff)}., color: null },
hasOpened: null,
};
}
//////////////////////////////////////////////////////////
// Yin-Yang Battlefield windows per level group
const yinYangWindows = [
{ levelRange: "Lv30-59", openH: 17, openM: 0, startH: 17, startM: 30, endH: 18, endM: 30 },
{ levelRange: "Lv60-89", openH: 19, openM: 0, startH: 19, startM: 30, endH: 20, endM: 30 },
{ levelRange: "Lv90-130", openH: 21, openM: 0, startH: 21, startM: 30, endH: 22, endM: 30 },
];
function getYinYangDialogues() {
const now = getNow();
let dialogues = [];
yinYangWindows.forEach(win => {
let openToday = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), win.openH, win.openM, 0));
let startToday = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), win.startH, win.startM, 0));
let endToday = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), win.endH, win.endM, 0));
if (now < openToday) {
let untilOpen = openToday - now;
let color = untilOpen <= 30 * 60 * 1000 ? "yellow" : null;
dialogues.push({
willOpen: { text: `Yin-Yang Battlefield ${win.levelRange} will open in ${formatTimeDiff(untilOpen)}.`, color },
hasOpened: null,
});
} else if (now >= openToday && now < startToday) {
let remainGate = startToday - now;
dialogues.push({
willOpen: null,
hasOpened: { text: `Yin-Yang Battlefield ${win.levelRange} is now open for ${formatTimeDiff(remainGate)} — enter now!`, color: "green" }
});
} else if (now >= startToday && now < endToday) {
let remainLive = endToday - now;
dialogues.push({
willOpen: null,
hasOpened: { text: `Yin-Yang Battlefield ${win.levelRange} is live for ${formatTimeDiff(remainLive)} — door closed!`, color: "red" }
});
} else {
let openTomorrow = new Date(openToday);
openTomorrow.setUTCDate(openTomorrow.getUTCDate() + 1);
let untilOpenTomorrow = openTomorrow - now;
dialogues.push({
willOpen: { text: `Yin-Yang Battlefield ${win.levelRange} will open in ${formatTimeDiff(untilOpenTomorrow)}.`, color: null },
hasOpened: null,
});
}
});
return dialogues;
}
//////////////////////////////////////////////////////////
// Compose dialogue list with color info
function updateDialogueTexts() {
const dialogues = [];
dialogues.push({ text: getServerResetDialogue(), color: null });
dialogues.push({ text: getMaintenanceDialogue(), color: null });
const sevenBeasts = getSevenBeastsDialogues();
if (sevenBeasts.willOpen) dialogues.push(sevenBeasts.willOpen);
if (sevenBeasts.hasOpened) dialogues.push(sevenBeasts.hasOpened);
const yinYangArr = getYinYangDialogues();
yinYangArr.forEach(obj => {
if (obj.willOpen) dialogues.push(obj.willOpen);
if (obj.hasOpened) dialogues.push(obj.hasOpened);
});
dialogueTextsStatic.forEach(txt => dialogues.push({ text: txt, color: null }));
return dialogues;
}
//////////////////////////////////////////////////////////
// Typing effect with dynamic color
let dialogueTexts = updateDialogueTexts();
function typeDialogue() {
if (dialogueIndex >= dialogueTexts.length) {
dialogueIndex = 0;
dialogueTexts = updateDialogueTexts();
}
// Set color only at the start of each dialogue line
if (charIndex === 0) {
let color = dialogueTexts[dialogueIndex].color;
dialogueTextElem.style.color = color || "";
dialogueTextElem.textContent = "";
}
if (charIndex < dialogueTexts[dialogueIndex].text.length) {
dialogueTextElem.textContent += dialogueTexts[dialogueIndex].text.charAt(charIndex);
charIndex++;
setTimeout(typeDialogue, typingSpeed);
} else {
setTimeout(() => {
charIndex = 0;
dialogueIndex++;
typeDialogue();
}, pauseBetweenLines);
}
}
// Expose for time injection testing
window.injectTimeForDialogues = function(dateOrISOString) {
injectedTime = dateOrISOString ? new Date(dateOrISOString) : null;
dialogueTexts = updateDialogueTexts();
dialogueIndex = 0;
charIndex = 0;
dialogueTextElem.textContent = "";
typeDialogue();
};
// Start typing effect live
typeDialogue();
my index.html
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="js/sound.js"></script>
<script src="js/essentials.js"></script>
<script src="js/ut.js"></script>
<div id="navbar-placeholder"></div>
<center>
<iframe id="fullScreenPenEffect" src="pen_effect.html" frameborder="0" scrolling="no"></iframe>
</center>
<br>
<center>
<section class="card-section">
<div class="card inception-card">
<img src="data/Pictures/matrix.png" alt="Matrix Image" class="card-image">
</div>
</section>
<br>
<section class="card-section">
<div id="ut" class="card uptime-card">
<p>System Uptime: Loading...</p>
</div>
</section>
</center>
<div id="footer-placeholder"></div>
<script src="js/bootstrap.min.js"></script>
<script src="js/boot.js"></script>
my home.css
/* Ensure HTML and Body take full height /
html, body {
height: 100%; / Very important for full-screen elements /
margin: 0;
padding: 0;
overflow-x: hidden; / Prevent horizontal scroll */
}
/* General Body Styling (similar to dashboard for consistency) /
body {
background-color: #1A1A1A; / Dark background - will be covered by iframe /
color: #e2e8f0; / Light grey text /
font-family: 'Inter', inherit; / Fallback to a generic sans-serif /
display: flex; / Use flexbox for overall layout /
flex-direction: column; / Stack content vertically /
min-height: 100vh; / Ensure body takes full viewport height */
}
/* Full-screen Pen Effect Iframe /
#fullScreenPenEffect {
position: fixed; / Fixed to the viewport /
top: 0;
left: 0;
width: 100vw; / 100% of viewport width /
height: 100vh; / 100% of viewport height /
z-index: -1; / Place it behind other content /
border: none; / Remove default iframe border /
background-color: #000; / Fallback background for iframe /
pointer-events: none; / Crucial: Allows clicks/interactions to pass through to elements below */
}
/* Main content wrapper /
#main-content {
position: relative; / Needed for z-index to work correctly relative to body /
z-index: 10; / Ensure content is above the iframe /
flex-grow: 1; / Allow content to grow /
display: flex;
flex-direction: column;
align-items: center; / Center main content horizontally /
padding-bottom: 50px; / Add padding for footer /
background-color: rgba(0, 0, 0, 0.0); / Keep it fully transparent, let cards and navbar handle their own backgrounds /
width: 100%; / Ensure it covers the width /
min-height: 100vh; / Ensure it covers full height of content */
}
/* Ensure navbar and footer placeholders have background /
#navbar-placeholder, #footer-placeholder {
background-color: #0F0F0F; / Or rgba(15, 15, 15, 0.9) if you want slight transparency /
width: 100%;
z-index: 15; / Ensure they are above #main-content /
position: relative; / Needed for z-index */
}
/* Main container for cards /
.container {
display: flex;
flex-direction: column;
align-items: center; / Center items horizontally /
gap: 30px; / Space between card sections /
padding: 30px 15px; / Padding for the container /
width: 100%; / Ensure container takes full width /
max-width: 600px; / Limit overall content width /
position: relative; / Ensure cards are positioned relative to container, not body /
z-index: 1; / Ensure cards are above any potential #main-content background */
}
/* Base Card Styling - now semi-transparent /
.card {
background-color: rgba(15, 15, 15, 0.8); / All cards are now semi-transparent /
border-radius: 0.75rem; / Smooth rounded corners /
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); / Subtle shadow /
padding: 24px;
max-width: 350px; / Max width for cards /
width: 100%; / Ensure it takes full width up to max-width /
text-align: center; / Center text within cards /
position: relative; / For z-index or absolute children /
z-index: 1; / Ensure cards are above the main-content background /
overflow: hidden; / Important for cards with content that might overflow */
}
/* Inception Card Specifics /
.inception-card {
position: relative; / For absolute positioning of badge /
padding: 0; / No padding inside for image to fill /
width: 300px; / Fixed width as per original /
height: 200px; / Fixed height as per original */
}
.inception-card .card-image {
width: 100%;
height: 100%;
object-fit: cover; /* Ensure image covers the area /
filter: grayscale(20%) contrast(120%) brightness(90%); / Keep original effects /
border-radius: 0.75rem; / Match card border-radius */
}
.inception-card .card-badge {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
background-color: #ef4444; /* Red badge color /
color: white;
padding: 5px 12px;
border-radius: 0.375rem; / Slightly rounded corners for badge */
font-size: 0.85em;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* Uptime Card Specifics /
.uptime-card {
color: #e2e8f0; / Ensure text color is still light */
font-size: 1.1em;
font-weight: bold;
}
/* Social Links Card /
.social-links-card {
padding: 15px; / Adjust padding for icons */
}
.social-icon-link {
display: inline-block; /* Allows spacing between icons if more are added */
transition: transform 0.2s ease-in-out;
}
.social-icon-link:hover {
transform: translateY(-3px); /* Lift effect on hover */
}
.social-icon {
width: 50px;
height: 50px;
border-radius: 0.5rem; /* Slight rounding for icons /
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); / Subtle shadow for icon */
}
/* Action Button Card */
.action-button-card {
padding: 20px;
}
/* Bootstrap Button Overrides (copy from dashboard.css for consistency) /
.btn {
border-radius: 0.5rem; / Rounded corners for all buttons /
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); / Subtle shadow /
text-shadow: none;
padding: 10px 20px;
margin: 0; / Remove default margin as card provides spacing /
transition: all 0.2s ease-in-out;
display: inline-block; / Ensure it respects padding/margin */
}
.btn-primary {
background-color: #2563eb; /* Blue /
border-color: transparent;
color: white;
}
.btn-primary:hover {
background-color: #1d4ed8; / Darker blue on hover */
box-shadow: 0 6px 10px -2px rgba(37, 99, 235, 0.3), 0 3px 5px -1px rgba(37, 99, 235, 0.2);
}
/* Responsive adjustments /
@media (max-width: 768px) {
.card {
padding: 18px;
max-width: 90%; / Adjust max-width for smaller screens /
}
.inception-card {
width: 90%;
height: auto; / Allow height to adjust */
max-width: 300px;
}
.inception-card .card-image {
border-radius: 0.5rem;
}
.social-icon {
width: 40px;
height: 40px;
}
.btn {
padding: 8px 16px;
}
.container {
gap: 20px;
}
}
.dialogue-box {
display: flex;
/* Vertically center avatar and content /
align-items: center; / This centers items vertically */
background-color: rgba(15, 15, 15, 0.85);
border: 2px solid #333;
border-radius: 10px;
padding: 15px 20px;
max-width: 600px;
box-shadow: 0 0 15px rgba(214, 15, 42, 0.7);
font-family: 'IBM Plex Mono', inherit;
color: #c0c0c0;
margin: 20px auto;
user-select: none;
}
.dialogue-box .avatar {
flex-shrink: 0;
width: 50px; /* bigger container /
height: 80px; / bigger container */
margin-right: 20px;
border-radius: 10px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.dialogue-box .avatar img {
width: 100%;
height: 100%;
object-fit: cover; /* fills container, might crop */
display: block;
}
.dialogue-content {
/* Let the text take full height of avatar and center vertically /
display: flex;
flex-direction: column;
justify-content: center;
flex-grow: 1;
min-height: 96px; / match avatar height */
}
#dialogue-text {
font-size: 1.1em;
line-height: 1.4;
white-space: pre-wrap;
word-wrap: break-word;
margin: 0; /* Remove default margins /
position: relative;
padding-right: 15px; / Give some room so the blinking cursor does not overlap text /
min-height: 1.2em; / Ensure at least one line high */
}
#dialogue-text::after {
content: '|';
animation: blink-caret 1s step-start infinite;
margin-left: 3px;
opacity: 0.75;
font-weight: bold;
display: inline-block;
/* Remove absolute positioning */
}
@keyframes blink-caret {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
}
.bootscreen-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: mix(#3f3251, #002025, 70%);
overflow: hidden;
z-index: 9999;
}
.vertical-centered-box {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
}
.vertical-centered-box:after {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em;
}
.vertical-centered-box .content {
box-sizing: border-box;
display: inline-block;
vertical-align: middle;
text-align: left;
font-size: 0;
}
.loader-circle {
position: absolute;
left: 50%;
top: 50%;
width: 120px;
height: 120px;
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
margin-left: -60px;
margin-top: -60px;
animation: fade 1.2s infinite ease-in-out;
}
@keyframes fade {
0% { opacity: 1;}
50% { opacity: 0.25;}
100% { opacity: 1;}
}
/* Add your other loader styles similarly */
.loader-line-mask {
position: absolute;
left: 50%;
top: 50%;
width: 60px;
height: 120px;
margin-left: -60px;
margin-top: -60px;
overflow: hidden;
transform-origin: 60px 60px;
-webkit-mask-image: -webkit-linear-gradient(top, rgba(0,0,0,1), rgba(0,0,0,0));
animation: rotate 1.2s infinite linear;
}
.loader-line {
width: 120px;
height: 120px;
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
@keyframes rotate {
0% { transform: rotate(0deg);}
100% { transform: rotate(360deg);}
}
/* Particle backgrounds */
#particles-background, #particles-foreground {
left: -51%;
top: -51%;
width: 202%;
height: 202%;
transform: scale3d(.5, .5, 1);
}
#particles-background {
background: mix(#3f3251, #002025, 70%);
background-image: linear-gradient(45deg, #3f3251 2%, #002025 100%);
}
#bootScreen.fade-out {
opacity: 0;
pointer-events: none;
transition: opacity 1s ease;
}
why boot screen is not exiting?