{"id":23338735,"url":"https://github.com/appfeel/af-image-uploader","last_synced_at":"2025-07-12T03:37:19.331Z","repository":{"id":57174049,"uuid":"167865437","full_name":"appfeel/af-image-uploader","owner":"appfeel","description":null,"archived":false,"fork":false,"pushed_at":"2019-01-27T23:07:22.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T10:46:29.768Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appfeel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-27T22:20:54.000Z","updated_at":"2020-06-29T17:58:23.000Z","dependencies_parsed_at":"2022-08-24T13:21:30.846Z","dependency_job_id":null,"html_url":"https://github.com/appfeel/af-image-uploader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Faf-image-uploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Faf-image-uploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Faf-image-uploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Faf-image-uploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appfeel","download_url":"https://codeload.github.com/appfeel/af-image-uploader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666005,"owners_count":20975785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T03:16:16.559Z","updated_at":"2025-04-07T13:44:39.155Z","avatar_url":"https://github.com/appfeel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\nAppFeel Image Uploader WebComponent\u003cbr\u003e[![License][license]][npm-url] [![NPM version][npm-version]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Built With Stencil][stencil]][stencil-url]\n==========================\n\n\n[stencil]: https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D\u0026colorA=16161d\u0026style=flat-square\n[stencil-url]: https://stenciljs.com\n[npm-url]: https://www.npmjs.com/package/af-image-uploader\n[license]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[npm-version]: https://img.shields.io/npm/v/af-image-uploader.svg?style=flat\n[npm-downloads]: https://img.shields.io/npm/dm/af-image-uploader.svg?style=flat\n\n\nThis web component implements a drag and drop component to upload and preview images.\nExample of use:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml dir=\"ltr\" lang=\"en\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0\"\u003e\n    \u003ctitle\u003eAppFeel Image Uploader WebComponent\u003c/title\u003e\n    \u003cscript src='https://unpkg.com/af-image-uploader@latest/dist/af-image-uploader.js'\u003e\u003c/script\u003e\n\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n    \u003caf-image-uploader id=\"imageUploader\" width=\"300px\" height=\"100px\" onchange=\"onChange(event)\" onload=\"onLoad(event)\"\u003e\u003c/af-image-uploader\u003e\n    \u003cbutton onclick=\"reset()\"\u003eReset\u003c/button\u003e\n    \u003cbutton onclick=\"getFile()\"\u003eGet File\u003c/button\u003e\n\u003c/body\u003e\n\u003cscript\u003e\n    const imageUploader = document.getElementById('imageUploader');\n    function reset() {\n        imageUploader.reset();\n    }\n    function onChange(image) {\n        console.log('Image selected', image.detail);\n    }\n    function onLoad(image) {\n        console.log('Image preview completed', image.detail);\n    }\n    async function getFile() {\n        console.log('Selected image', await imageUploader.getFile());\n    }\n\u003c/script\u003e\n\u003c/html\u003e\n```\n\n## Properties\n\n| Property            | Attribute             | Description                                 | Type     | Default                            |\n| ------------------- | --------------------- | ------------------------------------------- | -------- | ---------------------------------- |\n| `activeColor`       | `active-color`        | The color when it is active                 | `string` | `'green'`                          |\n| `baseColor`         | `base-color`          | The default color                           | `string` | `'#ccc'`                           |\n| `height`            | `height`              | Height of the component                     | `string` | `'300px'`                          |\n| `hoverOutlineColor` | `hover-outline-color` | The hover outline color                     | `string` | `'#aaa'`                           |\n| `iconSrc`           | `icon-src`            | Icon source image (svg, png, jpg, gif, ...) | `string` | `'./assets/upload-cloud-flat.svg'` |\n| `overlayColor`      | `overlay-color`       | The overlay color                           | `string` | `'rgba(255,255,255,0.5)'`          |\n| `width`             | `width`               | Width of the component                      | `string` | `'100%'`                           |\n\n\n## Events\n\n| Event           | Description                                              | Type                  |\n| --------------- | -------------------------------------------------------- | --------------------- |\n| `change`        | Raised when the upload has finished                      | `CustomEvent\u003cFile\u003e`   |\n| `invalidformat` | Raised when the file tried to upload was in wrong format | `CustomEvent\u003cstring\u003e` |\n| `load`          | Raised when the image has finished to load               | `CustomEvent\u003cFile\u003e`   |\n\n\n## Methods\n\n### `getFile() =\u003e Promise\u003cFile\u003e`\n\nObtains the selected or dropped file if any, or `undefined` if none available\n\n#### Returns\n\nType: `Promise\u003cFile\u003e`\n\nselected or dropped file\n\n### `reset() =\u003e void`\n\nReset the component to void state\n\n#### Returns\n\nType: `void`\n\n\n## Using this component\n\n### Script tag\n\n- [Publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages)\n- Put a script tag similar to this `\u003cscript src='https://unpkg.com/af-image-uploader@latest/dist/af-image-uploader.js'\u003e\u003c/script\u003e` in the head of your index.html\n- Then you can use the element anywhere in your template, JSX, html etc\n\n### Node Modules\n- Run `npm install af-image-uploader --save`\n- Put a script tag similar to this `\u003cscript src='node_modules/af-image-uploader/dist/af-image-uploader.js'\u003e\u003c/script\u003e` in the head of your index.html\n- Then you can use the element anywhere in your template, JSX, html etc\n\n### In a stencil-starter app\n- Run `npm install af-image-uploader --save`\n- Add an import to the npm packages `import af-image-uploader;`\n- Then you can use the element anywhere in your template, JSX, html etc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Faf-image-uploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappfeel%2Faf-image-uploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Faf-image-uploader/lists"}