Skip to content

Commit

Permalink
✧ Hotfix 01-03-07/1
Browse files Browse the repository at this point in the history
- Added comments to js,
- Optimized js,
- Bug fixes.

The associated update was termed '01-02-07' due to an error. The target is the second instance.
  • Loading branch information
jakubekgranie committed Jul 25, 2024
1 parent 0a9408b commit 0fddab6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="update-sticky us-fg t-p2" id="us">
<p class="mg-0 header-p">Early Development Period</p>
<span class="mg-0 us-ch-p" id="us-feed">
Update 01-02-07
Hotfix 01-03-07/1
</span>
</div>
<div class="update-sticky us-bg t-p2" id="us2"></div> <!--the style usage is essential for some reason-->
Expand Down
41 changes: 25 additions & 16 deletions js.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
- Subtext init (lor[r]-esque);
- parallax-bound imagery;
- emphasize subs;
- logo
- animation ideas
- sections
- about me
- what do i do + langs
- current projects
- contact
*/
let vw = window.innerWidth * 0.01, vh = window.innerHeight * 0.01;
window.onload = () => {
const us = document.getElementById("us"), us2 = document.getElementById("us2"), usHeight = us.clientHeight / vw - 2; // why does html generate such abhorrent spaces on resize?
document.getElementById("us-feed").innerHTML += "<hr class='mg-0 br-us_init'>==== CHANGELOG<br>Automated this element.";
document.getElementById("us-feed").innerHTML += "<hr class='mg-0 br-us_init'>==== CHANGELOG<br>- Added comments to js,<br>- Optimized js,<br>- Bug fixes.<br><br>The associated update was termed '01-02-07' due to an error. The target is the second instance.";
const usExtendedHeight = us.clientHeight / vw - 2, us2Margin = usExtendedHeight - usHeight;
console.log(usHeight * vw + ' ' + usExtendedHeight * vw);
us.style.height = usHeight + "vw";
us2.style.top = us.clientHeight + window.innerWidth * 0.01125 + "px"; // resize breaks
function loopedLetterRand(i, elementTextP, slogan){ // for every external loop call, start from one letter further.
function loopedLetterRand(i, elementTextP, slogan){ // for every external loop call, start from one letter further. legacy. the core component of randomizeAddress().
let elementText = [], elementTextReady = "";
/*if(typeof elementTextP === undefined || elementTextP == null || elementTextP.length != slogan.length){
elementTextP = "";
Expand All @@ -33,7 +39,7 @@ window.onload = () => {
elementTextReady += elementText[j];
return elementTextReady;
}
function randomizeAddress(elementText, slogan, waitTime){
function randomizeAddress(elementText, slogan, waitTime){ // legacy. storing for potential later use.
for(let i = 0; i < slogan.length; i++)
for(let j = 1; j < 11; j++){
setTimeout(() => {
Expand All @@ -42,24 +48,27 @@ window.onload = () => {
}, waitTime / 3 * j * (i + 1) + 20);
}
}

const ids = ["about-me"], functions = [() => {console.warn("")}], params = [["-a", "-nd"]], IOs = [false ,{root: null, rootMargin: "0px",threshold: 0.75}]; //after, nondisc;
const ids = ["about-me"], functions = [() => {console.warn("This is a test trigger.")}], params = [["-a", "-nd"]], IOs = [false ,{root: null, rootMargin: "0px",threshold: 0.75}]; //after, nondisc;
function callback(entries, observer, index){
entries.forEach(entry => {
let data = [false, false];
params[index].forEach(param => { // parameter reader. some params may not be present, and so, using this is more efficient than multiple arrays of maximum size assuming there'll be many.
switch(param){
case "-a":
data[0] = true;
break;
case "-nd":
data[1] = true;
break;
}
});
if(entry.isIntersecting){
functions[index]();
let d = true;
params[index].forEach(param => {
if(param == "-nd")
d = false;
});
if(d)
if(!data[1])
observer.disconnect();
}
params[index].forEach(param => {
if(param == "-a" && !entry.isIntersecting)
functions[index]();
});
if(data[0] && !entry.isIntersecting)
functions[index]();
});
}
ids.forEach((value, index) => {
Expand Down

0 comments on commit 0fddab6

Please sign in to comment.