『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 10983|回复: 10

[基础教程] 如何把lovelace card的背景透明?

[复制链接]

9

主题

105

帖子

393

积分

中级会员

Rank: 3Rank: 3

积分
393
金钱
288
HASS币
0
发表于 2021-5-23 13:46:15 | 显示全部楼层 |阅读模式
请教一下,一个新手,没来得及系统的学习lovelace,想先体验一下成果,想把各个card的背景透明,这样能显示我选定的背景图片。

请各位高手路过给点指点。

另外也帮忙给一下lovelace的各个参数的系统学习链接。

先谢过了。
回复

使用道具 举报

33

主题

2050

帖子

5353

积分

论坛元老

Rank: 8Rank: 8

积分
5353
金钱
3303
HASS币
60
QQ
发表于 2021-5-23 16:12:22 | 显示全部楼层
使用主题呀。
另外坛子里有透明和毛玻璃的教程的
我不生产技术,我只是技术的搬运工。
回复

使用道具 举报

17

主题

77

帖子

1480

积分

金牌会员

Rank: 6Rank: 6

积分
1480
金钱
1403
HASS币
0
发表于 2021-5-23 20:05:13 | 显示全部楼层
HACS 安装 ios-drak-mode这个主题,我到配置文件里面改动了卡片圆角,变得没那么圆,就接近ios的款式了
Pasted Graphic 1.png
回复

使用道具 举报

9

主题

105

帖子

393

积分

中级会员

Rank: 3Rank: 3

积分
393
金钱
288
HASS币
0
 楼主| 发表于 2021-5-26 21:06:21 | 显示全部楼层
zxyny1989 发表于 2021-5-23 16:12
使用主题呀。
另外坛子里有透明和毛玻璃的教程的

毛玻璃那个,对老版本的才好用啊。新版本的不能用了。
回复

使用道具 举报

40

主题

1090

帖子

4004

积分

论坛元老

Rank: 8Rank: 8

积分
4004
金钱
2914
HASS币
0
发表于 2021-8-15 14:55:16 | 显示全部楼层
skiong 发表于 2021-5-23 20:05
HACS 安装 ios-drak-mode这个主题,我到配置文件里面改动了卡片圆角,变得没那么圆,就接近ios的款式了 ...

不装HACS,能有办法吗?
回复

使用道具 举报

39

主题

477

帖子

2693

积分

金牌会员

Rank: 6Rank: 6

积分
2693
金钱
2216
HASS币
10
发表于 2021-8-15 19:21:29 | 显示全部楼层
goldstep 发表于 2021-8-15 14:55
不装HACS,能有办法吗?

有个card-mod.js插件可以的  
回复

使用道具 举报

40

主题

1090

帖子

4004

积分

论坛元老

Rank: 8Rank: 8

积分
4004
金钱
2914
HASS币
0
发表于 2021-8-15 19:33:56 | 显示全部楼层
yinghu183 发表于 2021-8-15 19:21
有个card-mod.js插件可以的

搞定  多谢 ,手动的是麻烦要等一段时间才生效
回复

使用道具 举报

7

主题

1096

帖子

3466

积分

论坛元老

Rank: 8Rank: 8

积分
3466
金钱
2370
HASS币
0
发表于 2022-5-9 13:33:38 | 显示全部楼层
goldstep 发表于 2021-8-15 19:33
搞定  多谢 ,手动的是麻烦要等一段时间才生效

请问是如何搞定的呀?
回复

使用道具 举报

0

主题

212

帖子

2243

积分

金牌会员

Rank: 6Rank: 6

积分
2243
金钱
2031
HASS币
0
发表于 2022-10-29 17:30:51 | 显示全部楼层
skiong 发表于 2021-5-23 20:05
HACS 安装 ios-drak-mode这个主题,我到配置文件里面改动了卡片圆角,变得没那么圆,就接近ios的款式了 ...

请问兄弟你这个用的是哪个lovelace能实现这种状态高亮的?
回复

使用道具 举报

17

主题

77

帖子

1480

积分

金牌会员

Rank: 6Rank: 6

积分
1480
金钱
1403
HASS币
0
发表于 2022-10-30 15:43:12 | 显示全部楼层
sxrcm 发表于 2022-10-29 17:30
请问兄弟你这个用的是哪个lovelace能实现这种状态高亮的?

卡片用的是button-card,通过代码慢慢修改的

type: custom:button-card
entity: switch.sonoff_fd8da6
name: 主卧大灯
icon: 'off'
color_type: card
color: null
aspect_ratio: 1/1
state:
  - value: 'on'
    color: rgb(255 255 255)
  - value: 'off'
    styles:
      card:
        - filter: opacity(60%)
      icon:
        - filter: grayscale(100%)
show_state: true
style:
  top: 20.35%
  left: 41.31%
  width: 10%
