This is an automated email from the ASF dual-hosted git repository.

grobmeier pushed a commit to branch ms12_conversion_of_md_files
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/ms12_conversion_of_md_files by 
this push:
     new bf2ca5c74a removed gsap and improved effects by custom code
bf2ca5c74a is described below

commit bf2ca5c74ac8a3ea0deacaf945c01c78920026bd
Author: Christian Grobmeier <[email protected]>
AuthorDate: Tue Mar 5 15:01:45 2024 +0100

    removed gsap and improved effects by custom code
---
 src/asciidoc/templates/document.html.erb          | 42 ++++++++++-------------
 src/site/resources/css/logging-custom.css         | 13 +++++--
 src/site/resources/js/ScrollTrigger-3.12.5.min.js | 11 ------
 src/site/resources/js/gsap-3.12.5.min.js          | 11 ------
 4 files changed, 29 insertions(+), 48 deletions(-)

diff --git a/src/asciidoc/templates/document.html.erb 
b/src/asciidoc/templates/document.html.erb
index 8e066ea184..8268f8acd7 100644
--- a/src/asciidoc/templates/document.html.erb
+++ b/src/asciidoc/templates/document.html.erb
@@ -191,24 +191,24 @@
     </div><%
   end %>
 
-<script src="/js/gsap-3.12.5.min.js"></script>
-<script src="/js/ScrollTrigger-3.12.5.min.js"></script>
 <script>
     document.addEventListener('DOMContentLoaded', function() {
-        let tween = gsap.to(".table-of-content", {
-            delay:0.1,
-            duration: 0.5,
-            backgroundColor: '#ededed',
-            ease: "power3.out"
-        });
+      const header = document.querySelector('#header');
+      const toc = document.querySelector('.table-of-content');
 
-        ScrollTrigger.create({
-            trigger: '.table-of-content',
-            start: 'top top',
-            pin: '.table-of-content',
-            animation: tween,
-            toggleActions: 'play none none reverse'
-        });
+      window.addEventListener('scroll', function() {
+          const headerRect = header.getBoundingClientRect();
+          const rect = toc.getBoundingClientRect();
+
+          if (headerRect.bottom >= 0) {
+              toc.classList.remove('sticky-effect');
+              toc.classList.remove('sticky');
+          } else if (rect.top <= 0) {
+              toc.classList.add('sticky');
+              toc.classList.add('sticky-effect');
+          }
+
+      });
     });
 </script>
 <script>
@@ -220,21 +220,15 @@
         var duration = 0.7;
         menuIcon.addEventListener('click', function () {
             if (menu.classList.contains('menu-open')) {
-                gsap.to(menu, {duration: duration, ease: "power3.out", right: 
"-100%", onComplete: function() {
-                    menu.classList.remove('menu-open');
-                }});
+              menu.classList.remove('menu-open');
             } else {
-                gsap.to(menu, {duration: duration, ease: "power3.out", right: 
"0%", onStart: function() {
-                    menu.classList.add('menu-open');
-                }});
+              menu.classList.add('menu-open');
             }
         });
 
         menuIconClose.addEventListener('click', function () {
             if (menu.classList.contains('menu-open')) {
-                gsap.to(menu, {duration: duration, ease: "power3.out", right: 
"-100%", onComplete: function() {
-                    menu.classList.remove('menu-open');
-                }});
+                menu.classList.remove('menu-open');
             }
         });
     });
diff --git a/src/site/resources/css/logging-custom.css 
b/src/site/resources/css/logging-custom.css
index 709d0019d6..31217ed883 100644
--- a/src/site/resources/css/logging-custom.css
+++ b/src/site/resources/css/logging-custom.css
@@ -157,8 +157,17 @@
     padding: 2em;
     height: 100vh;
     max-height: 100vh;
-    overflow: scroll;
-    background-color: #fff;
+    overflow: auto;
+}
+
+.table-of-content.sticky {
+    position: sticky;
+    top: 0;
+}
+
+.table-of-content.sticky-effect {
+    background-color: #ededed;
+    transition: background-color 1s linear;
 }
 
 /** Small screens < 1400px */
diff --git a/src/site/resources/js/ScrollTrigger-3.12.5.min.js 
b/src/site/resources/js/ScrollTrigger-3.12.5.min.js
deleted file mode 100644
index cceb2b91a8..0000000000
--- a/src/site/resources/js/ScrollTrigger-3.12.5.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * ScrollTrigger 3.12.5
- * https://gsap.com
- * 
- * @license Copyright 2024, GreenSock. All rights reserved.
- * Subject to the terms at https://gsap.com/standard-license or for Club GSAP 
members, the agreement issued with that membership.
- * @author: Jack Doyle, [email protected]
- */
-
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof 
module?t(exports):"function"==typeof 
define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,function(e){"use
 strict";function _defineProperties(e,t){for(var r=0;r<t.length;r++){var 
n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in 
n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(){return 
Ce||"undefined"!=typeof 
window&&(Ce=window.gsap)&&Ce.registerPlugin&&Ce}function z(e, [...]
-
diff --git a/src/site/resources/js/gsap-3.12.5.min.js 
b/src/site/resources/js/gsap-3.12.5.min.js
deleted file mode 100644
index 14dd0a4853..0000000000
--- a/src/site/resources/js/gsap-3.12.5.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * GSAP 3.12.5
- * https://gsap.com
- * 
- * @license Copyright 2024, GreenSock. All rights reserved.
- * Subject to the terms at https://gsap.com/standard-license or for Club GSAP 
members, the agreement issued with that membership.
- * @author: Jack Doyle, [email protected]
- */
-
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof 
module?e(exports):"function"==typeof 
define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use
 strict";function 
_inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function
 _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't 
been initialised - super() hasn't been called");return t}function 
r(t){return"string"==typeo [...]
-

Reply via email to