This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
foundryvtt-beam-saber/scss/mixin.scss

324 lines
5.4 KiB
SCSS
Raw Normal View History

2020-04-21 16:06:33 +00:00
/*
* Custom single radio.
*/
@mixin custom_radio_with_bg($width, $height, $unchecked_background, $checked_background) {
display: none;
&:checked {
& ~ label {
background-image: url($unchecked_background);
}
& + label {
background-image: url($checked_background);
}
}
}
2020-04-17 21:23:57 +00:00
/*
* Toothradio
*/
@mixin toothradio($width, $height, $unchecked_background, $checked_background) {
2020-04-21 16:06:33 +00:00
display: flex;
2020-04-17 21:23:57 +00:00
2020-04-21 16:06:33 +00:00
label {
2020-04-17 21:23:57 +00:00
& {
height: $height;
width: $width;
background-image: url($checked_background);
background-repeat: no-repeat;
background-size: contain;
margin-right: 5px;
&:last-of-type {
margin-right: 0px;
}
2020-04-21 16:06:33 +00:00
&[for$="-0"] {
width: auto;
height: auto;
background-image: none !important;
background: black !important;
margin-right: 0px;
}
2020-04-17 21:23:57 +00:00
}
}
/* Hide the browser's default checkbox */
input {
2020-04-21 16:06:33 +00:00
@include custom_radio_with_bg($width, $height, $unchecked_background, $checked_background);
}
}
2020-04-17 21:23:57 +00:00
2020-04-21 16:06:33 +00:00
/*
* Custom Radio
*/
@mixin custom_radio($width, $height) {
2020-04-17 21:23:57 +00:00
2020-04-21 16:06:33 +00:00
display: flex;
$default_color: white;
$accent_color: black;
$circle_border_color: black;
label {
& {
height: $height;
width: $width;
background-color: $accent_color;
vertical-align: middle;
border: 2px solid $circle_border_color;
border-radius: 24px;
&[for$="-0"] {
height: 5px;
width: 5px;
border-radius: 24px;
background-image: none !important;
background-color: red !important;
margin-right: 0px;
}
}
}
/* Hide the browser's default checkbox */
input {
display: none;
&:checked {
2020-04-17 21:23:57 +00:00
& ~ label {
2020-04-21 16:06:33 +00:00
background-color: $default_color;
2020-04-17 21:23:57 +00:00
}
& + label {
2020-04-21 16:06:33 +00:00
background-color: $accent_color;
2020-04-17 21:23:57 +00:00
}
}
}
}
/*
* Custom Radio Squared
*/
@mixin custom_radio_square($width, $height) {
display: flex;
$default_color: white;
$accent_color: grey;
$circle_border_color: black;
label {
& {
height: $height;
width: $width;
background-color: $accent_color;
vertical-align: middle;
border: 1px solid $circle_border_color;
&[for$="-0"] {
margin-right: 0px;
}
}
}
/* Hide the browser's default checkbox */
input {
display: none;
&:checked {
& ~ label {
background-color: $default_color;
}
& + label {
background-color: $accent_color;
}
}
}
}
2020-04-17 21:23:57 +00:00
/*
* Checkboxes underscored.
*/
@mixin check_underscore() {
2020-04-21 16:06:33 +00:00
display: flex;
flex-wrap: wrap;
2020-04-17 21:23:57 +00:00
label {
cursor: pointer;
font-size: 19px;
2020-04-17 21:23:57 +00:00
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
2020-04-21 16:06:33 +00:00
margin-right: 10px;
2020-04-17 21:23:57 +00:00
/* Hide the browser's default checkbox */
input {
2020-04-21 16:06:33 +00:00
display: none;
2020-04-17 21:23:57 +00:00
&:checked ~ .checkmark {
color: red;
}
}
.checkmark {
text-decoration: none;
font-weight: bold;
}
}
}
/*
* Create Clock
*/
@mixin clock($segments, $size, $default_color, $accent_color) {
$angle: 360 / $segments;
$skew: 90 + $angle;
$border_width: 3;
position: relative;
border: #{$border_width}px solid black;
padding: 0;
width: #{$size}px;
height: #{$size}px;
border-radius: 50%;
list-style: none;
overflow: hidden;
label {
overflow: hidden;
position: absolute;
top: -50%;
right: -50%;
width: 100%;
height: 100%;
transform-origin: 0% 100%;
background-color: $accent_color;
}
input {
position: absolute;
2020-04-21 16:06:33 +00:00
display: none;
2020-04-17 21:23:57 +00:00
&:checked {
& ~ label {
background-color: $default_color;
}
& + label {
background-color: $accent_color;
}
}
}
// Zero value to clear everything.
input[value="0"] {
display: none;
2020-04-17 21:23:57 +00:00
}
@for $i from 1 through $segments {
$rotate_angle: $angle * ($i - 1);
*:nth-child(#{$i * 2 + 1}) {
transform: rotate(#{$rotate_angle}deg) skewY(#{$skew}deg);
}
}
}
2020-04-27 14:18:39 +00:00
@mixin turf_block($turf_width, $turf_height) {
$turf_margin: 20px;
$connector_height: $turf_height/10;
$connector_width: $turf_margin * 2;
width: $turf_width;
height: $turf_height;
background-color: lightgray;
position: relative;
margin: $turf_margin;
flex-grow: initial;
&.turf-selected {
.connector {
background-color: gray;
z-index: 1;
}
}
.connector {
position: absolute;
display: block;
background-color: lightgray;
&.right,
&.left {
width: $turf_margin * 2;
height: $turf_height/5;
top: $turf_height/2 - $turf_height/10;
}
&.left {
left: -$turf_margin * 2;
}
&.right {
left: $turf_width;
}
&.top,
&.bottom {
height: $turf_margin * 2;
width: $turf_height/5;
left: $turf_width/2 - $turf_height/10;
}
&.top {
top: -$turf_margin * 2;
}
&.bottom {
top: $turf_height;
}
}
&.turf-selected {
background-color: gray;
}
.turf-description {
border: none;
background: none;
resize: none;
width: $turf_width;
text-align: center;
min-height: auto;
font-size: 12px;
}
.turf-name {
border: none;
border-radius: 0px;
text-align: center;
font-weight: bold;
}
input[type="checkbox"] {
transform: scale(1);
}
.turf-control {
&.turf-select {
position: absolute;
top: -7px;
left: -7px;
}
}
}