.widget { display:inline-block; background-color: var(--w-bg); box-shadow: 1px 1px var(--w-shadow), 3px 3px var(--w-shadow), 5px 5px var(--w-shadow); padding:20px; margin: 10px 15px 15px 10px; border-radius: 10px; box-sizing: border-box; transition-duration: 0.15s; overflow: hidden; --base-unit: 36px; min-width: var(--base-unit); min-height: var(--base-unit); cursor:pointer; position: relative; } .widget:hover { background-color: var(--w-bg-hover); } .widget:active { background-color: var(--w-bg-active); } /** Button widget that a lot of other widgets build from */ .button { align-content: center; text-align: center; user-select: none; -webkit-user-select: none; } .button:active { transform:translate(5px, 5px); box-shadow: none !important; border:none; } /** Toggle widget for things like power buttons */ .toggle { width: calc(3 * var(--base-unit)); height: calc(3 * var(--base-unit)); --w-bg: var(--w-tg-inactive-bg); --w-bg-hover: var(--w-tg-inactive-bg-hover); --w-bg-active: var(--w-tg-inactive-bg-active); color: var(--w-tg-inactive-color); font-weight: bold; } .toggle.active { --w-bg: var(--w-tg-active-bg); --w-bg-hover: var(--w-tg-active-bg-hover); --w-bg-active: var(--w-tg-active-bg-active); color: var(--w-tg-active-color); } /** Slider widget (add h class for horizontal) */ .slider { width: var(--base-unit); height: calc(3 * var(--base-unit)); overflow: unset; } .slider.h { height: var(--base-unit); width: calc(3 * var(--base-unit)); } .slider::before { border-radius: 10px; position: absolute; bottom: 0; left: 0; height: calc(100% * var(--percent)); width: 100%; background-color: var(--w-sl-fill); transition-duration: 0.15s; content: ''; } .slider.h::before { width: calc(100% * var(--fill-percent)); height: 100%; } .slider:hover::before { background-color: var(--w-sl-fill-hover); } .slider:active::before { background-color: var(--w-sl-fill-active); } .slider::after { position: absolute; top: 6px; left: calc(50% - var(--w-sl-dots-size) / 2); height: calc(100% - var(--w-sl-dots-size) * 2); width: 0; border-right: var(--w-sl-dots); content: ''; } .slider.h::after { top: calc(50% - var(--w-sl-dots-size) / 2); left: 6px; width: calc(100% - var(--w-sl-dots-size) * 2); height: 0; border-right: none; border-bottom: var(--w-sl-dots); } .slider > .detail { display: block; position: absolute; left: calc(100% + 20px); bottom: calc(-1 * var(--base-unit) / 2 + 100% * var(--percent)); background-color: rgba(0, 132, 255, 0); color: rgba(255, 255, 255, 0); border-radius: 10px; z-index: 1; font-weight: bold; min-width: var(--base-unit); height: var(--base-unit); transition-duration: 0.15s; pointer-events: none; align-content: center; text-align: center; padding-left: 3px; padding-right: 3px; } .slider:active > .detail { background-color: rgba(0, 132, 255, 1); color: rgba(255, 255, 255, 1); } /** Checkbox widget */ .checkbox { --w-bg: rgba(0, 0, 0, 0); --w-bg-hover: rgba(0, 0, 0, 0); --w-bg-active: rgba(0, 0, 0, 0); border: 7px solid var(--w-cb-inactive-outline); box-shadow: 5px 5px inset var(--w-shadow), 1px 1px var(--w-shadow), 3px 3px var(--w-shadow), 5px 5px var(--w-shadow); padding: 0; } .checkbox:hover { border-color: var(--w-cb-inactive-outline-hover); } .checkbox:active { border: 7px solid var(--w-cb-inactive-outline-active); } .checkbox::after { height: 24px; width: 13px; box-sizing: border-box; position: absolute; display: block; border-color: white; border-style: solid; border-width: 0px 0px 0px 0px; top: calc(50% - 13px); left: calc(50% - 6px); transform-origin: center; transform: rotate(45deg); transition-duration: 0.15s; content: ''; } .checkbox.active { --w-bg: var(--w-cb-active-bg); --w-bg-hover: var(--w-cb-active-bg-hover); --w-bg-active: var(--w-cb-active-bg-active); border: none; box-shadow: 1px 1px var(--w-shadow), 3px 3px var(--w-shadow), 5px 5px var(--w-shadow); } .checkbox.active::after { border-width: 0px 5px 5px 0px; } /** Color widget */ .color-wheel { background: radial-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)), conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); border-radius: 50%; width: calc(3 * var(--base-unit)); height: calc(3 * var(--base-unit)); --side-color: #aaa; overflow: unset; } .color-wheel::after { content: ''; height: 18px; width: 18px; border: 5px solid #444; position: absolute; bottom: calc((50% - 9px) + (50%) * var(--pos-y)); left: calc((50% - 9px) + (50%) * var(--pos-x)); border-radius: 50%; transition-duration: 0.15s; box-sizing: border-box; } .color-wheel:hover::after { border-color: #888; } .color-temp { width: var(--base-unit); height: calc(3 * var(--base-unit)); background: linear-gradient(rgb(190, 200, 255), white 30%, rgb(250, 160, 100)); --side-color: #aaa; overflow: unset; } .color-temp::after { content: ''; width: calc(100% + 8px); height: 14px; border: 5px solid #444; position: absolute; bottom: calc(100% * var(--percent) - 7px); left: -4px; box-sizing: border-box; border-radius: 7px; transition-duration: 0.15s; } .color-temp:hover::after { border-color: #888; } .color-light { height: var(--base-unit); width: calc(3 * var(--base-unit)); background: linear-gradient(to left, white, black); --side-color: #aaa; overflow: unset; } .color-light::after { content: ''; height: calc(100% + 8px); width: 14px; border: 5px solid #444; position: absolute; left: calc(100% * var(--percent) - 7px); top: -4px; box-sizing: border-box; border-radius: 7px; transition-duration: 0.15s; } .color-light:hover::after { border-color: #888; } /** Thermostat */ .thermostat { align-content: center; text-align: center; width: calc(6 * var(--base-unit)); height: calc(3 * var(--base-unit)); overflow: unset; } .thermostat > .arch { position: absolute; height: 100px; width: 200px; top: calc(50% - 45px); left: calc(50% - 100px); /* Strange half-circle path */ clip-path: path("M 6.6525702323609295 64.13556976925895 A 100 100 0 0 1 193.34742976763908 64.13556976925895 A 5 5 0 0 1 184.01268679087516 67.72201279233306 A 90 90 0 0 0 15.987313209124835 67.72201279233306 A 5 5 0 0 1 6.6525702323609295 64.13556976925895 "); background-color: #222; } .thermostat > .arch::after { content: ''; display: block; height: 100px; width: 200px; background-color: var(--arch-color); transform-origin: bottom center; transform: rotate(calc((1 - var(--percent)) * -144deg - 18deg)); transition-duration: 0.5s; } .thermostat > .gague { position: absolute; bottom: calc(-13px + ((100% - 100px) / 2) + 90px); left: calc(-13px + 50%); height: 26px; width: 26px; border-radius: 50%; background-color: white; transition-duration: 0.5s; box-sizing: border-box; border: 2px solid white; box-shadow: inset 0px 0px 0px 2px var(--arch-color); transform-origin: 13px 108px; transform: rotate(calc(72deg - (1 - var(--percent)) * 144deg)); text-align: center; align-content: center; font-size: 10px; font-weight: bold; } .thermostat > .temp { position: absolute; bottom: calc((100% - 100px) / 2); left: calc(50% - 65px); width: 130px; font-size: 55px; text-align: center; }