Ghost/ghost/admin/app/styles/components/uploader.css
Kevin Ansfield 350e3d1481 Unsplash integration
closes https://github.com/TryGhost/Ghost/issues/8859, requires https://github.com/TryGhost/Ghost/pull/8895
- adds Unsplash app to app settings
  - enable/disable toggle
  - validation and testing of Unsplash App ID
  - Unsplash App ID field hidden if provided via Ghost config
  - adds `fetchPrivate` method to `config` service to pull config that requires authentication and updates authentication routines to fetch private config
- adds Unsplash buttons to editor toolbar and `{{gh-image-uploader}}`
  - only present when Unsplash app is enabled
  - opens Unsplash image selector when clicked
  - `{{gh-image-uploader}}` has a new `allowUnsplash` attribute to control display of the unsplash button on a per-uploader basis
- adds Unsplash image selector (`{{gh-unsplash}}`)
  - uses new `unsplash` service to handle API requests and maintain state
  - search
  - infinite scroll
  - zoom image
  - insert image
  - download image
- adds `{{gh-scroll-trigger}}` that will fire an event when the component is rendered into or enters the visible screen area via scrolling
- updates `ui` service
  - adds `isFullscreen` property and updates `gh-editor` so that it gets set/unset when toggling editor fullscreen mode
  - adds `hasSideNav` and `isSideNavHidden` properties
- updates `media-queries` service so that it fires an event each time a breakpoint is entered/exited
  - removes the need for observers in certain circumstances
2017-08-15 16:01:12 +01:00

160 lines
3.1 KiB
CSS

/* Image Uploader
/* ---------------------------------------------------------- */
.gh-image-uploader {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
min-height: 130px;
overflow: hidden;
margin: 1.6em 0;
color: color(var(--midgrey) l(-18%));
text-align: center;
background: #fff;
border-radius: 4px;
border-radius: 4px;
}
.gh-image-uploader.-drag-over {
border: 2px solid;
}
.gh-image-uploader.-with-image {
background: rgba(0, 0, 0, 0.1);
border-radius: 2px;
}
.gh-image-uploader img {
display: block;
min-width: 200px;
max-width: 100%;
margin: 0 auto;
line-height: 0;
}
.gh-image-uploader .image-cancel {
position: absolute;
top: 10px;
right: 10px;
z-index: 300;
display: block;
display: flex;
align-items: center;
padding: 8px;
color: #fff;
font-size: 13px;
line-height: 10px;
text-decoration: none;
background: rgba(0, 0, 0, 0.6);
border-radius: var(--border-radius);
box-shadow: rgba(255, 255, 255, 0.2) 0 0 0 1px;
}
.gh-image-uploader .image-cancel svg {
width: 13px;
height: 13px;
fill: #fff;
}
.gh-image-uploader .upload-form {
flex-grow: 1;
display: flex;
flex-direction: row;
width: 100%;
}
.gh-image-uploader .x-file-input {
flex-grow: 1;
display: flex;
}
.gh-image-uploader .x-file-input label {
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
outline: none;
}
.gh-image-uploader .description {
width: 100%;
font-size: 1.6rem;
text-align: center;
}
.gh-image-uploader .image-cancel:hover {
color: #fff;
cursor: pointer;
background: var(--red);
}
.gh-image-uploader .failed {
margin: 1em 2em;
font-size: 16px;
}
/* TODO: remove the gh-image-uploader classes once it's using gh-progrss-bar */
.gh-image-uploader .progress-container,
.gh-progress-container {
flex-grow: 1;
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
}
.gh-image-uploader .progress,
.gh-progress-container-progress {
width: 60%;
overflow: hidden;
margin: 0 auto;
background: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
border-radius: 12px;
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 2px inset;
}
.gh-image-uploader .bar,
.gh-progress-bar {
height: 12px;
background: var(--blue);
}
.gh-image-uploader .bar.fail,
.gh-progress-bar.-error {
width: 100% !important;
background: var(--red);
}
/* Try Again button */
.gh-image-uploader .gh-btn-green:last-child {
margin-top: 1em;
margin-bottom: 3em;
}
/* Unsplash Button
/* ---------------------------------------------------------- */
.gh-image-uploader-unsplash {
position: absolute;
bottom: 0;
left: 0;
width: 36px;
height: 36px;
padding: 10px;
opacity: 0.17;
transition: opacity 0.5s ease;
}
.gh-image-uploader-unsplash:hover {
cursor: pointer;
opacity: 0.8;
transition: opacity 0.3s ease;
}
.gh-image-uploader-unsplash svg {
width: 16px;
}