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

 找回密码
 立即注册
12
返回列表 发新帖
楼主: 623305170

[UI界面] 漂亮的斐讯TC1卡片

[复制链接]

1

主题

50

帖子

2144

积分

金牌会员

Rank: 6Rank: 6

积分
2144
金钱
2094
HASS币
0
发表于 2023-9-24 14:17:57 | 显示全部楼层

这个是用什么卡片?可以分享一下代码吗?
回复

使用道具 举报

2

主题

421

帖子

2424

积分

金牌会员

Rank: 6Rank: 6

积分
2424
金钱
2003
HASS币
0
QQ
发表于 2023-9-24 14:18:40 | 显示全部楼层

说实话 你这做的好看
回复

使用道具 举报

2

主题

421

帖子

2424

积分

金牌会员

Rank: 6Rank: 6

积分
2424
金钱
2003
HASS币
0
QQ
发表于 2023-9-24 14:28:24 | 显示全部楼层

你好 代码分享出来下吧
回复

使用道具 举报

3

主题

95

帖子

749

积分

高级会员

Rank: 4

积分
749
金钱
654
HASS币
0
发表于 2023-9-24 15:20:56 | 显示全部楼层
本帖最后由 lswq 于 2023-9-24 15:27 编辑
[email protected] 发表于 2023-9-24 14:28
你好 代码分享出来下吧
type: custom:stack-in-card
mode: vertical
cards:
  - type: custom:mod-card
    card:
      type: custom:mushroom-title-card
      title: 三楼电视柜 TC1
    card_mod:
      style:
        mushroom-title-card$: |
          /* Set spacing around greeting */
          .header {
            --title-padding: 20px 0px 10px 20px;
            --title-spacing: 8px;
          }    
  - type: custom:mod-card
    card:
      type: grid
      square: false
      mode: horizontal
      cards:
        - type: custom:mod-card
          card:
            type: picture
            image: /local/image/tc1.png
          card_mod: null
          style: |
            ha-card {
              /* Set padding of card */
              padding: 0px 0px 0px 0px;
              /* Move card up to match header card */
              --ha-card-border-radius: 0px;
              margin-left: 0px;
              margin-right: 40px;
              margin-bottom: 0px;
        - type: custom:mod-card
          card:
            type: custom:mushroom-template-card
            icon: mdi:timer-play
            icon_color: red
            layout: horizontal
            entity: sensor.ztc1_power_wo_shi
            fill_container: true
            primary: 运行时间
            secondary: '{{states(''sensor.ztc1_time_wo_shi'')}}'
            tap_action:
              action: fire-dom-event
          card_mod: null
          style: |
            ha-card {
              /* Move card up to match header card */
              margin-left: -10px;
              margin-right: 20px;
              margin-top: -5px;
              margin-bottom: 0px;
      columns: 2
    style: |
      ha-card {
        /* Set padding of card */
        padding: 0px 0px 0px 0px;
        /* Move card up to match header card */
        margin-left: 28px;
        margin-right: 0px;
        margin-bottom: -8px;
        /* Remove styling from card */
        --ha-card-background: none;
        --ha-card-box-shadow: none;
        --ha-card-border-width: 0;
        padding: 0px !important;
        transition: all 0s;
      }
  - type: custom:mod-card
    card:
      type: horizontal-stack
      cards:
        - type: custom:mod-card
          card:
            type: custom:mushroom-title-card
            subtitle: 功率 Power
          style:
            mushroom-title-card$: |
              /* Style name */
              .subtitle {
                --subtitle-font-size: 18px;
                --subtitle-font-weight: var(--mush-title-font-weight, bold);
                color: var(--secondary-text-color) !important;
              }          
        - type: custom:mod-card
          card:
            type: custom:mushroom-title-card
            alignment: end
            subtitle:    {{states('sensor.ztc1_power_wo_shi')}} W
          style:
            mushroom-title-card$: |
              /* Style name */
              .subtitle {
                --subtitle-font-size: 18px;
                --subtitle-font-weight: var(--mush-title-font-weight, bold);
                color: var(--secondary-text-color) !important;
              }
    style: |
      ha-card { 
        margin-left: 10px;
        margin-right: 10px;
        margin-bottom: -40px;
      }   
  - type: custom:mod-card
    card:
      type: custom:mini-graph-card
      name: null
      entities:
        - sensor.ztc1_power_wo_shi
      animate: false
      height: 100
      upper_bound_secondary: 40
      line_color: skyblue
      line_width: 6
      font_size: 80
      font-weight: bold
      show:
        name: false
        icon: false
        state: false
    style: |
      ha-card {
        /* Move card up to match header card */
        margin-left: 10px;
        margin-right: 10px;
        margin-bottom: 0px;
        /* Remove styling from card */
        --ha-card-background: none;
        --ha-card-box-shadow: none;
        --ha-card-border-width: 0;
        --ha-card-border-radius: 15px;
        padding: 0px !important;
        transition: all 0s;
      }      
  - type: custom:mod-card
    card:
      type: grid
      square: true
      cards:
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_1_d0bae462fe78
          layout: vertical
          icon_color: blue
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }               
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_2_d0bae462fe78
          layout: vertical
          icon_color: purple
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }                
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_3_d0bae462fe78
          layout: vertical
          icon_color: red
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }   
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_4_d0bae462fe78
          name: 扫地充电座
          layout: vertical
          icon_color: green
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }               
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_5_d0bae462fe78
          name: 小米网关
          layout: vertical
          icon_color: orange
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }                
        - type: custom:mushroom-entity-card
          entity: switch.ztc1_6_d0bae462fe78
          layout: vertical
          icon_color: blue
          tap_action:
            action: toggle
          double_tap_action:
            action: more-info
          card_mod:
            style: |
              ha-card { 
                background: var(--card-background-color);
                width: auto;
                border-radius: 20px;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 0px;
              }               
      columns: 3
    card_mod:
      style: |
        ha-card { 
          margin-top: 20px;
          margin-left: 10px;
          margin-right: 10px;
        }  
