├── .babelrc ├── .browserslistrc ├── .czrc ├── .editorconfig ├── .firebaserc ├── .gitignore ├── .gitlab-ci.yml ├── .postcssrc ├── .prettierrc ├── .stylelintrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── assets ├── demo.gif ├── index.html └── public │ ├── android-chrome-96x96.png │ ├── apple-touch-icon.png │ ├── browserconfig.xml │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── mstile-150x150.png │ ├── og-image.png │ ├── robots.txt │ ├── safari-pinned-tab.svg │ └── site.webmanifest ├── config ├── iconSvgPaths.js ├── paths.js ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js ├── firebase.json ├── package-lock.json ├── package.json ├── src ├── _generic │ ├── actions │ │ └── index.ts │ ├── scss-modules │ │ └── utils.scss │ ├── supply │ │ ├── action-helpers.ts │ │ ├── get-color.ts │ │ └── utils.ts │ ├── types │ │ └── common.ts │ └── ui │ │ ├── Btn │ │ ├── index.tsx │ │ └── style.scss │ │ ├── Ico │ │ ├── icons.ts │ │ └── index.tsx │ │ ├── Logo.tsx │ │ ├── MapElement.tsx │ │ ├── Overlay │ │ ├── index.tsx │ │ └── style.scss │ │ ├── ReactiveList.tsx │ │ ├── ShowIf.tsx │ │ └── Video │ │ ├── index.tsx │ │ └── style.scss ├── _shell │ ├── App.tsx │ ├── ButtonDego │ │ ├── index.tsx │ │ └── style.scss │ ├── HowToUse │ │ ├── index.tsx │ │ └── style.scss │ ├── Shell │ │ ├── index.tsx │ │ └── style.scss │ ├── analytics.ts │ ├── blueprint.css │ ├── index.ts │ └── overrides.css ├── area-selector │ ├── index.tsx │ └── style.scss ├── custom.d.ts ├── first-interaction │ ├── Landing.tsx │ ├── logic.ts │ ├── prerender.ts │ └── style.scss ├── get-the-code │ ├── index.tsx │ └── style.scss ├── grid │ ├── Highlighter.tsx │ ├── TrackOverlay.tsx │ ├── Tracks.tsx │ ├── index.tsx │ ├── state.ts │ └── style.scss ├── items │ ├── Item │ │ ├── index.tsx │ │ └── style.scss │ ├── index.tsx │ ├── state.ts │ └── style.scss ├── kit-sections │ ├── Characters.tsx │ ├── Check.tsx │ ├── Color │ │ ├── index.tsx │ │ └── style.scss │ ├── GridSettings.tsx │ ├── ItemSettings.tsx │ ├── Kit │ │ ├── index.tsx │ │ └── style.scss │ ├── Location.tsx │ ├── Name.tsx │ ├── Repeat.tsx │ ├── Select.tsx │ ├── Size.tsx │ └── TrackSettings.tsx ├── preview │ ├── index.tsx │ ├── state.ts │ └── style.scss └── tips │ ├── index.tsx │ └── style.scss ├── tsconfig.dev.json ├── tsconfig.json ├── tslint.json └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | } 9 | } 10 | ] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | cover 75.5% 2 | not IE 11 3 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { "path": "cz-conventional-changelog" } 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.*] 4 | indent_style = tab 5 | indent_size = 3 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | end_of_line = lf 10 | max_line_length = 100 11 | 12 | [*.{json,yml}] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "css-grid-layout-generator", 4 | "staging": "css-grid-layout-generator", 5 | "production": "css-grid-layout-generator" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files 2 | /dist 3 | /public 4 | .idea 5 | .cache 6 | .awcache 7 | __vendor 8 | 9 | # parcel-plugin-bundle-visualiser report 10 | /report.html 11 | 12 | # Yeoman configuration 13 | /.yo-rc.json 14 | 15 | # Logs 16 | logs 17 | *.log 18 | npm-debug.log* 19 | 20 | # Runtime data 21 | pids 22 | *.pid 23 | *.seed 24 | 25 | # Directory for instrumented libs generated by jscoverage/JSCover 26 | lib-cov 27 | 28 | # Coverage directory used by tools like istanbul 29 | coverage 30 | 31 | # nyc test coverage 32 | .nyc_output 33 | 34 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # node-waf configuration 38 | .lock-wscript 39 | 40 | # Compiled binary addons (http://nodejs.org/api/addons.html) 41 | build/Release 42 | 43 | # Dependency directories 44 | node_modules 45 | jspm_packages 46 | 47 | # Optional npm cache directory 48 | .npm 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | .DS_Store 53 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | .deploy: &deploy 2 | stage: deploy 3 | image: evenbit/firebase 4 | script: 5 | - firebase use $CI_ENVIRONMENT_SLUG --token $FIREBASE_DEPLOY_KEY 6 | - firebase deploy --non-interactive --token $FIREBASE_DEPLOY_KEY -m "Pipe $CI_PIPELINE_ID Build $CI_BUILD_ID" 7 | 8 | .ex: &except-release 9 | only: 10 | - master 11 | except: 12 | variables: 13 | - $CI_COMMIT_MESSAGE =~ /^chore\(release\):.*/ 14 | 15 | stages: 16 | - build 17 | - deploy 18 | 19 | build: 20 | <<: *except-release 21 | stage: build 22 | image: node:10 23 | script: 24 | - git config --global user.name "Runner $CI_RUNNER_DESCRIPTION" 25 | - git config --global user.email "$GITLAB_USER_EMAIL" 26 | - npm install 27 | - npm run release 28 | - npm run build:app 29 | - git push --follow-tags $CI_TOKENIZED_REPOSITORY_URL HEAD:$CI_COMMIT_REF_NAME 30 | cache: 31 | key: '$CI_BUILD_REPO' 32 | paths: 33 | - node_modules/ 34 | artifacts: 35 | expire_in: 24 hrs 36 | paths: 37 | - dist/ 38 | 39 | deploy_staging: 40 | <<: *deploy 41 | <<: *except-release 42 | environment: 43 | name: staging 44 | url: https://css-grid-layout-generator.pw/ 45 | 46 | deploy_production: 47 | <<: *deploy 48 | <<: *except-release 49 | when: manual 50 | environment: 51 | name: production 52 | url: https://css-grid-layout-generator.pw/ 53 | -------------------------------------------------------------------------------- /.postcssrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "postcss-normalize": null, 4 | "autoprefixer": { 5 | "grid": true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | printWidth: 100 2 | useTabs: true 3 | semi: false 4 | singleQuote: true 5 | trailingComma: es5 6 | bracketSpacing: true 7 | jsxBracketSameLine: false 8 | arrowParens: always 9 | overrides: 10 | - files: "*.json" 11 | options: 12 | useTabs: false 13 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-recommended-scss", 3 | "rules": { 4 | "selector-pseudo-class-no-unknown": [true, { 5 | "ignorePseudoClasses": ["global"] 6 | }], 7 | "selector-pseudo-element-no-unknown": [true, { 8 | "ignorePseudoElements": ["global"] 9 | }] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib", 3 | "git.ignoreLimitWarning": true, 4 | "cSpell.words": ["Droppable", "grammarly"], 5 | "editor.formatOnSave": true, 6 | "[markdown]": { 7 | "editor.formatOnSave": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # [1.8.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.7.2...v1.8.0) (2018-12-23) 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * **CI:** except release ([cdc6d6a](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/cdc6d6a)) 12 | 13 | 14 | ### Features 15 | 16 | * **Export Code:** add syntax highlight ([9822786](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/9822786)) 17 | 18 | 19 | 20 | 21 | ## [1.7.2](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.7.1...v1.7.2) (2018-12-21) 22 | 23 | 24 | ### Bug Fixes 25 | 26 | * gtag ([25cbbec](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/25cbbec)) 27 | 28 | 29 | 30 | 31 | ## [1.7.1](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.7.0...v1.7.1) (2018-12-19) 32 | 33 | 34 | ### Bug Fixes 35 | 36 | * put GTM script into the head ([d572a6d](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/d572a6d)) 37 | 38 | 39 | 40 | 41 | # [1.7.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.6.0...v1.7.0) (2018-12-17) 42 | 43 | 44 | ### Features 45 | 46 | * first interaction + how to use ([628c004](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/628c004)) 47 | 48 | 49 | 50 | 51 | # [1.6.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.5.0...v1.6.0) (2018-12-14) 52 | 53 | 54 | ### Bug Fixes 55 | 56 | * **tipContainerFlexGrow:** change text ([acd18d4](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/acd18d4)) 57 | 58 | 59 | ### Features 60 | 61 | * **Item:** set width and height ([21cdee5](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/21cdee5)) 62 | 63 | 64 | 65 | 66 | # [1.5.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.4.0...v1.5.0) (2018-12-12) 67 | 68 | 69 | ### Features 70 | 71 | * add tips as (?) button ([f857f24](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/f857f24)) 72 | * export JSX, CSS Modules, Styled Components ([c910a97](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/c910a97)) 73 | * fit-content() notation for columns and rows ([d796c2e](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/d796c2e)) 74 | * toggle vision of item in preview ([f693166](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/f693166)) 75 | 76 | 77 | 78 | 79 | # [1.4.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.3.0...v1.4.0) (2018-12-10) 80 | 81 | 82 | ### Features 83 | 84 | * apply width and height if not grow ([a1c1086](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/a1c1086)) 85 | * remove bad guides ([ff36ec2](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/ff36ec2)) 86 | 87 | 88 | 89 | 90 | # [1.3.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.2.0...v1.3.0) (2018-12-10) 91 | 92 | 93 | ### Bug Fixes 94 | 95 | * **general:** iconSvgPaths, select item in preview ([c6960eb](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/c6960eb)) 96 | 97 | 98 | ### Features 99 | 100 | * collect analytics events ([357de8c](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/357de8c)) 101 | 102 | 103 | 104 | 105 | # [1.2.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.1.2...v1.2.0) (2018-12-09) 106 | 107 | 108 | ### Features 109 | 110 | * new shell ([b84e246](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/b84e246)) 111 | 112 | 113 | 114 | 115 | ## [1.1.2](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.1.1...v1.1.2) (2018-11-26) 116 | 117 | 118 | ### Bug Fixes 119 | 120 | * replace span to line by default ([0027b92](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/0027b92)) 121 | 122 | 123 | 124 | 125 | ## [1.1.1](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.1.0...v1.1.1) (2018-11-25) 126 | 127 | 128 | ### Bug Fixes 129 | 130 | * remove getColByIndex ([f28361a](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/f28361a)) 131 | 132 | 133 | 134 | 135 | # [1.1.0](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.0.1...v1.1.0) (2018-11-25) 136 | 137 | 138 | ### Features 139 | 140 | * add auto-fill and auto-fit to repeat ([7cb2c3a](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/7cb2c3a)) 141 | * control implicit grid tracks ([9e35b10](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/9e35b10)) 142 | * repeat() notation for columns and rows ([fcd9759](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/fcd9759)) 143 | 144 | 145 | 146 | 147 | ## [1.0.1](https://gitlab.com/sukazavr/css-grid-layout-generator/compare/v1.0.0...v1.0.1) (2018-11-17) 148 | 149 | 150 | ### Bug Fixes 151 | 152 | * add link to GitHub repo ([e6ab62a](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/e6ab62a)) 153 | * hide item editor during dragging ([d7afefe](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/d7afefe)) 154 | 155 | 156 | 157 | 158 | # 1.0.0 (2018-11-17) 159 | 160 | 161 | * init ([d732a8b](https://gitlab.com/sukazavr/css-grid-layout-generator/commit/d732a8b)) 162 | 163 | 164 | ### BREAKING CHANGES 165 | 166 | * The world got a new cool app ✨ 167 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Dmitrii Bykov 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 | # CSS Grid Layout Generator 2 | 3 | > The Quickest & Easiest Way To Build Complex CSS Grid Layouts 4 | 5 | ![Gif Demo](https://gitlab.com/sukazavr/css-grid-layout-generator/raw/master/assets/demo.gif) 6 | 7 | ## [https://css-grid-layout-generator.pw/](https://css-grid-layout-generator.pw/) 8 | 9 | ## Roadmap 10 | - Soon 11 | - [x] Auto-generated grid tracks (aka implicit grid tracks) 12 | - [x] repeat() notation for columns and rows 13 | - [x] fit-content() notation for columns and rows 14 | - Export Code 15 | - [x] Export HTML as JSX 16 | - [x] Export CSS as Styled Components 17 | - [x] Export class names as CSS Modules 18 | - [x] Syntax highlight 19 | - [ ] Add prefixes to grid names (to avoid potential class conflicts) 20 | - [ ] Button "Create CodePen" 21 | - [ ] Save and restore grid settings feature 22 | - Grid Items 23 | - [ ] Opacity adjustment 24 | - [ ] Support negative start/end lines 25 | - [ ] Show details as CSS-rules in a tooltip 26 | - Grid Editor 27 | - [ ] Set custom dimension for Auto Grid 28 | - Big Features 29 | - [ ] Conditional grid settings via CSS Media Queries 30 | - [ ] Nested Grids 31 | - Other 32 | - [x] Tips everywhere as (?) button 33 | - [ ] Drag & Drop for columns and rows 34 | - [ ] Support for touch screen devices 35 | - [ ] Persist grid settings (Local Storage) 36 | - [ ] Button "Reset Grid Settings" 37 | - [ ] Show preview in a new window 38 | 39 | ## How to commit 40 | 41 | ``` 42 | npx git-cz 43 | ``` 44 | 45 | ## Author 46 | 47 | **Dmitrii Bykov** 48 | 49 | - [github/sukazavr](https://github.com/sukazavr) 50 | - [telegram/sukazavr](https://telegram.me/sukazavr) 51 | - [linkedin/sukazavr](https://www.linkedin.com/in/sukazavr) 52 | 53 | ## License 54 | 55 | MIT License 56 | 57 | Copyright © 2018, [Dmitrii Bykov](https://sukazavr.ru). 58 | 59 | Permission is hereby granted, free of charge, to any person obtaining a copy 60 | of this software and associated documentation files (the "Software"), to deal 61 | in the Software without restriction, including without limitation the rights 62 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 63 | copies of the Software, and to permit persons to whom the Software is 64 | furnished to do so, subject to the following conditions: 65 | 66 | The above copyright notice and this permission notice shall be included in all 67 | copies or substantial portions of the Software. 68 | 69 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 70 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 71 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 72 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 73 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 74 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 75 | SOFTWARE. 76 | -------------------------------------------------------------------------------- /assets/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/demo.gif -------------------------------------------------------------------------------- /assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CSS Grid Layout Generator 6 | 10 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /assets/public/android-chrome-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/android-chrome-96x96.png -------------------------------------------------------------------------------- /assets/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #242424 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/favicon-16x16.png -------------------------------------------------------------------------------- /assets/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/favicon-32x32.png -------------------------------------------------------------------------------- /assets/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/favicon.ico -------------------------------------------------------------------------------- /assets/public/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/mstile-150x150.png -------------------------------------------------------------------------------- /assets/public/og-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukazavr/css-grid-layout-generator/90086099670b854870adf44a10b58389bc80f6d9/assets/public/og-image.png -------------------------------------------------------------------------------- /assets/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /assets/public/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CSS Grid Layout Generator", 3 | "short_name": "CSS Grid Layout Generator", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-96x96.png", 7 | "sizes": "96x96", 8 | "type": "image/png" 9 | } 10 | ], 11 | "theme_color": "#242424", 12 | "background_color": "#242424", 13 | "display": "standalone" 14 | } 15 | -------------------------------------------------------------------------------- /config/iconSvgPaths.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | /* 3 | * Copyright 2017 Palantir Technologies, Inc. All rights reserved. 4 | */ 5 | Object.defineProperty(exports, '__esModule', { value: true }) 6 | exports.IconSvgPaths16 = { 7 | 'chevron-up': [ 8 | 'M12.71 9.29l-4-4C8.53 5.11 8.28 5 8 5s-.53.11-.71.29l-4 4a1.003 1.003 0 0 0 1.42 1.42L8 7.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71z', 9 | ], 10 | 'chevron-down': [ 11 | 'M12 5c-.28 0-.53.11-.71.29L8 8.59l-3.29-3.3a1.003 1.003 0 0 0-1.42 1.42l4 4c.18.18.43.29.71.29s.53-.11.71-.29l4-4A1.003 1.003 0 0 0 12 5z', 12 | ], 13 | 'double-caret-vertical': [ 14 | 'M5 7h6a1.003 1.003 0 0 0 .71-1.71l-3-3C8.53 2.11 8.28 2 8 2s-.53.11-.71.29l-3 3A1.003 1.003 0 0 0 5 7zm6 2H5a1.003 1.003 0 0 0-.71 1.71l3 3c.18.18.43.29.71.29s.53-.11.71-.29l3-3A1.003 1.003 0 0 0 11 9z', 15 | ], 16 | } 17 | -------------------------------------------------------------------------------- /config/paths.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | 3 | export const root = path.resolve(__dirname, '..') 4 | 5 | export const src = path.resolve(root, 'src') 6 | export const dist = path.resolve(root, 'dist') 7 | export const assets = path.resolve(root, 'assets') 8 | export const pathPackage = path.resolve(root, 'package.json') 9 | 10 | export const publicAssets = path.resolve(assets, 'public') 11 | export const indexHtml = path.resolve(assets, 'index.html') 12 | 13 | export const firstInteraction = path.resolve(src, 'first-interaction') 14 | export const prerender = path.resolve(firstInteraction, 'prerender.ts') 15 | export const logic = path.resolve(firstInteraction, 'logic.ts') 16 | 17 | export const scssModules = path.resolve(src, '_generic/scss-modules') 18 | -------------------------------------------------------------------------------- /config/webpack.common.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import webpack from 'webpack' 3 | import { prerender, logic, dist, pathPackage, root } from './paths' 4 | 5 | const VERSION = require(pathPackage).version 6 | 7 | export default { 8 | context: root, 9 | target: 'web', 10 | resolve: { 11 | extensions: ['.js', '.ts', '.tsx', '.css', '.scss'], 12 | }, 13 | entry: { 14 | prerender, 15 | logic, 16 | }, 17 | output: { 18 | filename: '[name].js', 19 | path: dist, 20 | publicPath: '/', 21 | globalObject: 'self', 22 | }, 23 | plugins: [ 24 | new webpack.DefinePlugin({ 25 | // We set node.process=false later in this config. 26 | // Here we make sure if (process && process.foo) still works: 27 | process: JSON.stringify({ env: { VERSION } }), 28 | }), 29 | new webpack.NormalModuleReplacementPlugin( 30 | /.*\/generated\/iconSvgPaths.*/, 31 | path.resolve(__dirname, 'iconSvgPaths.js') 32 | ), 33 | ], 34 | // Turn off various NodeJS environment polyfills Webpack adds to bundles. 35 | // They're supposed to be added only when used, but the heuristic is loose 36 | // (eg: existence of a variable called setImmedaite in any scope) 37 | node: { 38 | console: false, 39 | // Keep global, it's just an alias of window and used by many third party modules: 40 | global: true, 41 | // Turn off process to avoid bundling a nextTick implementation: 42 | process: false, 43 | // Inline __filename and __dirname values: 44 | __filename: 'mock', 45 | __dirname: 'mock', 46 | // Never embed a portable implementation of Node's Buffer module: 47 | Buffer: false, 48 | // Never embed a setImmediate implementation: 49 | setImmediate: false, 50 | }, 51 | } 52 | -------------------------------------------------------------------------------- /config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' 2 | import HtmlWebpackPlugin from 'html-webpack-plugin' 3 | import StyleLintPlugin from 'stylelint-webpack-plugin' 4 | import webpack from 'webpack' 5 | import merge from 'webpack-merge' 6 | import { indexHtml, publicAssets, scssModules, src } from './paths' 7 | import common from './webpack.common' 8 | 9 | export default merge(common, { 10 | mode: 'development', 11 | devtool: 'inline-source-map', 12 | devServer: { 13 | hot: true, 14 | port: 36402, 15 | host: '0.0.0.0', 16 | public: 'localhost:36402', 17 | open: true, 18 | contentBase: publicAssets, 19 | watchOptions: { 20 | aggregateTimeout: 300, 21 | }, 22 | // Request paths not ending in a file extension serve index.html: 23 | historyApiFallback: true, 24 | // Supress the extensive stats normally printed after a dev build (since sizes are mostly useless): 25 | stats: 'minimal', 26 | // Don't embed an error overlay ("redbox") into the client bundle: 27 | overlay: false, 28 | }, 29 | plugins: [ 30 | new webpack.DefinePlugin({ 31 | 'process.env.NODE_ENV': "'development'", 32 | }), 33 | new webpack.HotModuleReplacementPlugin(), 34 | new webpack.NamedModulesPlugin(), 35 | new ForkTsCheckerWebpackPlugin(), 36 | new StyleLintPlugin({ 37 | context: src, 38 | syntax: 'scss', 39 | }), 40 | new HtmlWebpackPlugin({ 41 | template: indexHtml, 42 | minify: { 43 | removeComments: true, 44 | useShortDoctype: true, 45 | keepClosingSlash: true, 46 | collapseWhitespace: true, 47 | removeEmptyAttributes: true, 48 | removeRedundantAttributes: true, 49 | removeScriptTypeAttributes: true, 50 | removeStyleLinkTypeAttributes: true, 51 | }, 52 | }), 53 | ], 54 | module: { 55 | rules: [ 56 | { 57 | enforce: 'pre', 58 | test: /\.tsx?$/, 59 | include: src, 60 | loader: 'tslint-loader', 61 | }, 62 | { 63 | test: /\.tsx?$/, 64 | include: src, 65 | loader: 'awesome-typescript-loader', 66 | options: { 67 | transpileOnly: true, 68 | useTranspileModule: true, 69 | forceIsolatedModules: true, 70 | configFileName: 'tsconfig.dev.json', 71 | useCache: true, 72 | useBabel: true, 73 | babelCore: '@babel/core', 74 | babelOptions: { 75 | babelrc: false, 76 | presets: [['@babel/preset-env', { modules: false }]], 77 | plugins: ['@babel/plugin-syntax-dynamic-import', 'react-hot-loader/babel'], 78 | }, 79 | }, 80 | }, 81 | { 82 | test: /\.css$/, 83 | use: ['style-loader', 'css-loader', 'postcss-loader'], 84 | }, 85 | { 86 | test: /\.scss$/, 87 | use: [ 88 | 'style-loader', 89 | { 90 | loader: 'css-loader', 91 | options: { 92 | url: false, 93 | import: false, 94 | sourceMap: true, 95 | modules: true, 96 | camelCase: true, 97 | importLoaders: 2, 98 | exportOnlyLocals: true, 99 | localIdentName: '[local]__[hash:base64:5]', 100 | }, 101 | }, 102 | 'postcss-loader', 103 | { 104 | loader: 'sass-loader', 105 | options: { 106 | sourceMap: true, 107 | includePaths: [scssModules], 108 | }, 109 | }, 110 | ], 111 | }, 112 | ], 113 | }, 114 | }) 115 | -------------------------------------------------------------------------------- /config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | import CopyWebpackPlugin from 'copy-webpack-plugin' 2 | import CrittersPlugin from 'critters-webpack-plugin' 3 | import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' 4 | import HtmlWebpackExcludeAssetsPlugin from 'html-webpack-exclude-assets-plugin' 5 | import HtmlWebpackPlugin from 'html-webpack-plugin' 6 | import MiniCssExtractPlugin from 'mini-css-extract-plugin' 7 | import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin' 8 | import ScriptExtHtmlPlugin from 'script-ext-html-webpack-plugin' 9 | import SuppressChunksPlugin from 'suppress-chunks-webpack-plugin' 10 | import TerserPlugin from 'terser-webpack-plugin' 11 | import webpack from 'webpack' 12 | import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' 13 | import merge from 'webpack-merge' 14 | import { indexHtml, publicAssets, scssModules, src } from './paths' 15 | import common from './webpack.common' 16 | 17 | export default merge(common, { 18 | mode: 'production', 19 | output: { 20 | filename: '[name].[chunkhash:5].js', 21 | chunkFilename: '[name].[chunkhash:5].js', 22 | }, 23 | stats: { 24 | hash: true, 25 | timings: true, 26 | assets: true, 27 | chunks: true, 28 | chunkModules: false, 29 | modules: false, 30 | children: false, 31 | }, 32 | optimization: { 33 | minimizer: [ 34 | new TerserPlugin({ 35 | terserOptions: { 36 | compress: { 37 | inline: 1, 38 | }, 39 | mangle: { 40 | safari10: true, 41 | }, 42 | output: { 43 | safari10: true, 44 | }, 45 | }, 46 | }), 47 | ], 48 | }, 49 | plugins: [ 50 | new webpack.DefinePlugin({ 51 | 'process.env.NODE_ENV': "'production'", 52 | }), 53 | new webpack.optimize.SplitChunksPlugin({}), 54 | new MiniCssExtractPlugin({ 55 | filename: '[name].[contenthash:5].css', 56 | chunkFilename: '[name].[contenthash:5].css', 57 | }), 58 | new OptimizeCssAssetsPlugin({ 59 | cssProcessorOptions: { 60 | postcssReduceIdents: { 61 | counterStyle: false, 62 | gridTemplate: false, 63 | keyframes: false, 64 | }, 65 | }, 66 | }), 67 | new ForkTsCheckerWebpackPlugin(), 68 | new CopyWebpackPlugin([publicAssets]), 69 | new HtmlWebpackPlugin({ 70 | template: indexHtml, 71 | excludeAssets: [/prerender\..+\.js$/], 72 | minify: { 73 | removeComments: true, 74 | useShortDoctype: true, 75 | keepClosingSlash: true, 76 | collapseWhitespace: true, 77 | removeEmptyAttributes: true, 78 | removeRedundantAttributes: true, 79 | removeScriptTypeAttributes: true, 80 | removeStyleLinkTypeAttributes: true, 81 | }, 82 | }), 83 | new HtmlWebpackExcludeAssetsPlugin(), 84 | new SuppressChunksPlugin(['prerender']), 85 | new ScriptExtHtmlPlugin({ 86 | inline: ['logic'], 87 | }), 88 | new CrittersPlugin({ 89 | // use hack to load async css: 90 | preload: 'media', 91 | // inline all styles from any stylesheet below this size: 92 | inlineThreshold: 2000, 93 | // don't bother lazy-loading non-critical stylesheets below this size, just inline the non-critical styles too: 94 | minimumExternalSize: 4000, 95 | // don't emit