Pixel Distortion
21 |with Three.js
22 |
├── .gitignore ├── LICENSE ├── README.md ├── css └── base.css ├── favicon.ico ├── img ├── 1.jpg ├── 2.jpg ├── 3.jpg └── 4.jpg ├── index.html ├── index2.html ├── index3.html ├── index4.html ├── js ├── app.js └── shader │ ├── fragment.glsl │ ├── vertex.glsl │ └── vertexParticles.glsl └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .cache 3 | .parcel-cache 4 | package-lock.json 5 | dist/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2009 - 2021 [Codrops](https://tympanus.net/codrops) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Distorted Pixels 2 | 3 | Distorting pixels with DataTexture, based on [Infinite Bad Guy website](https://billie.withyoutube.com/) 4 | 5 |  6 | 7 | [Article on Codrops](https://tympanus.net/codrops/?p=) 8 | 9 | [Demo](http://tympanus.net/Development/DistortedPixels/) 10 | 11 | 12 | ## Installation 13 | 14 | Install dependencies: 15 | 16 | ``` 17 | npm install 18 | ``` 19 | 20 | Compile the code for development and start a local server: 21 | 22 | ``` 23 | npx parcel index.html 24 | ``` 25 | 26 | Create the build: 27 | 28 | ``` 29 | npx parcel build index.html 30 | ``` 31 | 32 | ## Credits 33 | 34 | - Images from [Unsplash](https://unsplash.com/) 35 | 36 | ## Misc 37 | 38 | Follow Codrops: [Twitter](http://www.twitter.com/codrops), [Facebook](http://www.facebook.com/codrops), [GitHub](https://github.com/codrops), [Instagram](https://www.instagram.com/codropsss/) 39 | 40 | ## License 41 | [MIT](LICENSE) 42 | 43 | Made with :blue_heart: by [Codrops](http://www.codrops.com) 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /css/base.css: -------------------------------------------------------------------------------- 1 | *, 2 | *::after, 3 | *::before { 4 | box-sizing: border-box; 5 | } 6 | 7 | :root { 8 | font-size: 18px; 9 | } 10 | 11 | body { 12 | margin: 0; 13 | --color-text: #fff; 14 | --color-bg: #000; 15 | --color-link: #c63643; 16 | --color-link-hover: #fff; 17 | color: var(--color-text); 18 | background-color: var(--color-bg); 19 | font-family: mono45-headline, monospace; 20 | -webkit-font-smoothing: antialiased; 21 | -moz-osx-font-smoothing: grayscale; 22 | } 23 | 24 | .demo-2 { 25 | --color-link: #b95e5d; 26 | } 27 | 28 | .demo-3 { 29 | --color-link: #f7bcac; 30 | } 31 | 32 | .demo-4 { 33 | --color-link: #bf8b5b; 34 | } 35 | 36 | .lil-gui { 37 | visibility: hidden; 38 | } 39 | 40 | .demo-4 .lil-gui { 41 | visibility: visible; 42 | } 43 | 44 | /* Page Loader */ 45 | .js .loading::before, 46 | .js .loading::after { 47 | content: ''; 48 | position: fixed; 49 | z-index: 1000; 50 | } 51 | 52 | .js .loading::before { 53 | top: 0; 54 | left: 0; 55 | width: 100%; 56 | height: 100%; 57 | background: var(--color-bg); 58 | } 59 | 60 | .js .loading::after { 61 | top: 50%; 62 | left: 50%; 63 | width: 60px; 64 | height: 60px; 65 | margin: -30px 0 0 -30px; 66 | border-radius: 50%; 67 | opacity: 0.4; 68 | background: var(--color-link); 69 | animation: loaderAnim 0.7s linear infinite alternate forwards; 70 | 71 | } 72 | 73 | @keyframes loaderAnim { 74 | to { 75 | opacity: 1; 76 | transform: scale3d(0.5,0.5,1); 77 | } 78 | } 79 | 80 | a { 81 | text-decoration: none; 82 | color: var(--color-link); 83 | outline: none; 84 | } 85 | 86 | a:hover { 87 | color: var(--color-link-hover); 88 | outline: none; 89 | } 90 | 91 | /* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */ 92 | a:focus { 93 | /* Provide a fallback style for browsers 94 | that don't support :focus-visible */ 95 | outline: none; 96 | background: lightgrey; 97 | } 98 | 99 | a:focus:not(:focus-visible) { 100 | /* Remove the focus indicator on mouse-focus for browsers 101 | that do support :focus-visible */ 102 | background: transparent; 103 | } 104 | 105 | a:focus-visible { 106 | /* Draw a very noticeable focus style for 107 | keyboard-focus on browsers that do support 108 | :focus-visible */ 109 | outline: 2px solid red; 110 | background: transparent; 111 | } 112 | 113 | .unbutton { 114 | background: none; 115 | border: 0; 116 | padding: 0; 117 | margin: 0; 118 | font: inherit; 119 | } 120 | 121 | .unbutton:focus { 122 | outline: none; 123 | } 124 | 125 | .frame { 126 | padding: 3rem 5vw; 127 | text-align: center; 128 | position: relative; 129 | z-index: 1000; 130 | } 131 | 132 | .frame__title { 133 | font-size: 1rem; 134 | margin: 0 0 1rem; 135 | font-weight: normal; 136 | } 137 | 138 | .frame__links { 139 | display: inline; 140 | } 141 | 142 | .frame__links a:not(:last-child), 143 | .frame__demos a:not(:last-child) { 144 | margin-right: 1rem; 145 | } 146 | 147 | .frame__demos { 148 | margin: 1rem 0; 149 | } 150 | 151 | .frame__demo--current, 152 | .frame__demo--current:hover { 153 | color: var(--color-text); 154 | } 155 | 156 | .content { 157 | display: grid; 158 | width: 100vw; 159 | height: calc(100vh - 13rem); 160 | position: relative; 161 | padding: 3rem; 162 | } 163 | 164 | .content__title { 165 | font-family: mono45-headline, monospace; 166 | font-size: 13vw; 167 | line-height: 1; 168 | color: #fff; 169 | max-width: 50vw; 170 | font-weight: 400; 171 | margin: 0; 172 | align-self: center; 173 | pointer-events: none; 174 | } 175 | 176 | .content__title--centered { 177 | text-align: center; 178 | justify-self: center; 179 | } 180 | 181 | .content__title--style-1 { 182 | font-family: new-order, sans-serif; 183 | font-weight: 400; 184 | font-size: 10vw; 185 | line-height: 0.85; 186 | background: linear-gradient(90deg, #e9a680 0%,#992d46 50%, #064cb5 100%);; 187 | background-size: cover; 188 | -webkit-background-clip: text; 189 | -webkit-text-fill-color: transparent; 190 | background-clip: text; 191 | text-fill-color: transparent; 192 | } 193 | 194 | .content__title--style-2 { 195 | font-family: bely-display, serif; 196 | font-weight: 400; 197 | font-size: 10vw; 198 | opacity: 0.7; 199 | line-height: 0.8; 200 | } 201 | 202 | 203 | @media screen and (min-width: 53em) { 204 | .frame { 205 | position: fixed; 206 | text-align: left; 207 | z-index: 100; 208 | top: 0; 209 | left: 0; 210 | display: grid; 211 | align-content: space-between; 212 | width: 100%; 213 | max-width: none; 214 | height: 100vh; 215 | padding: 1.5rem 3.35rem; 216 | pointer-events: none; 217 | grid-template-columns: auto 1fr; 218 | grid-template-rows: auto auto auto; 219 | grid-template-areas: 'title ...' 220 | '... ...' 221 | 'links demos'; 222 | } 223 | .frame__title-wrap { 224 | grid-area: title; 225 | display: flex; 226 | } 227 | .frame__title { 228 | margin: 0; 229 | } 230 | .frame__tagline { 231 | position: relative; 232 | margin: 0 0 0 0.25rem; 233 | padding: 0 0 0 1rem; 234 | opacity: 0.5; 235 | } 236 | .frame__demos { 237 | margin: 0; 238 | grid-area: demos; 239 | justify-self: end; 240 | } 241 | .frame__links { 242 | grid-area: links; 243 | padding: 0; 244 | justify-self: start; 245 | } 246 | .frame a { 247 | pointer-events: auto; 248 | } 249 | .content { 250 | height: 100vh; 251 | } 252 | } 253 | #canvasContainer{ 254 | position: fixed; 255 | top: 0; 256 | left: 0; 257 | z-index: -1; 258 | width: 100%; 259 | height: 100%; 260 | } 261 | #canvasContainer img{ 262 | visibility: hidden; 263 | pointer-events: none; 264 | position: absolute; 265 | } 266 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akella/DistortedPixels/807e5497d9da9177df700d5694f9e3a5fd6df03a/favicon.ico -------------------------------------------------------------------------------- /img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akella/DistortedPixels/807e5497d9da9177df700d5694f9e3a5fd6df03a/img/1.jpg -------------------------------------------------------------------------------- /img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akella/DistortedPixels/807e5497d9da9177df700d5694f9e3a5fd6df03a/img/2.jpg -------------------------------------------------------------------------------- /img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akella/DistortedPixels/807e5497d9da9177df700d5694f9e3a5fd6df03a/img/3.jpg -------------------------------------------------------------------------------- /img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akella/DistortedPixels/807e5497d9da9177df700d5694f9e3a5fd6df03a/img/4.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |with Three.js
22 |with Three.js
22 |with Three.js
22 |with Three.js
22 |