需要hacs下载相应卡片,和使用主题,如果不想用主题可以自己使用cardmod在里面自己修改背景色和卡片圆角及阴影,主题是我结合Google和minimalist改的,还有抠了背景的图片放在下面压缩包里了

files.rar

61.28 KB, 下载次数: 61

评分

参与人数 1金钱 +10 收起 理由
623305170 + 10 高手,这是高手!

查看全部评分

回复

使用道具 举报

35

主题

202

帖子

2004

积分

金牌会员

Rank: 6Rank: 6

积分
2004
金钱
1802
HASS币
0
 楼主| 发表于 2023-9-24 15:24:23 | 显示全部楼层
本帖最后由 623305170 于 2023-9-24 15:28 编辑

Mushroom卡片!真漂亮!
回复

使用道具 举报

2

主题

421

帖子

2424

积分

金牌会员

Rank: 6Rank: 6

积分
2424
金钱
2003
HASS币
0
QQ
发表于 2023-9-24 16:41:41 | 显示全部楼层
lswq 发表于 2023-9-24 15:20
需要hacs下载相应卡片,和使用主题,如果不想用主题可以自己使用cardmod在里面自己修改背景色和卡片圆角及 ...

微信截图_20230924164040.png 谢谢分享  这里位置太宽了  可以适当调窄点
回复

使用道具 举报

15

主题

228

帖子

1455

积分

金牌会员

Rank: 6Rank: 6

积分
1455
金钱
1227
HASS币
0
发表于 2024-2-5 02:41:40 | 显示全部楼层
那个运行时间是怎么弄的噢大佬
回复

使用道具 举报

0

主题

7

帖子

68

积分

注册会员

Rank: 2

积分
68
金钱
61
HASS币
0
发表于 2024-2-26 19:35:47 | 显示全部楼层
优秀、牛逼
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-23 11:56 , Processed in 3.728021 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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