diff --git a/app/components/avatar/badge.gjs b/app/components/avatar/badge.gjs new file mode 100644 index 0000000..693382c --- /dev/null +++ b/app/components/avatar/badge.gjs @@ -0,0 +1,84 @@ +import Component from '@glimmer/component'; +import { inject as service } from '@ember/service'; + +export default class OpenToFiles extends Component { + @service settings; + + + {{this.settings.text}} + +} diff --git a/app/components/avatar/image.gjs b/app/components/avatar/image.gjs new file mode 100644 index 0000000..89956b8 --- /dev/null +++ b/app/components/avatar/image.gjs @@ -0,0 +1,7 @@ +import Component from '@glimmer/component'; + +export default class OpenToFiles extends Component { + + + +} diff --git a/app/components/avatar/index.gjs b/app/components/avatar/index.gjs new file mode 100644 index 0000000..c93b654 --- /dev/null +++ b/app/components/avatar/index.gjs @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; +import AvatarImage from './image'; +import AvatarBadge from './badge'; + +export default class OpenToFiles extends Component { + + + + + + + + +} diff --git a/app/components/open-to/files/index.gjs b/app/components/open-to/files/index.gjs index 953f8e0..77ff2fd 100644 --- a/app/components/open-to/files/index.gjs +++ b/app/components/open-to/files/index.gjs @@ -1,28 +1,29 @@ import Component from '@glimmer/component'; import FileDropzone from 'ember-file-upload/components/file-dropzone'; -import { inject as service } from '@ember/service'; -import FileQueueService from 'ember-file-upload/services/file-queue'; import OpenToFilesPreview from 'open-to-dot-dot-dot/components/open-to/files/preview'; +import fileQueue from 'ember-file-upload/helpers/file-queue'; import OpenToFilesUpload from 'open-to-dot-dot-dot/components/open-to/files/upload'; import { t } from 'ember-intl'; export default class OpenToFiles extends Component { - @service fileQueue; - - - {{#each this.fileQueue.files as |file|}} - - - - - - {{/each}} - - - - - - + {{#let (fileQueue onFileAdded=this.uploadPhoto) as |queue|}} + + {{#each queue.files as |file|}} + + + + + + {{else}} + + + + + + + {{/each}} + + {{/let}} } diff --git a/app/components/open-to/files/preview.gjs b/app/components/open-to/files/preview.gjs index 551fddc..3bedb5b 100644 --- a/app/components/open-to/files/preview.gjs +++ b/app/components/open-to/files/preview.gjs @@ -1,101 +1,12 @@ import Component from '@glimmer/component'; -import FileDropzone from 'ember-file-upload/components/file-dropzone'; -import { inject as service } from '@ember/service'; -import FileQueueService from 'ember-file-upload/services/file-queue'; -import { t } from 'ember-intl'; +import Avatar from '../../avatar'; export default class OpenToFiles extends Component { - @service fileQueue; - @service settings; - objectURL(file) { return URL.createObjectURL(file); } - - - - - {{this.settings.text}} - - + } diff --git a/app/components/open-to/files/upload.gjs b/app/components/open-to/files/upload.gjs deleted file mode 100644 index 5b0a718..0000000 --- a/app/components/open-to/files/upload.gjs +++ /dev/null @@ -1,32 +0,0 @@ -import Component from '@glimmer/component'; -import FileDropzone from 'ember-file-upload/components/file-dropzone'; -// import fileQueue from 'ember-file-upload/helpers/file-queue'; -import { t } from 'ember-intl'; -// import { inject as service } from '@ember/service'; - -export default class OpenToFiles extends Component { - // @service fileQueue; - - // uploadPhoto() {} - - - {{!-- {{#let (fileQueue name='foo' onFileAdded=this.uploadPhoto) as |queue|}} --}} - {{!-- --}} - - - - {{#if dropzone.active}} - {{t 'drag-and-drop.drop-now'}} - {{else}} - {{#if dropzone.supported}} - {{t 'drag-and-drop.instructions'}} - {{/if}} - {{/if}} - - {{!-- {{/let}} --}} - -} diff --git a/app/components/open-to/files/upload/index.gjs b/app/components/open-to/files/upload/index.gjs new file mode 100644 index 0000000..62453b3 --- /dev/null +++ b/app/components/open-to/files/upload/index.gjs @@ -0,0 +1,42 @@ +import Component from '@glimmer/component'; +import FileDropzone from 'ember-file-upload/components/file-dropzone'; +import fileQueue from 'ember-file-upload/helpers/file-queue'; +import { t } from 'ember-intl'; +import Avatar from '../../../avatar'; +import Instructions from './instructions'; + +export default class OpenToFilesUpload extends Component { + + {{#let (fileQueue onFileAdded=this.uploadPhoto) as |queue|}} + + + {{#if dropzone.active}} + + {{t 'drag-and-drop.drop-now'}} + + {{else}} + + + + + + {{#if dropzone.supported}} + + {{t 'drag-and-drop.instructions'}} + + {{else}} + + + + {{/if}} + + + {{/if}} + + {{/let}} + +} diff --git a/app/components/open-to/files/upload/instructions.gjs b/app/components/open-to/files/upload/instructions.gjs new file mode 100644 index 0000000..6ed07d7 --- /dev/null +++ b/app/components/open-to/files/upload/instructions.gjs @@ -0,0 +1,15 @@ +import Component from '@glimmer/component'; + +export default class OpenToFilesUploadInstructions extends Component { + + + + {{yield}} + + + +} diff --git a/app/services/settings.js b/app/services/settings.js index 5fb8a11..a611fa9 100644 --- a/app/services/settings.js +++ b/app/services/settings.js @@ -3,6 +3,6 @@ import { tracked } from '@glimmer/tracking'; export default class SettingsService extends Service { @tracked text = '#OpenTo...'; - @tracked colourStart = '#00e503'; - @tracked colourStop = '#12e500'; + @tracked colourStart = '#a855f7'; + @tracked colourStop = '#ec4899'; } diff --git a/public/images/unicorn.webp b/public/images/unicorn.webp new file mode 100644 index 0000000..48528ee Binary files /dev/null and b/public/images/unicorn.webp differ diff --git a/translations/en-us.yaml b/translations/en-us.yaml index f8f7da1..1922489 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -2,7 +2,7 @@ application: name: '#OpenTo...' subtitle: LinkedIn avatar generator drag-and-drop: - instructions: Add image + instructions: Drop your image here drop-now: Drop it! toggles: text: Text