Save point: Scene 3 timing rework, text duplication fix, rain 5s, cursor blink 1
This commit is contained in:
49
index.html
49
index.html
@@ -348,6 +348,7 @@
|
||||
<script>
|
||||
// Testing shortcuts state
|
||||
let skipAnimations = false;
|
||||
let scene3TypewriterTimeouts = [];
|
||||
|
||||
// Canvas setup for Matrix rain
|
||||
const canvas = document.getElementById('matrixCanvas');
|
||||
@@ -365,7 +366,7 @@
|
||||
let columns = Math.floor(canvas.width / fontSize);
|
||||
let drops = [];
|
||||
const chars = '0123456789@#$%^&*()';
|
||||
const rainDuration = 8000; // 8 seconds
|
||||
const rainDuration = 5000; // 5 seconds
|
||||
let rainActive = false;
|
||||
let rainStartTime = null;
|
||||
|
||||
@@ -610,7 +611,7 @@
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function typeCalmly(elem, text, callback, minDelay, maxDelay) {
|
||||
function typeCalmly(elem, text, callback, minDelay, maxDelay, timeoutArray) {
|
||||
let i = 0;
|
||||
const total = text.length;
|
||||
|
||||
@@ -625,7 +626,8 @@
|
||||
const dMin = minDelay || 35;
|
||||
const dMax = maxDelay || 65;
|
||||
const delay = dMin + progress * progress * (dMax - dMin);
|
||||
setTimeout(typeChar, delay);
|
||||
const id = setTimeout(typeChar, delay);
|
||||
timeoutArray && timeoutArray.push(id);
|
||||
}
|
||||
typeChar();
|
||||
}
|
||||
@@ -656,7 +658,7 @@
|
||||
cursor.style.display = 'none';
|
||||
line2.style.display = 'flex';
|
||||
|
||||
blinkCursor(cursor2, 3, () => {
|
||||
blinkCursor(cursor2, 1, () => {
|
||||
typeCalmly(message2, "TO LAB 484", () => {
|
||||
setTimeout(() => {
|
||||
btn.style.visibility = 'visible';
|
||||
@@ -670,7 +672,7 @@
|
||||
}
|
||||
btn.style.opacity = btnOpacity;
|
||||
}, 30);
|
||||
}, 3000);
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -750,6 +752,7 @@
|
||||
const builderBtn = document.getElementById('builderBtn');
|
||||
const developerBtn = document.getElementById('developerBtn');
|
||||
const choiceBtns = [creatorBtn, builderBtn, developerBtn];
|
||||
scene3TypewriterTimeouts = [];
|
||||
|
||||
let opacity = 0;
|
||||
const fadeIn = setInterval(() => {
|
||||
@@ -768,9 +771,22 @@
|
||||
setTimeout(() => {
|
||||
rl1.style.display = 'flex';
|
||||
|
||||
blinkCursor(cursor, 3, () => {
|
||||
blinkCursor(cursor, 1, () => {
|
||||
typeCalmly(rt1, "THE LAB IS CONNECTING WITH PEOPLE WHO SEE WHAT'S HAPPENINGG - WHO KNOW CHANGE ISN'T OPTIONAL. WE'RE LOOKING FOR THOSE READY TO STEP IN AND SHAPE THE FUTURE", () => {
|
||||
setTimeout(() => {
|
||||
const fitInText = document.getElementById('scene3FitInText');
|
||||
fitInText.textContent = 'WHERE DO YOU FIT IN?';
|
||||
fitInText.style.visibility = 'visible';
|
||||
let fiOpacity = 0;
|
||||
const fiFadeIn = setInterval(() => {
|
||||
fiOpacity += 0.05;
|
||||
if (fiOpacity >= 1) {
|
||||
fiOpacity = 1;
|
||||
clearInterval(fiFadeIn);
|
||||
}
|
||||
fitInText.style.opacity = fiOpacity;
|
||||
}, 30);
|
||||
setTimeout(() => {
|
||||
choiceBtns.forEach(btn => {
|
||||
btn.style.display = 'block';
|
||||
btn.style.visibility = 'visible';
|
||||
@@ -785,25 +801,12 @@
|
||||
btn.style.opacity = btnOpacity;
|
||||
}, 30);
|
||||
});
|
||||
setTimeout(() => {
|
||||
const fitInText = document.getElementById('scene3FitInText');
|
||||
fitInText.textContent = 'WHERE DO YOU FIT IN?';
|
||||
fitInText.style.visibility = 'visible';
|
||||
let fiOpacity = 0;
|
||||
const fiFadeIn = setInterval(() => {
|
||||
fiOpacity += 0.05;
|
||||
if (fiOpacity >= 1) {
|
||||
fiOpacity = 1;
|
||||
clearInterval(fiFadeIn);
|
||||
}
|
||||
fitInText.style.opacity = fiOpacity;
|
||||
}, 30);
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}, 10, 25);
|
||||
}, 500);
|
||||
}, undefined, undefined, scene3TypewriterTimeouts);
|
||||
});
|
||||
}, 2000);
|
||||
});
|
||||
}, undefined, undefined, scene3TypewriterTimeouts);
|
||||
}
|
||||
sceneElem.style.opacity = opacity;
|
||||
}, 30);
|
||||
@@ -873,6 +876,8 @@
|
||||
const builderBtn = document.getElementById('builderBtn');
|
||||
const developerBtn = document.getElementById('developerBtn');
|
||||
if (scene3.style.display === 'flex' && creatorBtn.style.visibility !== 'visible') {
|
||||
scene3TypewriterTimeouts.forEach(t => clearTimeout(t));
|
||||
scene3TypewriterTimeouts = [];
|
||||
rCursor.style.display = 'none';
|
||||
recruitLines.style.display = 'flex';
|
||||
rl1.style.display = 'flex';
|
||||
|
||||
Reference in New Issue
Block a user