custom_fields:
  icon_shade: >
    [[[ if (entity.state === 'on') return '<svg id="e7x4u4hifr771"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 30 30"
    shape-rendering="geometricPrecision"
    text-rendering="geometricPrecision"><style><![CDATA[#e7x4u4hifr774 {
    animation-name: e7x4u4hifr774__tt, e7x4u4hifr774_c_o; animation-duration:
    1000ms; animation-fill-mode: forwards; animation-timing-function: linear;
    animation-direction: normal; animation-iteration-count: 1;   }@keyframes
    e7x4u4hifr774__tt { 0% {transform: translate(0px,0px) translate(0px,0px)}
    50% {transform: translate(0px,0px) translate(0px,0.500000px)} 100%
    {transform: translate(0px,0px) translate(0px,0px)} }@keyframes
    e7x4u4hifr774_c_o { 0% {opacity: 0} 100% {opacity: 1} }]]></style><g
    id="e7x4u4hifr772"><path id="e7x4u4hifr773"
    d="M11,2L11,7.674000C10.827000,7.735000,10.659000,7.811000,10.500000,7.902000C9.627000,8.408000,9.067000,9.319000,9.010000,10.326000C8.310000,10.478000,7.636000,10.683000,7,10.937000C3.906000,12.188000,2,14.499000,2,17L22,17C22,14.499000,20.094000,12.188000,17,10.937000C16.365000,10.684000,15.691000,10.479000,14.992000,10.328000C14.935000,9.320000,14.374000,8.408000,13.500000,7.902000C13.341000,7.812000,13.173000,7.736000,13,7.676000L13,2L11,2L11,2Z"
    fill="rgb(87,168,215)" stroke="none" stroke-width="1"/></g><g
    id="e7x4u4hifr774" transform="translate(0,0) translate(0,0)"
    opacity="0"><path id="e7x4u4hifr775"
    d="M9.019000,18.185000C9.019000,19.257000,9.591000,20.247000,10.519000,20.783000C11.447000,21.319000,12.591000,21.319000,13.519000,20.783000C14.447000,20.247000,15.019000,19.257000,15.019000,18.185000L9.019000,18.185000Z"
    fill="rgb(248,205,65)" stroke="none" stroke-width="1"/></g></svg> ' ;   
    else return '<svg id="e47a1uy8ttsc1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 30 30"
    shape-rendering="geometricPrecision"
    text-rendering="geometricPrecision"><style><![CDATA[#e47a1uy8ttsc4 {
    animation-name: e47a1uy8ttsc4__tt, e47a1uy8ttsc4_c_o; animation-duration:
    1000ms; animation-fill-mode: forwards; animation-timing-function: linear;
    animation-direction: normal; animation-iteration-count: 1;   }@keyframes
    e47a1uy8ttsc4__tt { 0% {transform: translate(0px,0px) translate(0px,0px)}
    50% {transform: translate(0px,0px) translate(0px,0.500000px)} 100%
    {transform: translate(0px,0px) translate(0px,0px)} }@keyframes
    e47a1uy8ttsc4_c_o { 0% {opacity: 1} 100% {opacity: 0.500000} }]]></style><g
    id="e47a1uy8ttsc2"><path id="e47a1uy8ttsc3"
    d="M11,2L11,7.674000C10.827000,7.735000,10.659000,7.811000,10.500000,7.902000C9.627000,8.408000,9.067000,9.319000,9.010000,10.326000C8.310000,10.478000,7.636000,10.683000,7,10.937000C3.906000,12.188000,2,14.499000,2,17L22,17C22,14.499000,20.094000,12.188000,17,10.937000C16.365000,10.684000,15.691000,10.479000,14.992000,10.328000C14.935000,9.320000,14.374000,8.408000,13.500000,7.902000C13.341000,7.812000,13.173000,7.736000,13,7.676000L13,2L11,2L11,2Z"
    fill="rgb(95,98,103)" stroke="none" stroke-width="1"/></g><g
    id="e47a1uy8ttsc4" transform="translate(0,0) translate(0,0)"><path
    id="e47a1uy8ttsc5"
    d="M9.019000,18.185000C9.019000,19.257000,9.591000,20.247000,10.519000,20.783000C11.447000,21.319000,12.591000,21.319000,13.519000,20.783000C14.447000,20.247000,15.019000,19.257000,15.019000,18.185000L9.019000,18.185000Z"
    fill="rgb(158,160,162)" stroke="none" stroke-width="1"/></g></svg>'; ]]]
styles:
  custom_fields:
    icon_shade:
      - top: 4%
      - left: 4.6%
      - width: 50%
      - position: absolute
      - null
  name:
    - justify-self: start
    - padding-top: 15px
    - padding-left: 6px
    - font-weight: null
    - text-transform: lowercase
    - font-size: 10px
  state:
    - justify-self: start
    - padding-left: 6px
    - font-weight: bold
    - text-transform: lowercase
    - font-size: 10px
    - color: rgb(111 111 111)
  icon:
    - color: rgb(255 160 0)
  template: light
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-6-1 23:17 , Processed in 0.081613 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表