|
| 1 | +import { css } from '@emotion/react'; |
| 2 | +import { Fragment } from 'react'; |
| 3 | +import { ReboundSection } from '../src'; |
| 4 | +import { SectionDummy } from './components/SectionDummy'; |
| 5 | + |
| 6 | +export default { |
| 7 | + title: 'Rebound/Section', |
| 8 | + component: ReboundSection, |
| 9 | + parameters: { |
| 10 | + docs: { |
| 11 | + page: null, |
| 12 | + }, |
| 13 | + }, |
| 14 | + argTypes: { |
| 15 | + rebound: { |
| 16 | + defaultValue: 20, |
| 17 | + control: { type: 'range', min: 0, max: 100 }, |
| 18 | + }, |
| 19 | + bottomRebound: { |
| 20 | + defaultValue: 40, |
| 21 | + control: { type: 'range', min: 0, max: 100 }, |
| 22 | + }, |
| 23 | + height: { |
| 24 | + defaultValue: 40, |
| 25 | + control: { type: 'number', min: 1 }, |
| 26 | + }, |
| 27 | + bottomHeight: { |
| 28 | + defaultValue: 60, |
| 29 | + control: { type: 'number', min: 1 }, |
| 30 | + }, |
| 31 | + primaryColor: { |
| 32 | + defaultValue: '#000', |
| 33 | + control: { type: 'color' }, |
| 34 | + }, |
| 35 | + secondaryColor: { |
| 36 | + defaultValue: '#FFF', |
| 37 | + control: { type: 'color' }, |
| 38 | + }, |
| 39 | + }, |
| 40 | +}; |
| 41 | + |
| 42 | +export function Basic({ |
| 43 | + rebound, |
| 44 | + bottomRebound, |
| 45 | + height, |
| 46 | + bottomHeight, |
| 47 | + primaryColor, |
| 48 | + secondaryColor, |
| 49 | + position, |
| 50 | +}: { |
| 51 | + rebound: number; |
| 52 | + bottomRebound: number; |
| 53 | + height: number; |
| 54 | + bottomHeight: number; |
| 55 | + primaryColor: string; |
| 56 | + secondaryColor: string; |
| 57 | + position?: 'bottom' | 'top'; |
| 58 | +}) { |
| 59 | + return ( |
| 60 | + <Fragment> |
| 61 | + <SectionDummy |
| 62 | + css={css` |
| 63 | + background-color: ${secondaryColor}; |
| 64 | + color: #000; |
| 65 | + padding-bottom: ${height}px; |
| 66 | + `} |
| 67 | + /> |
| 68 | + <ReboundSection |
| 69 | + rebound={rebound} |
| 70 | + bottomRebound={bottomRebound} |
| 71 | + height={height} |
| 72 | + bottomHeight={bottomHeight} |
| 73 | + primaryColor={primaryColor} |
| 74 | + position={position} |
| 75 | + css={css` |
| 76 | + color: #fff; |
| 77 | + margin-top: -${height}px; |
| 78 | + margin-bottom: -${bottomHeight}px; |
| 79 | + `} |
| 80 | + > |
| 81 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure, placeat velit? Sapiente delectus, quo perspiciatis, veniam at porro |
| 82 | + consequatur, vel explicabo optio impedit necessitatibus perferendis rerum aliquid itaque fugit inventore. Omnis debitis voluptatibus |
| 83 | + sunt error laboriosam aperiam fuga. Eius, labore, aut, fugiat eligendi nam quasi doloremque dolore laudantium atque consequuntur |
| 84 | + minus! Soluta similique reiciendis beatae unde perspiciatis et! Doloribus, nostrum. Excepturi non maxime eius minus voluptate. Ad, |
| 85 | + nemo distinctio suscipit voluptatibus, dignissimos magnam modi quisquam illo nobis, a vitae unde sit consequatur eum numquam ipsa id |
| 86 | + in. Expedita, quod quam? Nam, repellendus! Assumenda impedit voluptas corporis debitis quam aut cumque, perferendis, nobis minus |
| 87 | + obcaecati quos distinctio tenetur delectus repellat error reiciendis laborum? Ratione veniam illum odio tempora ad voluptates natus? |
| 88 | + Maiores at veniam soluta neque tempore? Non molestiae eum iusto alias vel quisquam ipsum, numquam in molestias minima eius aut, ex |
| 89 | + saepe. Maxime earum molestias voluptates dicta iste iure veniam? |
| 90 | + </ReboundSection> |
| 91 | + |
| 92 | + <SectionDummy |
| 93 | + css={css` |
| 94 | + background-color: ${secondaryColor}; |
| 95 | + color: #000; |
| 96 | + padding-top: ${bottomHeight}px; |
| 97 | + `} |
| 98 | + /> |
| 99 | + </Fragment> |
| 100 | + ); |
| 101 | +} |
| 102 | + |
| 103 | +export function BackgroundImages({ |
| 104 | + rebound, |
| 105 | + bottomRebound, |
| 106 | + height, |
| 107 | + bottomHeight, |
| 108 | + primaryColor, |
| 109 | + secondaryColor, |
| 110 | + position, |
| 111 | +}: { |
| 112 | + rebound: number; |
| 113 | + bottomRebound: number; |
| 114 | + height: number; |
| 115 | + bottomHeight: number; |
| 116 | + primaryColor: string; |
| 117 | + secondaryColor: string; |
| 118 | + position?: 'bottom' | 'top'; |
| 119 | +}) { |
| 120 | + return ( |
| 121 | + <Fragment> |
| 122 | + <SectionDummy |
| 123 | + css={css` |
| 124 | + background-color: ${secondaryColor}; |
| 125 | + background-image: url(./res/photo2.jpg); |
| 126 | + background-size: cover cover; |
| 127 | + background-position: center; |
| 128 | + background-repeat: no-repeat; |
| 129 | + color: #000; |
| 130 | + padding-bottom: ${height}px; |
| 131 | + `} |
| 132 | + /> |
| 133 | + <ReboundSection |
| 134 | + rebound={rebound} |
| 135 | + bottomRebound={bottomRebound} |
| 136 | + height={height} |
| 137 | + bottomHeight={bottomHeight} |
| 138 | + primaryColor={primaryColor} |
| 139 | + position={position} |
| 140 | + css={css` |
| 141 | + color: #fff; |
| 142 | + background-image: url(./res/photo.jpg); |
| 143 | + background-size: cover cover; |
| 144 | + background-position: center; |
| 145 | + background-repeat: no-repeat; |
| 146 | + margin-top: -${height}px; |
| 147 | + margin-bottom: -${bottomHeight}px; |
| 148 | + `} |
| 149 | + > |
| 150 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure, placeat velit? Sapiente delectus, quo perspiciatis, veniam at porro |
| 151 | + consequatur, vel explicabo optio impedit necessitatibus perferendis rerum aliquid itaque fugit inventore. Omnis debitis voluptatibus |
| 152 | + sunt error laboriosam aperiam fuga. Eius, labore, aut, fugiat eligendi nam quasi doloremque dolore laudantium atque consequuntur |
| 153 | + minus! Soluta similique reiciendis beatae unde perspiciatis et! Doloribus, nostrum. Excepturi non maxime eius minus voluptate. Ad, |
| 154 | + nemo distinctio suscipit voluptatibus, dignissimos magnam modi quisquam illo nobis, a vitae unde sit consequatur eum numquam ipsa id |
| 155 | + in. Expedita, quod quam? Nam, repellendus! Assumenda impedit voluptas corporis debitis quam aut cumque, perferendis, nobis minus |
| 156 | + obcaecati quos distinctio tenetur delectus repellat error reiciendis laborum? Ratione veniam illum odio tempora ad voluptates natus? |
| 157 | + Maiores at veniam soluta neque tempore? Non molestiae eum iusto alias vel quisquam ipsum, numquam in molestias minima eius aut, ex |
| 158 | + saepe. Maxime earum molestias voluptates dicta iste iure veniam? |
| 159 | + </ReboundSection> |
| 160 | + |
| 161 | + <SectionDummy |
| 162 | + css={css` |
| 163 | + background-color: ${secondaryColor}; |
| 164 | + color: #000; |
| 165 | + padding-top: ${bottomHeight}px; |
| 166 | + `} |
| 167 | + /> |
| 168 | + </Fragment> |
| 169 | + ); |
| 170 | +} |
0 commit comments