mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
added example image switcher
This commit is contained in:
parent
7f168a93e7
commit
07f66c0146
3 changed files with 60 additions and 1 deletions
15
src/components/node/ImageSwitcher/index.tsx
Normal file
15
src/components/node/ImageSwitcher/index.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React, { FC } from 'react';
|
||||
import * as styles from './styles.scss';
|
||||
|
||||
const ImageSwitcher: FC<{}> = () => (
|
||||
<div className={styles.wrap}>
|
||||
<div className={styles.switcher}>
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export { ImageSwitcher };
|
42
src/components/node/ImageSwitcher/styles.scss
Normal file
42
src/components/node/ImageSwitcher/styles.scss
Normal file
|
@ -0,0 +1,42 @@
|
|||
.wrap {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.switcher {
|
||||
position: absolute;
|
||||
background: transparentize(black, 0.5);
|
||||
display: flex;
|
||||
right: $gap;
|
||||
top: $gap;
|
||||
border-radius: 24px;
|
||||
padding: 0 3px;
|
||||
flex-wrap: wrap;
|
||||
|
||||
& > div {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
box-sizing: border-box;
|
||||
opacity: .3;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.25s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
// background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: inset white 0 0 0 2px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,13 +8,15 @@ import { Comment } from '~/components/node/Comment';
|
|||
import { NodePanel } from '~/components/node/NodePanel';
|
||||
import { NodeRelated } from '~/components/node/NodeRelated';
|
||||
import { Tags } from '~/components/node/Tags';
|
||||
import { MenuButton } from '~/components/node/MenuButton';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { ImageSwitcher } from "~/components/node/ImageSwitcher";
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const ImageExample: FC<IProps> = () => (
|
||||
<Card className={styles.node} seamless>
|
||||
<ImageSwitcher />
|
||||
|
||||
<div className={styles.image_container}>
|
||||
<img
|
||||
className={styles.image}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue