рабочий-код
This commit is contained in:
parent
c3a353fedb
commit
aacef8908b
|
@ -252,7 +252,6 @@ $vendors-thumb: ('::-webkit-slider-thumb', '::-moz-moz-range-thumb', '::-ms-thum
|
||||||
@include font-size(1.6rem);
|
@include font-size(1.6rem);
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-width: calc(50% - 16px);
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -34,7 +34,12 @@ export const PlayerPlaylist = (props: Props) => {
|
||||||
const handleMediaItemFieldChange = (field: keyof MediaItem, value: string) => {
|
const handleMediaItemFieldChange = (field: keyof MediaItem, value: string) => {
|
||||||
props.onMediaItemFieldChange(activeEditIndex(), field, value)
|
props.onMediaItemFieldChange(activeEditIndex(), field, value)
|
||||||
}
|
}
|
||||||
const titleStyle = (mi: MediaItem) => ({ 'max-width': `calc(${mi.title ? 5 : 10}0% - 16px)` })
|
const titleStyle = (mi: MediaItem) => {
|
||||||
|
let portion = 0
|
||||||
|
if (mi.artist) portion += 5
|
||||||
|
if (mi.title) portion += 5
|
||||||
|
return { 'max-width': `calc(${portion}0% - 16px)` }
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<ul class={styles.playlist}>
|
<ul class={styles.playlist}>
|
||||||
<For each={props.media}>
|
<For each={props.media}>
|
||||||
|
|
|
@ -15,11 +15,13 @@ const getSizeUrlPart = (options: { width?: number; height?: number } = {}) => {
|
||||||
|
|
||||||
export const getImageUrl = (src: string, options: { width?: number; height?: number } = {}) => {
|
export const getImageUrl = (src: string, options: { width?: number; height?: number } = {}) => {
|
||||||
const sizeUrlPart = getSizeUrlPart(options)
|
const sizeUrlPart = getSizeUrlPart(options)
|
||||||
const sourceUrl = src.replace(thumborUrl, '').replace('/unsafe', '')
|
|
||||||
return (
|
if (src.startsWith(thumborPrefix)) {
|
||||||
'https://' +
|
const thumborKey = src.replace(thumborPrefix, '')
|
||||||
`${thumborUrl}/unsafe/${sizeUrlPart}${sourceUrl}`.replace('https://', '').replace('//', '/')
|
return `${thumborUrl}/unsafe/${sizeUrlPart}${thumborKey}`
|
||||||
)
|
}
|
||||||
|
|
||||||
|
return `${thumborUrl}/unsafe/${sizeUrlPart}${src}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getOpenGraphImageUrl = (
|
export const getOpenGraphImageUrl = (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user