File tree Expand file tree Collapse file tree 5 files changed +44
-4
lines changed
Expand file tree Collapse file tree 5 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1313 <% # Logo %>
1414
1515 <div class =" W40p md_W25p md_Flg0.25" >
16- <a href =" /#hero-page" class =" Mxw35u md_Mxw25u D" >
16+ <a href =" /#hero-page" id = " header-logo " class =" Mxw35u md_Mxw25u D <%= it.cssHeaderLogoVisibility %> Ts-O;$shortTs " >
1717 <img class =" D P1u;2u W70p sm_W85p md_W100p" alt =" mlut logo" src =" /assets/img/logo.png" >
1818 </a >
1919 </div >
Original file line number Diff line number Diff line change 11---
22layout: 'base.ejs'
3- title : Arts
3+ area : Arts
44---
55<%
66 const artsPageCSS = {
Original file line number Diff line number Diff line change 1+ const hero = document . querySelector ( '#hero-page' ) ;
2+ const logo = document . querySelector ( '#header-logo' ) ;
3+
4+ function handleIntersect ( entries , observer ) {
5+ entries . forEach ( entry => {
6+ if ( ! entry . isIntersecting ) {
7+ logo . style . visibility = "visible" ;
8+ logo . style . opacity = 1 ;
9+ } else {
10+ logo . style . opacity = 0 ;
11+ setTimeout ( ( ) => {
12+ logo . style . visibility = "hidden" ;
13+ } , 200 ) ;
14+ } ;
15+ } ) ;
16+ } ;
17+
18+ function createObserver ( ) {
19+ const options = {
20+ root : null ,
21+ threshold : "0.15" ,
22+ rootMargin : "0px" ,
23+ } ;
24+
25+ const observer = new IntersectionObserver ( handleIntersect , options ) ;
26+ observer . observe ( hero ) ;
27+ } ;
28+
29+ createObserver ( ) ;
Original file line number Diff line number Diff line change 11---
22layout: 'base.ejs'
3+ area: 'main'
34---
45<%
56 const sectionHeader = " Txa-c M0;0;5u Fns7u C-$accent900"
Original file line number Diff line number Diff line change 1+ <%
2+ let cssHeaderLogoVisibility = " Vs-v O1"
3+ if (it .area === " main" ){
4+ cssHeaderLogoVisibility = " Vs-h O0"
5+ }
6+
7+ %>
8+
19<!DOCTYPE html>
210<html lang =" en"
311 class ="
1422 <title >mlut - make CSS exciting again!</title >
1523</head >
1624<body class =" D-f Fld-c Jc-sb Fnf-sans-serif Bgc-$core950" >
17-
18- <% - include (' ../_includes/header/header.ejs' ) %>
25+ <% - include (' ../_includes/header/header.ejs' ,{
26+ cssHeaderLogoVisibility: cssHeaderLogoVisibility
27+ }) %>
1928 <main >
2029 <% - it .content %>
2130 </main >
2433
2534 <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js" ></script >
2635 <script >hljs .highlightAll (); </script >
36+ <script src =" ../assets/script/toggleLogo.js" type =" module" ></script >
2737</body >
2838</html >
You can’t perform that action at this time.
0 commit comments