mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Updated file card styles in Koenig (#2175)
Added styles for file card in editor
This commit is contained in:
parent
10f7ca4019
commit
6800a3fdb4
@ -1937,38 +1937,18 @@ button.emoji-picker__category-button.active {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* File card
|
||||
|
||||
/* Upload cards: audio and file
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
.kg-file-data-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.kg-file-data-container input {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.kg-file-data-container .kg-file-card-caption {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
/* Audio card
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
.kg-audio-container {
|
||||
.kg-upload-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: inset 0 0 0 1px rgba(124, 139, 154, 0.25);
|
||||
}
|
||||
|
||||
.kg-audio-container-empty {
|
||||
.kg-upload-container-empty {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -1977,7 +1957,7 @@ button.emoji-picker__category-button.active {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.kg-audio-container-empty svg {
|
||||
.kg-upload-container-empty svg {
|
||||
width: 24px;
|
||||
height: auto;
|
||||
margin-right: 8px;
|
||||
@ -1987,17 +1967,17 @@ button.emoji-picker__category-button.active {
|
||||
transform: scale(1.0);
|
||||
}
|
||||
|
||||
.kg-audio-container-empty:hover svg {
|
||||
.kg-upload-container-empty:hover svg {
|
||||
opacity: 1.0;
|
||||
transform: scale(1.04);
|
||||
}
|
||||
|
||||
.kg-audio-container-empty .gh-progress-container-progress {
|
||||
.kg-upload-container-empty .gh-progress-container-progress {
|
||||
width: 30%;
|
||||
background: linear-gradient(to bottom, var(--whitegrey-l1), var(--whitegrey));
|
||||
}
|
||||
|
||||
.kg-placeholder-text {
|
||||
.kg-upload-placeholder-text {
|
||||
color: var(--midgrey);
|
||||
font-family: var(--font-family);
|
||||
font-size: 1.45rem;
|
||||
@ -2005,7 +1985,7 @@ button.emoji-picker__category-button.active {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
.kg-audio-container-empty:hover .kg-placeholder-text {
|
||||
.kg-upload-container-empty:hover .kg-upload-placeholder-text {
|
||||
color: var(--midgrey-d2);
|
||||
}
|
||||
|
||||
@ -2022,11 +2002,16 @@ button.emoji-picker__category-button.active {
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
.kg-media-container.light {
|
||||
background: var(--whitegrey);
|
||||
color: var(--pink);
|
||||
}
|
||||
|
||||
.kg-media-container .gh-progress-container-progress {
|
||||
background: rgba(225, 225, 225, .2);
|
||||
}
|
||||
|
||||
.kg-audio-button {
|
||||
.kg-upload-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@ -2034,8 +2019,8 @@ button.emoji-picker__category-button.active {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.kg-audio-button .koenig-audio-replace-icon,
|
||||
.kg-audio-button .koenig-audio-upload-icon {
|
||||
.kg-upload-button .koenig-audio-replace-icon,
|
||||
.kg-upload-button .koenig-audio-upload-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: .6rem .8rem;
|
||||
@ -2046,7 +2031,7 @@ button.emoji-picker__category-button.active {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.kg-audio-button .image-overlay {
|
||||
.kg-upload-button .image-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
@ -2057,30 +2042,30 @@ button.emoji-picker__category-button.active {
|
||||
background-image: linear-gradient(180deg,rgba(0,0,0,0.2) 0,transparent 70%,transparent 100%);
|
||||
opacity: 0;
|
||||
transition: all 0.15s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.kg-audio-button:hover .image-overlay {
|
||||
.kg-upload-button:hover .image-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.kg-audio-button .kg-audio-icon {
|
||||
.kg-upload-button .kg-audio-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
fill: var(--white);
|
||||
transition: all 0.15s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.kg-audio-button:hover .kg-audio-icon {
|
||||
.kg-upload-button:hover .kg-audio-icon {
|
||||
opacity: .6;
|
||||
}
|
||||
}
|
||||
|
||||
.kg-audio-button img {
|
||||
.kg-upload-button img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: var(--border-radius);
|
||||
background: var(--white);
|
||||
}
|
||||
}
|
||||
|
||||
.kg-player-container {
|
||||
position: relative;
|
||||
@ -2090,7 +2075,8 @@ button.emoji-picker__category-button.active {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.kg-audio-title {
|
||||
.kg-upload-title,
|
||||
.kg-upload-caption {
|
||||
width: 100%;
|
||||
margin: 8px 0 0 0;
|
||||
padding: 8px 12px;
|
||||
@ -2100,10 +2086,30 @@ button.emoji-picker__category-button.active {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.kg-audio-title:focus {
|
||||
.kg-upload-title:focus,
|
||||
.kg-upload-caption:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.kg-upload-caption {
|
||||
font-size: 1.4rem;
|
||||
font-weight: 500;
|
||||
color: var(--midgrey);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.kg-upload-metadata {
|
||||
line-height: 1em;
|
||||
margin: 0 12px 14px;
|
||||
font-size: 1.4rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.kg-upload-filesize {
|
||||
color: var(--midgrey);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.kg-audio-current-time {
|
||||
min-width: 38px;
|
||||
padding: 0 4px;
|
||||
@ -2201,6 +2207,31 @@ button.emoji-picker__category-button.active {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.kg-file-data-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.kg-file-data-container .kg-upload-title {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 0px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.kg-file-data-container .kg-upload-caption {
|
||||
padding-top: 0;
|
||||
height: 26px;
|
||||
margin-top: 0px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.kg-file-data-container .kg-file-card-caption {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* Video card
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<KoenigCard
|
||||
@env={{@env}}
|
||||
@class={{"ba b--transparent relative kg-card-hover kg-card kg-audio-card mih10 miw-100 relative" (kg-style "breakout" size=@payload.cardWidth)}}
|
||||
@class={{"ba b--transparent relative kg-card-hover kg-card kg-upload-card mih10 miw-100 relative" (kg-style "breakout" size=@payload.cardWidth)}}
|
||||
@headerOffset={{@headerOffset}}
|
||||
@toolbar={{this.toolbar}}
|
||||
@payload={{@payload}}
|
||||
@ -23,7 +23,7 @@
|
||||
as |card|
|
||||
>
|
||||
{{#if @payload.src}}
|
||||
<div class="kg-audio-container">
|
||||
<div class="kg-upload-container">
|
||||
<div class="kg-media-container">
|
||||
<GhUploader
|
||||
@uploadUrl="/media/thumbnail/upload/"
|
||||
@ -52,11 +52,11 @@
|
||||
{{else if uploader.isUploading}}
|
||||
{{uploader.progressBar}}
|
||||
{{else if (not @payload.thumbnailSrc)}}
|
||||
<button class="kg-audio-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
<button class="kg-upload-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
{{svg-jar "audio-upload"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="kg-audio-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
<button class="kg-upload-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
<img src={{@payload.thumbnailSrc}} class="{{kg-style this.kgImgStyle}}">
|
||||
{{!-- <span class="mt2 midgrey">Click to select an audio</span> --}}
|
||||
</button>
|
||||
@ -74,7 +74,7 @@
|
||||
{{else if uploader.isUploading}}
|
||||
{{uploader.progressBar}}
|
||||
{{else if @payload.thumbnailSrc}}
|
||||
<div class="kg-audio-button">
|
||||
<div class="kg-upload-button">
|
||||
<img src={{@payload.thumbnailSrc}} />
|
||||
<div class="image-overlay">
|
||||
<div class="flex flex-row-reverse">
|
||||
@ -85,7 +85,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<button class="kg-audio-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
<button class="kg-upload-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
||||
{{svg-jar "audio-file" class="kg-audio-icon"}}
|
||||
<div class="image-overlay">
|
||||
<div class="flex flex-row-reverse">
|
||||
@ -112,7 +112,7 @@
|
||||
<GhTextInput
|
||||
@value={{@payload.title}}
|
||||
@input={{action "setAudioTitle" value="target.value"}}
|
||||
@class="kg-audio-title"
|
||||
@class="kg-upload-title"
|
||||
/>
|
||||
<div class="kg-player">
|
||||
<button class="kg-audio-play-icon">{{svg-jar "play"}}</button>
|
||||
@ -130,7 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="kg-audio-container kg-audio-container-empty">
|
||||
<div class="kg-upload-container kg-upload-container-empty">
|
||||
<GhUploader
|
||||
@uploadUrl="/media/upload/"
|
||||
@resourceName="media"
|
||||
@ -166,7 +166,7 @@
|
||||
{{else}}
|
||||
<div {{on "click" this.triggerAudioFileDialog}} class="flex pa4">
|
||||
{{svg-jar "audio-upload"}}
|
||||
<span class="kg-placeholder-text">
|
||||
<span class="kg-upload-placeholder-text">
|
||||
Click to upload an audio file
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<KoenigCard
|
||||
@env={{@env}}
|
||||
@class={{"ba b--transparent relative kg-card-hover kg-card kg-audio-card mih10 miw-100 relative" (kg-style "breakout" size=@payload.cardWidth)}}
|
||||
@class={{"ba b--transparent relative kg-card-hover kg-card kg-file-card mih10 miw-100 relative" (kg-style "breakout" size=@payload.cardWidth)}}
|
||||
@headerOffset={{@headerOffset}}
|
||||
@toolbar={{this.toolbar}}
|
||||
@payload={{@payload}}
|
||||
@ -23,34 +23,36 @@
|
||||
as |card|
|
||||
>
|
||||
{{#if @payload.src}}
|
||||
<div class="kg-audio-container">
|
||||
<div class="kg-media-container">
|
||||
<button class="kg-audio-button">
|
||||
{{svg-jar "audio-file" class="kg-audio-icon"}}
|
||||
<div class="kg-upload-container">
|
||||
<div class="kg-media-container light">
|
||||
<button class="kg-upload-button">
|
||||
{{svg-jar "file-download" class="kg-audio-icon"}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="kg-file-data-container">
|
||||
<GhTextInput
|
||||
@value={{@payload.fileTitle}}
|
||||
@placeholder="File Title"
|
||||
@input={{action "setFileTitle" value="target.value"}}
|
||||
@class="kg-audio-title"
|
||||
/>
|
||||
<GhTextInput
|
||||
@value={{@payload.fileCaption}}
|
||||
@input={{action "setFileCaption" value="target.value"}}
|
||||
@placeholder="File Caption"
|
||||
@class="kg-audio-title kg-file-card-caption"
|
||||
/>
|
||||
<div style="display:flex;line-height:1.15;margin-top:10px;margin-left:10px;font-size:1.3rem">
|
||||
<div style="margin-right: 12px;font-weight:bold"> {{this.fileName}} </div>
|
||||
<div> {{this.fileSize}} </div>
|
||||
<div>
|
||||
<GhTextInput
|
||||
@value={{@payload.fileTitle}}
|
||||
@placeholder="File Title"
|
||||
@input={{action "setFileTitle" value="target.value"}}
|
||||
@class="kg-upload-title"
|
||||
/>
|
||||
<GhTextInput
|
||||
@value={{@payload.fileCaption}}
|
||||
@input={{action "setFileCaption" value="target.value"}}
|
||||
@placeholder="File Caption"
|
||||
@class="kg-upload-caption"
|
||||
/>
|
||||
</div>
|
||||
<div class="kg-upload-metadata">
|
||||
{{!-- </div>style="display:flex;line-height:1.15;margin-top:10px;margin-left:10px;font-size:1.3rem"> --}}
|
||||
{{this.fileName}} <span class="kg-upload-filesize">• {{this.fileSize}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="kg-audio-container kg-audio-container-empty" {{on "click" this.triggerFileDialog}}>
|
||||
<div class="kg-upload-container kg-upload-container-empty">
|
||||
<GhUploader
|
||||
@uploadUrl="/files/upload/"
|
||||
@resourceName="files"
|
||||
@ -82,10 +84,12 @@
|
||||
{{else if uploader.isUploading}}
|
||||
{{uploader.progressBar}}
|
||||
{{else}}
|
||||
{{svg-jar "audio-upload"}}
|
||||
<span class="kg-placeholder-text">
|
||||
<div {{on "click" this.triggerFileDialog}} class="flex pa4 midgrey">
|
||||
{{svg-jar "file-upload"}}
|
||||
<span class="kg-upload-placeholder-text">
|
||||
Click to upload a file
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
{{else if (not this.previewThumbnailSrc @payload.src)}}
|
||||
<button class="flex flex-column items-center center sans-serif fw4 f7 middarkgrey pa16 pt14 pb14 kg-image-button" {{on "click" this.triggerVideoFileDialog}}>
|
||||
{{svg-jar "film-camera" class="kg-placeholder-video"}}
|
||||
<span class="mt4 kg-placeholder-text">Click to select a video</span>
|
||||
<span class="mt4 kg-upload-placeholder-text">Click to select a video</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
1
ghost/admin/public/assets/icons/file-download.svg
Normal file
1
ghost/admin/public/assets/icons/file-download.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>common-file-download</title><circle class="a" cx="17.25" cy="17.25" r="6"/><line class="a" x1="17.25" y1="14.25" x2="17.25" y2="20.25"/><line class="a" x1="17.25" y1="20.25" x2="19.5" y2="18"/><line class="a" x1="17.25" y1="20.25" x2="15" y2="18"/><path class="a" d="M8.25,20.25h-6a1.5,1.5,0,0,1-1.5-1.5V2.25A1.5,1.5,0,0,1,2.25.75H12.879a1.5,1.5,0,0,1,1.06.439l2.872,2.872a1.5,1.5,0,0,1,.439,1.06V8.25"/></svg>
|
After Width: | Height: | Size: 601 B |
1
ghost/admin/public/assets/icons/file-upload.svg
Normal file
1
ghost/admin/public/assets/icons/file-upload.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>common-file-upload</title><circle class="a" cx="17.25" cy="17.25" r="6"/><line class="a" x1="17.25" y1="20.25" x2="17.25" y2="14.25"/><line class="a" x1="17.25" y1="14.25" x2="15" y2="16.5"/><line class="a" x1="17.25" y1="14.25" x2="19.5" y2="16.5"/><path class="a" d="M8.25,20.25h-6a1.5,1.5,0,0,1-1.5-1.5V2.25A1.5,1.5,0,0,1,2.25.75H12.879a1.5,1.5,0,0,1,1.06.439l2.872,2.872a1.5,1.5,0,0,1,.439,1.06V8.25"/></svg>
|
After Width: | Height: | Size: 603 B |
Loading…
Reference in New Issue
Block a user