Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For large Layout: Calculate height with row height,size and gap #965

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3aef638
For large Layout: Calculate height with row height,size and gap
MrBearPresident Nov 27, 2024
b83ef44
Merge branch 'main' of https://github.com/MrBearPresident/Bubble-Card
MrBearPresident Nov 27, 2024
6b19222
• Stick icon an name/state to top
MrBearPresident Nov 28, 2024
2f5cab7
Add Extra container for multirow
MrBearPresident Nov 29, 2024
9451f16
Adjust Large sizes
MrBearPresident Dec 4, 2024
d3847c1
Merge branch 'Clooos:main' into main
MrBearPresident Dec 4, 2024
65f4ab0
Clean-up + harmonize the different cards
MrBearPresident Dec 8, 2024
632442d
Add extra class to the card when there are no-sub-buttons
MrBearPresident Dec 8, 2024
5f6e457
Limit width in multi-row mode
MrBearPresident Dec 8, 2024
8f8e878
Resolve issue with the dropdown containers for sub-buttons
MrBearPresident Dec 8, 2024
aa799c9
Merge branch 'main' into main
MrBearPresident Dec 8, 2024
2d5be41
Fix height problem for non-section view
MrBearPresident Dec 10, 2024
64ef8a0
Merge branch 'main' of https://github.com/MrBearPresident/Bubble-Card
MrBearPresident Dec 10, 2024
f1c0ae5
Fix rounded corners -> Border radius now correlated to row-heigh/2
MrBearPresident Dec 11, 2024
94ed9ec
Fix roundness of icons
MrBearPresident Dec 11, 2024
5f8b83d
Fix bubble-cover-card border-radius missing
MrBearPresident Dec 11, 2024
0aed22b
create alternative layout for medie-player and climate card
MrBearPresident Dec 11, 2024
2e9aace
• Add margin to right of the temperature-button
MrBearPresident Dec 12, 2024
daa7f1c
Fix bubble-media-info-container not displaying correctly
MrBearPresident Dec 12, 2024
58ab4fb
Merge branch 'main' into main
MrBearPresident Dec 12, 2024
96f98be
Merge branch 'main' into main
MrBearPresident Dec 17, 2024
d59abea
Merge branch 'Clooos:main' into main
MrBearPresident Dec 22, 2024
49373b3
Merge branch 'main' into main
MrBearPresident Jan 15, 2025
11bf244
Fix what was broken with the merge from main.
MrBearPresident Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 67 additions & 13 deletions src/cards/button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ export default `
width: 100%;
height: 50px;
background-color: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
box-shadow: var(--bubble-button-box-shadow, var(--bubble-box-shadow, none));
overflow: scroll;
touch-action: pan-y;
}


.bubble-button-card,
.bubble-range-slider,
Expand All @@ -41,7 +42,7 @@ export default `
.bubble-button-background {
background-color: var(--bubble-button-background-color);
opacity: .5;
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
border-radius: inherit;
}
.bubble-range-fill {
position: absolute;
Expand All @@ -65,7 +66,7 @@ export default `
}
.bubble-range-slider {
cursor: ew-resize;
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
border-radius: inherit);
overflow: hidden;
mask-image: radial-gradient(white, black);
-webkit-mask-image: -webkit-radial-gradient(white, black);
Expand All @@ -80,7 +81,7 @@ export default `
margin: 6px;
border-radius: var(--bubble-button-icon-border-radius, var(--bubble-icon-border-radius, var(--bubble-border-radius, 50%)));
background-color: var(--bubble-button-icon-background-color, var(--bubble-icon-background-color, var(--bubble-secondary-background-color, var(--card-background-color, var(--ha-card-background)))));
overflow: hidden;
overflow: hidden;
position: relative;
cursor: pointer;
}
Expand Down Expand Up @@ -150,30 +151,83 @@ export default `
100% {transform: translateX(100%); opacity: 0;}
}

.large .bubble-button-card{
--line-height: 18px;
--gap-to-edge: 7px;
display: grid;
grid-template-areas:
'i n c a' 'b b b b' !important;
grid-template-columns: var(--row-height,56px) 1fr auto auto;
grid-template-rows: var(--row-height,56px) 1fr;
justify-self: start;
justify-items: start;
align-self: center;
align-items: center;
}
.large.bubble-empty-sub-buttons .bubble-button-card{
grid-template-rows: 1fr 0;
align-content: center;
}



.large .bubble-button-card-container {
height: 56px;
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
}

.large .bubble-icon-container {
.large .bubble-button-card .bubble-icon-container {
--mdc-icon-size: 24px;
min-width: 42px !important;
min-height: 42px !important;
margin-left: 8px;
width: calc(var(--row-height,56px) - 14px);
height: calc(var(--row-height,56px) - 14px);
grid-area: i;
margin: 7px;
}

.large .bubble-button-card .bubble-name-container {
justify-content: flex-start;
grid-area: n;
overflow: hidden;
margin: 0px;
max-width: calc(100% - 2 * var(--gap-to-edge,7px));
}

.large .bubble-button-card .bubble-sub-button-container {
grid-area: c;
max-width: 100%;
height: 36px;
flex-wrap: wrap-reverse;
row-gap: 4px;
align-self: center;
align-content: center;
}

.large .bubble-button-card .bubble-sub-button-container.expanded {
max-height: 100%;
height: auto;
max-width: calc(100% - 2 * var(--gap-to-edge,7px));
grid-area: b;
flex-wrap: wrap;
justify-self: center;
align-self: center;
justify-content: center;
align-content: start;
justify-items: center;
padding-bottom: 7px;
}

.rows-2 .bubble-sub-button-container {
.rows-2 .bubble-button-card .bubble-sub-button-container {
flex-direction: column;
gap: 4px !important;
display: grid !important;
grid-template-columns: repeat(2, min-content);
grid-template-rows: repeat(2, 1fr);
grid-auto-flow: column;
align-self: center;
width: auto;
padding-right: 14px;
padding-right: 7px;
}

.rows-2 .bubble-sub-button {
.rows-2 .bubble-button-card .bubble-sub-button {
height: 20px !important;
}
`;
112 changes: 101 additions & 11 deletions src/cards/climate/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default `
width: 100%;
height: 50px;
background-color: var(--bubble-climate-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
box-shadow: var(--bubble-climate-box-shadow, var(--bubble-box-shadow, none));
overflow: visible;
touch-action: pan-y;
Expand Down Expand Up @@ -97,7 +97,7 @@ export default `
width: 100%;
height: 100%;
position: absolute;
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, 32px));
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, 50%));
overflow: hidden;
pointer-events: none;
}
Expand All @@ -118,7 +118,7 @@ export default `
width: 100%;
height: 100%;
position: absolute;
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
border-radius: inherit;
opacity: 0.7;
transition: background-color 2s ease;
}
Expand Down Expand Up @@ -219,29 +219,119 @@ export default `
100% {transform: translateX(100%); opacity: 0;}
}

