-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
website: Added carousel infinite slider of OS logos
- Loading branch information
1 parent
42388ce
commit edd1a48
Showing
22 changed files
with
167 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import {useState} from 'react'; | ||
import Heading from '@theme/Heading'; | ||
import styles from './styles.module.css'; | ||
|
||
const imgLogoRootPath = '/sparky/img/os-logos'; | ||
|
||
const osList = [ | ||
'debian', | ||
'ubuntu', | ||
'fedora', | ||
'arch', | ||
'gentoo', | ||
'freebsd', | ||
'openbsd' | ||
]; | ||
|
||
const logoList = [...osList, ...osList]; | ||
|
||
function Logo({name}) { | ||
const [imgPath, s_imgPath] = useState(`${imgLogoRootPath}/logo-bw-${name}.png`); | ||
const handleMouseEnter = () => { | ||
s_imgPath(`${imgLogoRootPath}/logo-color-${name}.png`); | ||
}; | ||
const handleMouseLeave = () => { | ||
s_imgPath(`${imgLogoRootPath}/logo-bw-${name}.png`); | ||
}; | ||
return ( | ||
<li className={styles.logo_list_item}> | ||
<img onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} src={imgPath} alt={name} /> | ||
</li> | ||
); | ||
} | ||
|
||
function LogoList() { | ||
return ( | ||
<ul className={styles.logo_list}> | ||
{logoList.map((name, idx) => ( | ||
<Logo key={idx} name={name} /> | ||
))} | ||
</ul> | ||
); | ||
} | ||
|
||
function Carousel() { | ||
return ( | ||
<div className={styles.carousel}> | ||
<LogoList /> | ||
</div> | ||
); | ||
} | ||
|
||
export default function HomepageCarousel() { | ||
return ( | ||
<section className={styles.container}> | ||
<Heading className={styles.title} as='h2'> | ||
Officially supported and tested on multiple OSes. | ||
</Heading> | ||
<Carousel /> | ||
</section> | ||
); | ||
} |
69 changes: 69 additions & 0 deletions
69
docs/www/src/components/HomepageCarousel/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
:root { | ||
--carousel-gradient-color: #fff; | ||
} | ||
[data-theme='dark'] { | ||
--carousel-gradient-color: #1b1b1d; | ||
} | ||
|
||
.container { | ||
padding-top: 68px; | ||
} | ||
|
||
.title { | ||
text-align: center; | ||
} | ||
|
||
.carousel { | ||
position: relative; | ||
display: flex; | ||
overflow: hidden; | ||
align-items: center; | ||
margin: auto; | ||
width: 90%; | ||
padding-top: 30px; | ||
padding-bottom: 68px; | ||
} | ||
.carousel::before, | ||
.carousel::after { | ||
position: absolute; | ||
content: ""; | ||
height: 100%; | ||
width: 128px; | ||
z-index: 2; | ||
} | ||
.carousel::before { | ||
left: 0; | ||
background: linear-gradient(to left, #fff0, var(--carousel-gradient-color)); | ||
} | ||
.carousel::after { | ||
right: 0; | ||
background: linear-gradient(to right, #fff0, var(--carousel-gradient-color)); | ||
} | ||
|
||
@keyframes slide-anim { | ||
100% { | ||
transform: translateX(calc(-100% / 2.02)); | ||
} | ||
} | ||
|
||
.logo_list { | ||
display: flex; | ||
list-style: none; | ||
animation: 25s slide-anim infinite linear; | ||
} | ||
.logo_list:hover { | ||
animation-play-state: paused; | ||
} | ||
|
||
.logo_list_item { | ||
width: 150px; | ||
margin-left: 3rem; | ||
} | ||
|
||
.logo_list_item img { | ||
height: 100px; | ||
transition: transform 0.3s ease-in-out; | ||
} | ||
.logo_list_item img:hover { | ||
transform: scale(1.15); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,5 @@ | |
} | ||
|
||
.featureImg:hover { | ||
transform: scale(1.05); | ||
transform: scale(1.1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.