Skip to content

Commit

Permalink
css fix battery and components
Browse files Browse the repository at this point in the history
  • Loading branch information
jparez committed Jan 15, 2025
1 parent 7963f07 commit 7719dbe
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 28 deletions.
7 changes: 0 additions & 7 deletions src/assets/images/ic_close-modal.svg

This file was deleted.

3 changes: 3 additions & 0 deletions src/assets/images/ic_close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/plugins/Battery.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ module.exports = class Battery extends OverlayPlugin {
*/
renderWidget() {
// Create elements

const {modal, container} = this.createTemplateModal({
title: this.i18n.BATTERY_TITLE || 'Battery',
classes: 'gm-battery-plugin',
Expand Down Expand Up @@ -184,7 +183,6 @@ module.exports = class Battery extends OverlayPlugin {
this.chargeGroup.appendChild(sliderGroup);

// Charge level input
const inputGroup = document.createElement('div');
this.chargeInput = textInput.createTextInput({
appendText: '%',
value: '50',
Expand All @@ -198,8 +196,7 @@ module.exports = class Battery extends OverlayPlugin {

this.chargeInput.element.className = 'gm-charge-input';

inputGroup.appendChild(this.chargeInput.element);
this.chargeGroup.appendChild(inputGroup);
this.chargeGroup.appendChild(this.chargeInput.element);

return this.chargeGroup;
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/util/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ const slider = (() => {
*/

const textInput = (() => {
const createTextInput = ({onChange = null, value = '', regexFilter, appendText = ''}) => {
const createTextInput = ({onChange = null, value = '', regexFilter, appendText = '', classes=''}) => {
const inputDiv = document.createElement('div');
inputDiv.className = classes;
const inputDivContainer = document.createElement('div');
inputDivContainer.classList.add('text-input-container');

Expand Down
9 changes: 8 additions & 1 deletion src/scss/base/_genymotion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
display: block;
width: 30px;
height: 30px;

-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
}

&-video-overlay {
Expand Down Expand Up @@ -213,7 +220,7 @@
.gm-separator {
width: 100%;
height: 1px;
background-color: color-mix(in srgb, var(--gm-modal-bg-color), grey 10%);
background-color: color-mix(in srgb, var(--gm-fourth-color), transparent 70%);
margin: 10px 0;
}

Expand Down
4 changes: 3 additions & 1 deletion src/scss/base/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ $spacing-l: 20px;
$spacing-xl: 30px;

// Modal
$modal-x-padding: 40px;
$modal-x-padding: 40px;
$modal-section-mb: $spacing-xl;
$modal-label-mb: $spacing-m;
5 changes: 2 additions & 3 deletions src/scss/components/_battery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.device-renderer-instance .gm-battery-plugin {
.gm {
&-charging-group {
margin-top: 15px;
display: flex;
justify-content: space-between;
align-items: center;
Expand Down Expand Up @@ -46,7 +45,7 @@
display: flex;
justify-content: space-around;
align-items: center;
margin-bottom: 30px;
margin-bottom: $modal-section-mb;

> div:nth-child(2) {
flex-grow: 1;
Expand Down Expand Up @@ -119,7 +118,7 @@

.gm-charge-input {
width: 39px;
margin-bottom: 37px;
margin-top: -30px;
}

.gm-charge-slider {
Expand Down
5 changes: 3 additions & 2 deletions src/scss/components/_textInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
color: var(--gm-input-text-color);
display: flex;
align-items: center;
height: 34px;

&:has(.text-input:read-only) {
border-bottom: 2px solid transparent;
Expand All @@ -21,9 +22,9 @@
}

&:read-only {
background: color-mix(in srgb, var(--gm-btn-bg-color-disabled), transparent 80%); //TODO
background: color-mix(in srgb, var(--gm-fourth-color), transparent 90%);
border: none;
color: var(--gm-btn-bg-color-disabled) //TODO
color: var(--gm-fourth-color)
}
}
}
6 changes: 0 additions & 6 deletions src/scss/components/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
.gm-toolbar {
.gm {
&-icon-button {
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
background-color: var(--gm-toolbar-icon-color);

&:hover,
Expand Down
10 changes: 7 additions & 3 deletions src/scss/components/_widgetwindow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
label {
color: var(--gm-primary-color);
font-weight: bold;
margin-bottom: $modal-label-mb;
display: block;

}
.gm-modal-header {
display: flex;
Expand All @@ -187,7 +190,7 @@
font-size: 16px;
font-weight: bold;
letter-spacing: 0.1em;
border-bottom: 2px solid color-mix(in srgb, var(--gm-modal-bg-color), grey 10%);
border-bottom: 1px solid color-mix(in srgb, var(--gm-fourth-color), transparent 70%);
}

.gm-modal-title {
Expand All @@ -197,11 +200,11 @@
}

.gm-modal-close-btn {
mask-image: url('../assets/images/ic_close-modal.svg');
mask-image: url('../assets/images/ic_close.svg');
mask-repeat: no-repeat;
mask-position: top center;
mask-size: contain;
-webkit-mask-image: url('../assets/images/ic_close-modal.svg');
-webkit-mask-image: url('../assets/images/ic_close.svg');
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: top center;
-webkit-mask-size: contain;
Expand All @@ -221,5 +224,6 @@
.gm-separator {
width: calc(100% + $modal-x-padding + $modal-x-padding);
margin-left: -$modal-x-padding;
margin-bottom: $spacing-m;
}
}

0 comments on commit 7719dbe

Please sign in to comment.