Skip to content

Commit 241a851

Browse files
committed
Click Page to return from MidFader
When hitting the `§` button, clicking the "current page" again wouldn't show the page, added a check+function to reveal the page if hidden & current page clicked
1 parent 8acb39b commit 241a851

File tree

6 files changed

+49
-9
lines changed

6 files changed

+49
-9
lines changed

docs/index.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
<a href="Blog.htm" class="pageLinkStyle" pxlRoomName="CampfireEnvironment" pxlCameraView="default" page-name="Blog" alt="My ramblings...">Blog</a>
9696
<a href="AboutMe.htm" class="pageLinkStyle" pxlRoomName="CampfireEnvironment" pxlCameraView="aboutMe" page-name="AboutMe" alt="It's ah me! Marrr.... yeah"><span class="procPagesHideWhenThin">About&nbsp;</span>Me</a>
9797
<span id="procPagesToggleDOM" class="procPagesToggleDOMStyle">
98-
<a class="pageLinkStyle" pageEvent="ToggleDOM" pageValue=1 alt="Toggle the website contents">§</a>
99-
<a class="pageLinkStyle" pageEvent="ToggleDOM" pageValue=0 alt="Toggle the website contents">¤</a>
98+
<a class="pageLinkStyle pageLinkEventStyle" pageEvent="ToggleDOM" pageValue=1 alt="Toggle the website contents">§</a>
99+
<a class="pageLinkStyle pageLinkEventStyle" pageEvent="ToggleDOM" pageValue=0 alt="Toggle the website contents">¤</a>
100100
</span>
101101
</div>
102102
</div>

docs/js/procPages/ProcPage.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export class ProcPage {
135135
}
136136
});
137137
}
138+
139+
this.callbacks = [];
138140
}
139141

140142
// -- -- --
@@ -894,6 +896,8 @@ export class ProcPage {
894896
obj.classList.remove('pagesVisOff');
895897
obj.scrollTop = 0;
896898
});
899+
900+
console.log( this.sectionData[ sectionName ] );
897901
}
898902

899903

@@ -1090,4 +1094,18 @@ export class ProcPage {
10901094
return this.pageStyles.hasOwnProperty( styleType );
10911095
}
10921096

1097+
1098+
subscribe( callback ){
1099+
if( typeof callback == 'function' ){
1100+
this.callbacks.push( callback );
1101+
}
1102+
}
1103+
emit( ...args ){
1104+
this.callbacks.forEach( (callbackFn)=>{
1105+
if( typeof callbackFn == 'function' ){
1106+
callbackFn( ...args );
1107+
}
1108+
});
1109+
}
1110+
10931111
}

docs/js/procPages/ProcPageManager.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export class ProcPageManager {
277277
e.preventDefault();
278278
let curPageId = this.curPageName;
279279
if( linkText == curPageId ){
280+
this.checkDisplayState( false );
280281
return;
281282
}
282283
this.changePage( linkText, pxlRoomName, pxlCameraView );
@@ -494,6 +495,7 @@ export class ProcPageManager {
494495

495496
let pageObj = pageData[pageKey].buildPage();
496497
this.pageListing[pageKey][ "obj" ] = pageObj;
498+
console.log( pageObj )
497499
});
498500

499501
}
@@ -625,10 +627,7 @@ export class ProcPageManager {
625627
}
626628
}
627629

628-
if( this.domEventStates.ToggleDOM ){
629-
this.toggleMidFader( this.mainDiv, false );
630-
this.triggerDomEvent("ToggleDOM", false);
631-
}
630+
this.checkDisplayState( false );
632631

633632
// Set current page value
634633
let pageListing = this.pageListing[pageName];
@@ -742,6 +741,11 @@ export class ProcPageManager {
742741

743742
}
744743

744+
sectionChangeCallback( sectionData ){
745+
console.log( sectionData );
746+
}
747+
748+
745749
/**
746750
* @method checkForRedirect
747751
* @description Checks the URL for a 'redirect' query parameter and updates the page state accordingly
@@ -786,6 +790,7 @@ export class ProcPageManager {
786790
}
787791

788792

793+
789794
onResize(){}
790795

791796
/**
@@ -890,6 +895,17 @@ export class ProcPageManager {
890895
}
891896
}
892897

898+
checkDisplayState( toggleState=null){
899+
if( toggleState == null ){
900+
toggleState = this.domEventStates.ToggleDOM
901+
}
902+
903+
//if( this.domEventStates.ToggleDOM ){
904+
this.toggleMidFader( this.mainDiv, toggleState );
905+
this.triggerDomEvent("ToggleDOM", toggleState);
906+
//}
907+
}
908+
893909
/*runHidePages(){
894910
let pageListingKeys = Object.keys(this.pageListing);
895911
pageListingKeys.forEach( (pageKey)=>{

docs/pages/aboutMe/whatAmI.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const pageListingData = {
1616
<span class="textBold">Technical Artist</span>; 2D+3D asset optimization, shaders, & pipeline tools
1717
</div>
1818
<div class='procPagesAboutMe-skillListStyle'>
19-
<span class="ppamSkillListing">Houdini / VEX</span>
20-
<span class="ppamSkillListing">Maya / MEL</span>
21-
<span class="ppamSkillListing">Unity / C#</span>
19+
<span class="ppamSkillListing">Houdini <span class="textDrinkMeAlice">&nbsp;/&nbsp;</span> VEX</span>
20+
<span class="ppamSkillListing">Maya <span class="textDrinkMeAlice">&nbsp;/&nbsp;</span> MEL</span>
21+
<span class="ppamSkillListing">Unity <span class="textDrinkMeAlice">&nbsp;/&nbsp;</span> C#</span>
2222
<span class="ppamSkillListing">Photoshop</span>
2323
2424
<span class="ppamSkillListing">Python</span>

docs/style/procPages/procPages_aboutMeStyle.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
width: 100%;
187187
height: 100%;
188188
display: grid;
189+
grid-auto-flow: column;
190+
justify-content: center;
189191
align-items: center;
190192
justify-items: center;
191193
border: solid 1px rgba(97, 97, 97, 0.71);

docs/style/procPages/procPages_mainStyle.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ text-shadow: 1px 1.5px 4px #252525;
393393
transition: color .15s, border .15s, background-color .15s, text-shadow .15s;
394394
}
395395

396+
.pageLinkEventStyle{
397+
width: 1ch;
398+
}
399+
396400

397401
.imageDesc{
398402
display: grid;

0 commit comments

Comments
 (0)