Skip to content

Commit

Permalink
Added random image card placeholder illustrations
Browse files Browse the repository at this point in the history
no refs.
- three random illustrations loop as image placeholder illustrations
- increased padding of clickable area for better happy-go-clicky
  • Loading branch information
peterzimon committed Mar 7, 2019
1 parent 87e5778 commit 6ab5192
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/styles/spirit/_koenig.css
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
opacity: 1.0;
}

.kg-placeholder-image-summer {
.kg-placeholder-image {
width: 152px;
height: 122px;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/koenig-editor/addon/components/koenig-card-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export default Component.extend({
didReceiveAttrs() {
this._super(...arguments);

let placeholders = ['summer', 'mountains', 'ufo-attack'];
this.placeholder = placeholders[Math.floor(Math.random() * placeholders.length)];

// `payload.files` can be set if we have an externaly set image that
// should be uploaded. Typical example would be from a paste or drag/drop
if (!isEmpty(this.payload.files)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
{{else if uploader.isUploading}}
{{uploader.progressBar}}
{{else if (not previewSrc payload.src)}}
<button class="flex flex-column items-center center sans-serif fw4 f7 middarkgrey pa8 pt6 pb6 kg-image-button" onclick={{action "triggerFileDialog"}}>
{{svg-jar "summer" class="kg-placeholder-image-summer"}}
<button class="flex flex-column items-center center sans-serif fw4 f7 middarkgrey pa16 pt14 pb14 kg-image-button" onclick={{action "triggerFileDialog"}}>
{{svg-jar this.placeholder class="kg-placeholder-image"}}
<span class="mt2 midgrey">Click to select an image</span>
</button>
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions public/assets/icons/mountains.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/assets/icons/summer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/icons/ufo-attack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6ab5192

Please sign in to comment.