.large .bubble-climate{
--line-height: 18px;
--gap-to-edge: 7px;
display: grid;
gap: 4px;
grid-template-areas:
'i n c a' 'b b b b' !important;
grid-template-columns: var(--row-height,56px) 1fr auto auto;
grid-template-rows: var(--row-height,56px) 1fr;
justify-self: start;
justify-items: start;
align-self: center;
align-items: center;
}
.large.bubble-empty-sub-buttons .bubble-climate{
grid-template-rows: 1fr 0;
align-content: center;
}

.large .bubble-climate-container {
height: 56px;
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
}

.large .bubble-icon-container {
.large .bubble-climate .bubble-icon-container {
--mdc-icon-size: 24px;
min-width: 42px !important;
min-height: 42px !important;
margin-left: 8px;
width: calc(var(--row-height,56px) - 14px);
height: calc(var(--row-height,56px) - 14px);
grid-area: i;
margin: 7px;
}

.large .bubble-climate .bubble-button-container{
grid-area: a;
display: contents !important;
}


.large.AlternativeLayout.bubble-multi-row .bubble-climate .bubble-button-container {
grid-area: b;
height: calc(100% - 7px);
width: calc(100% - 2 * var(--gap-to-edge,7px));
display: flex !important;
row-gap: 4px;
flex-wrap: wrap;
align-self: center;
justify-self: center;
justify-content: center;
align-items: center;
justify-items: center;
padding-bottom: 7px;
margin-right: 0px;
}

.large .bubble-climate .bubble-temperature-container{
grid-area: a;
height: calc(var(--row-height,56px) - 20px);
width: auto;
justify-self: center;
margin-right: var(--gap-to-edge,7px);
}
.large.AlternativeLayout .bubble-climate .bubble-temperature-container{
margin-right: 0px;
}

.large .bubble-climate .bubble-name-container {
justify-content: flex-start;
grid-area: n;
overflow: hidden;
margin: 0px;
max-width: 100%;
}

.large .bubble-climate .bubble-sub-button-container {
grid-area: c;
max-width: 100%;
height: 36px;
flex-wrap: wrap-reverse;
row-gap: 4px;
align-self: center;
align-content: center;
}

.large .bubble-climate .bubble-sub-button-container.expanded {
max-height: 100%;
height: auto;
max-width: calc(100% - 2 * var(--gap-to-edge,7px));
grid-area: b;
flex-wrap: wrap;
justify-self: center;
align-self: center;
justify-content: center;
align-content: start;
justify-items: center;
padding-bottom: 7px;
}

.large.AlternativeLayout.bubble-multi-row .bubble-climate .bubble-sub-button-container{
padding-bottom: 0px;
display: contents;
}

.rows-2 .bubble-sub-button-container {
.rows-2 .bubble-climate .bubble-sub-button-container {
flex-direction: column;
gap: 4px !important;
display: grid !important;
grid-template-columns: repeat(2, min-content);
grid-template-rows: repeat(2, 1fr);
grid-auto-flow: column;
align-self: center;
width: auto;
}

.rows-2 .bubble-sub-button {
.rows-2 .bubble-climate .bubble-sub-button {
height: 20px !important;
}
`;
Loading
Loading