Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F325846
user_highlighter.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
user_highlighter.js
View Options
import
{
hex2rgb
}
from
'../color_convert/color_convert.js'
const
highlightStyle
=
(
prefs
)
=>
{
if
(
prefs
===
undefined
)
return
const
{
color
,
type
}
=
prefs
if
(
typeof
color
!==
'string'
)
return
const
rgb
=
hex2rgb
(
color
)
if
(
rgb
==
null
)
return
const
solidColor
=
`rgb(
${
Math
.
floor
(
rgb
.
r
)
}
,
${
Math
.
floor
(
rgb
.
g
)
}
,
${
Math
.
floor
(
rgb
.
b
)
}
)`
const
tintColor
=
`rgba(
${
Math
.
floor
(
rgb
.
r
)
}
,
${
Math
.
floor
(
rgb
.
g
)
}
,
${
Math
.
floor
(
rgb
.
b
)
}
, .1)`
const
tintColor2
=
`rgba(
${
Math
.
floor
(
rgb
.
r
)
}
,
${
Math
.
floor
(
rgb
.
g
)
}
,
${
Math
.
floor
(
rgb
.
b
)
}
, .2)`
if
(
type
===
'striped'
)
{
return
{
backgroundImage
:
[
'repeating-linear-gradient(135deg,'
,
`
${
tintColor
}
,`
,
`
${
tintColor
}
20px,`
,
`
${
tintColor2
}
20px,`
,
`
${
tintColor2
}
40px`
].
join
(
' '
),
backgroundPosition
:
'0 0'
}
}
else
if
(
type
===
'solid'
)
{
return
{
backgroundColor
:
tintColor2
}
}
else
if
(
type
===
'side'
)
{
return
{
backgroundImage
:
[
'linear-gradient(to right,'
,
`
${
solidColor
}
,`
,
`
${
solidColor
}
2px,`
,
`transparent 6px`
].
join
(
' '
),
backgroundPosition
:
'0 0'
}
}
}
const
highlightClass
=
(
user
)
=>
{
return
'USER____'
+
user
.
screen_name
.
replace
(
/\./g
,
'_'
)
.
replace
(
/@/g
,
'_AT_'
)
}
export
{
highlightClass
,
highlightStyle
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 24, 4:25 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
95247
Default Alt Text
user_highlighter.js (1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment