This operation cannot be undone.
54 |├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── README.md ├── babel.config.js ├── index.html ├── jest.config.js ├── package-lock.json ├── package.json ├── public ├── CNAME ├── favicon.ico └── favicon.png ├── publish_to_gh_pages.sh ├── src ├── App.vue ├── about-page │ └── AboutPage.vue ├── assets │ └── logo.png ├── common │ ├── geometry.js │ ├── layers2css.js │ ├── shapes2css.js │ ├── shapes2css.spec.js │ ├── ui.js │ └── utils.js ├── components │ ├── AddButton.vue │ ├── CloseButton.vue │ ├── ColorPicker.vue │ ├── CopyButton │ │ ├── CopyButton.vue │ │ └── copy-button-shapes.json │ ├── CornerCloseButton.vue │ ├── CssOutput.vue │ ├── DraggableListMixin.js │ ├── EdgeCloseButton.vue │ ├── ExportToCodePenButton │ │ ├── ExportToCodePenButton.vue │ │ └── export-to-codepen-button-shape.json │ ├── HamburgerButton.vue │ ├── IconButton.vue │ ├── JsonOutput.vue │ ├── ProjectOutput.vue │ ├── TopNav.vue │ └── draggable-indicator.css ├── editor │ ├── EditorCanvas.vue │ ├── EditorWorkspace.vue │ ├── LayerPropsFormFields.vue │ ├── LayerSubtree.vue │ ├── ProjectEditor.vue │ ├── ProjectLayers.vue │ ├── PropsForm.vue │ ├── ShapeNameInput.vue │ ├── ShapeOverlay.vue │ ├── ShapeOverlays.vue │ ├── ShapePropsFormFields.vue │ ├── ShapeResizeHandles.vue │ ├── StopsEditor.vue │ ├── shapes-store.js │ └── shapes.js ├── favicon.clip ├── gallery │ ├── GalleryThumbnail.vue │ ├── ProjectGallery.vue │ ├── projects-store.js │ └── projects-store.spec.js ├── logo-128px.clip ├── logo-128px.png ├── main.js ├── persistence.js ├── react-to-keyboard.js ├── router │ └── index.js ├── snap │ ├── snap-store.js │ ├── snap.js │ └── snap.spec.js ├── store │ ├── index.js │ └── ui.js ├── toolbar │ ├── CurrentColorPicker.vue │ ├── LineThicknessPicker.vue │ ├── ShapeButton.vue │ ├── ShapeButtonGroup.vue │ ├── Toolbar.vue │ ├── ToolbarButton.vue │ ├── ToolbarSnapOptions.vue │ └── toolbar-button-shapes.js ├── undo-redo │ ├── RedoButton.vue │ ├── UndoButton.vue │ ├── redo-button-shapes.json │ ├── undo-button-shapes.json │ ├── undo-redo-store.js │ ├── undo-redo-store.spec.js │ └── undo-shape.json └── warn.js ├── vite.config.js ├── vue.config.js └── zerodivs-sample-03-x10.gif /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | es2021: true 5 | }, 6 | extends: ["plugin:vue/essential", "@vue/prettier"], 7 | rules: { 8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off", 9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" 10 | }, 11 | overrides: [ 12 | { 13 | files: ["**/*.spec.{j,t}s?(x)"], 14 | env: { 15 | jest: true 16 | } 17 | } 18 | ] 19 | }; 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jperals/zerodivs/d272e296d7384d3a5ec172c54264aa28382bfa30/.prettierrc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZeroDivs 2 | 3 | UI Editor for CSS Illustrations. 4 | 5 | Saves to [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) and exports to [CodePen](https://codepen.io/). 6 | 7 | Live app: https://zerodivs.com 8 | 9 | More information: https://perals.io/projects/zerodivs/ 10 | 11 |  12 | 13 | # Basic usage 14 | 15 | The app follows usual UI/UX patterns for vector graphics drawing tools, such as drag-and-drop, layers, or color picking. Zooming is done by scrolling with the trackpad or mouse. The following keyboard shortucts can also be used: 16 | 17 | | Key | Function | 18 | | - | - | 19 | | a | Select all shapes | 20 | | d | Duplicate shapes | 21 | | Shift | Keep pressed to select multiple shapes | 22 | | Esc | Unselect shapes | 23 | | Backspace | Remove shapes | 24 | | Delete | Remove shapes | 25 | | Arrow keys | Move shapes by 1px | 26 | | Meta+c | Copy shapes | 27 | | Meta+x | Cut shapes | 28 | | Meta+v | Paste shapes | 29 | | Meta+z | Undo | 30 | | Meta+Shift+z | Redo | 31 | 32 | ## Local project setup 33 | ``` 34 | npm install 35 | ``` 36 | 37 | ### Compiles and hot-reloads for development 38 | ``` 39 | npm run serve 40 | ``` 41 | 42 | ### Compiles and minifies for production 43 | ``` 44 | npm run build 45 | ``` 46 | 47 | ### Run your unit tests 48 | ``` 49 | npm run test:unit 50 | ``` 51 | 52 | ### Lints and fixes files 53 | ``` 54 | npm run lint 55 | ``` 56 | 57 | ### Customize configuration 58 | See [Configuration Reference](https://cli.vuejs.org/config/). 59 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"] 3 | }; 4 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |11 | Short answer: 12 |
13 |Experimentation and fun.
14 |15 | Long answer: 16 |
17 |18 | As a web developer I like to learn ways to avoid unnecessary markup (and 19 | scripts). Often CSS knowledge helps create elegant and robust solutions 20 | and is an often underrated resource. 21 |
22 |23 | This does not mean that one should avoid markup and force CSS-based 24 | solutions at all costs, the point is just to explore what a medium can 25 | do. 26 |
27 |Some resources about the topic that I found interesting include:
28 |69 | This might not be super relevant, but I noticed that it's not even 70 | necessary to have a "div" or similar HTML node, since the styles can be 71 | applied directly to the body of a page. So it is possible to display 72 | complex visuals on a page that, from the content perspective, is 73 | completely empty. 74 |
75 |76 | If you make use of the "Export to CodePen" button, you'll see that the 77 | generated pen has no markup at all (nor JavaScript, of course) --only 78 | CSS. 79 |
80 |And because I just couldn't come up with a better name, that's it.
81 |Zoom: {{ zoomLevelPercentage }}%
49 | 50 |This operation cannot be undone.
54 |