diff --git a/src/components/ExploreMore.module.css b/src/components/ExploreMore.module.css index fb3cc4d7221..6de8cc0a175 100644 --- a/src/components/ExploreMore.module.css +++ b/src/components/ExploreMore.module.css @@ -21,6 +21,7 @@ limitations under the License. --ifm-button-background-color: white !important; --ifm-button-border-radius: 15% 0 / 100% 0; margin-bottom: 20px; + transition: 0.5s; } .exploreMore:hover { diff --git a/src/components/Repositories.js b/src/components/Repositories.js index 3367853440e..8845b636287 100644 --- a/src/components/Repositories.js +++ b/src/components/Repositories.js @@ -13,46 +13,57 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - -import React, { useRef, useState } from "react"; +import React, { useRef, useState, useEffect } from "react"; import styles from "./Repositories.module.css"; import clsx from "clsx"; import Repository from "./Repository"; import ExploreMore from "./ExploreMore"; import Paginator from "./Paginator"; -function Repositories({reposData, reposConfig, showOnlyFeatured = false}) { +function Repositories({ reposData, reposConfig, showOnlyFeatured = false }) { const allRepos = reposData.filter(repo => showOnlyFeatured ? repo.featured : true) .sort((repo1, repo2) => repo1.name.localeCompare(repo2.name)); const pageCount = Math.ceil(allRepos.length / reposConfig.repositoriesPerPage); const getPageRepos = (page) => allRepos.slice(page * reposConfig.repositoriesPerPage, (page + 1) * reposConfig.repositoriesPerPage); + const [currentRepos, setCurrentRepos] = useState(getPageRepos(0)); + const [isVisible, setIsVisible] = useState(false); const thisElementRef = useRef(); + const handlePageClick = (event) => { + setIsVisible(false); setCurrentRepos(getPageRepos(event.selected)); - thisElementRef.current.scrollIntoView() + thisElementRef.current.scrollIntoView(); }; + useEffect(() => { + setIsVisible(true); + }, [currentRepos]); + return ( -
- - - +
+ + +
- ) + ); } -function CurrentPageRepositories({repos}) { +function CurrentPageRepositories({ repos, isVisible }) { return ( -
+
- { repos.map(repo => ()) } + {repos.map(repo => ())}
- ) + ); } -export default Repositories; +export default Repositories; \ No newline at end of file diff --git a/src/components/Repositories.module.css b/src/components/Repositories.module.css index 859ac4341b0..da482f0340e 100644 --- a/src/components/Repositories.module.css +++ b/src/components/Repositories.module.css @@ -13,6 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +html { + scroll-behavior: smooth; /* Enable smooth scrolling */ +} + .repositoriesSection { display: flex; diff --git a/src/components/Social.module.css b/src/components/Social.module.css index 7198421f5a5..9201b1d7f28 100644 --- a/src/components/Social.module.css +++ b/src/components/Social.module.css @@ -24,9 +24,13 @@ limitations under the License. } .social .socialColumn { - margin-bottom: 1rem; + margin-bottom: 1rem; + transition: transform 0.3s; } +.social .socialColumn:hover { + transform: scale(1.02); +} .socialHeaderAndBody { --social-border-color: rgb(126, 220, 186); --social-border-size: 5px; diff --git a/src/css/global.css b/src/css/global.css index d87a30ce67c..7cf7c9785cd 100644 --- a/src/css/global.css +++ b/src/css/global.css @@ -62,8 +62,12 @@ limitations under the License. } .navbar__toggle { color: var(--ifm-navbar-link-color); + transition: 0.15s; } +.navbar__toggle:hover{ + color: var( --anchor-hover-color); +} /** * Menu side bar */