generated from arvinxx/monorepo-template
-
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.
- Loading branch information
Showing
7 changed files
with
188 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
import React from 'react'; | ||
import ImageGallery from '@arvinxu/image-gallery'; | ||
|
||
const images = [ | ||
{ | ||
title: '组件库 Logo', | ||
description: '首选使用', | ||
url: 'https://gw.alipayobjects.com/zos/antfincdn/25czckBZI1/1.svg', | ||
}, | ||
]; | ||
import { images } from './data'; | ||
|
||
const Demo = () => { | ||
return <ImageGallery imageList={images} />; | ||
return <ImageGallery imageList={images} darkBackground={'black'} />; | ||
}; | ||
|
||
export default Demo; |
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,49 @@ | ||
import { ImageList } from '@arvinxu/image-gallery'; | ||
|
||
export const images: ImageList = [ | ||
{ | ||
title: '渐变色 Logo', | ||
description: '渐变色', | ||
url: 'https://gw.alipayobjects.com/zos/antfincdn/LFmaI3%26OJh/logo.svg', | ||
}, | ||
{ | ||
title: '黑色 Logo', | ||
description: '亮色背景下使用', | ||
url: | ||
'https://gw.alipayobjects.com/zos/antfincdn/FEuGy%26pKf2/black-logo.svg', | ||
}, | ||
{ | ||
title: '黑色方形 Logo', | ||
description: '亮色背景下使用', | ||
url: | ||
'https://gw.alipayobjects.com/zos/antfincdn/iCZHoHFqZM/squre-black.svg', | ||
}, | ||
{ | ||
title: '白色方形 Logo', | ||
description: '亮色背景下使用', | ||
dark: true, | ||
url: | ||
'https://gw.alipayobjects.com/zos/antfincdn/9IE%24pNh%26d3/squre-white.svg', | ||
}, | ||
{ | ||
title: '白色 Logo', | ||
description: '暗色背景下使用', | ||
dark: true, | ||
padding: 12, | ||
darkBackground: 'black', | ||
url: 'https://gw.alipayobjects.com/zos/antfincdn/5qY87lPw9U/white-logo.svg', | ||
}, | ||
{ | ||
title: '白色 Logo', | ||
description: '暗色背景下使用', | ||
dark: true, | ||
darkBackground: '#1fadd3', | ||
url: | ||
'https://gw.alipayobjects.com/zos/antfincdn/3vXiuFe18O/black-white.svg', | ||
}, | ||
{ | ||
title: '黑色 Logo', | ||
description: '亮色背景下使用', | ||
url: 'https://gw.alipayobjects.com/zos/antfincdn/fmXECsJXUY/light.svg', | ||
}, | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
#mountNode { | ||
padding: 8px; | ||
} | ||
.avx-image-gallery { | ||
&-masonry { | ||
column-count: 4; | ||
column-gap: 0; | ||
|
||
.masonry { | ||
column-count: 4; | ||
column-gap: 0; | ||
} | ||
@media (max-width: 400px) { | ||
column-count: 2; | ||
} | ||
|
||
@media (max-width: 400px) { | ||
.masonry { | ||
column-count: 2; | ||
@media (max-width: 1200px) { | ||
column-count: 3; | ||
} | ||
} | ||
} | ||
|
||
@media (max-width: 1200px) { | ||
.masonry { | ||
column-count: 3; | ||
&-item { | ||
break-inside: avoid; | ||
box-sizing: border-box; | ||
padding: 8px; | ||
} | ||
} | ||
&-image { | ||
width: 100%; | ||
height: 100%; | ||
cursor: pointer; | ||
|
||
.item { | ||
break-inside: avoid; | ||
box-sizing: border-box; | ||
padding: 8px; | ||
} | ||
&-ctn { | ||
padding: 24px; | ||
} | ||
} | ||
|
||
.link { | ||
padding: 4px 0; | ||
} | ||
&-link { | ||
padding: 4px 0; | ||
} | ||
|
||
.ant-card-actions { | ||
background: #fafafa; | ||
.ant-card-actions { | ||
background: #fafafa; | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
packages/image-gallery/tests/__snapshots__/index.test.tsx.snap
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,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ImageGallery 默认状态 1`] = ` | ||
<div> | ||
<div | ||
class="avx-image-gallery-container avx-image-gallery-masonry" | ||
> | ||
<canvas | ||
id="canvas" | ||
style="display: none;" | ||
/> | ||
</div> | ||
</div> | ||
`; |