mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano podświetlenie rangi supportera w karcie stacji
This commit is contained in:
+38
-43
@@ -1,52 +1,47 @@
|
||||
import Vue from 'vue'
|
||||
import Component from 'vue-class-component'
|
||||
import Vue from 'vue';
|
||||
import Component from 'vue-class-component';
|
||||
|
||||
// You can declare mixins as the same style as components.
|
||||
@Component
|
||||
export default class styleMixin extends Vue {
|
||||
calculateExpStyle(exp: string | number): string {
|
||||
const bgColor =
|
||||
exp > -1
|
||||
? exp < 2
|
||||
? "#26B0D9"
|
||||
: `hsl(${-exp * 5 + 100}, 65%, 50%)`
|
||||
: "#888";
|
||||
calculateExpStyle(exp: string | number, isSupporter: boolean = false): string {
|
||||
const bgColor = exp > -1 ? (exp < 2 ? '#26B0D9' : `hsl(${-exp * 5 + 100}, 65%, 50%)`) : '#888';
|
||||
|
||||
const fontColor = exp > 15 ? "white" : "black";
|
||||
const fontColor = exp > 15 ? 'white' : 'black';
|
||||
const boxShadow = isSupporter ? `box-shadow: 0 0 10px 2px ${bgColor}` : '';
|
||||
|
||||
return `backgroundColor: ${bgColor}; color: ${fontColor}`;
|
||||
return `backgroundColor: ${bgColor}; color: ${fontColor}; ${boxShadow};`;
|
||||
}
|
||||
|
||||
statusClasses(occupiedTo: string) {
|
||||
let className = '';
|
||||
|
||||
switch (occupiedTo) {
|
||||
case 'WOLNA':
|
||||
className = 'free';
|
||||
break;
|
||||
case 'KOŃCZY':
|
||||
className = 'ending';
|
||||
break;
|
||||
case 'NIEZALOGOWANY':
|
||||
className = 'not-signed';
|
||||
break;
|
||||
case 'BEZ LIMITU':
|
||||
className = 'no-limit';
|
||||
break;
|
||||
case 'NIEDOSTĘPNY':
|
||||
className = 'unavailable';
|
||||
break;
|
||||
case 'Z/W':
|
||||
className = 'brb';
|
||||
break;
|
||||
case 'BRAK MIEJSCA':
|
||||
className = 'no-space';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
statusClasses(occupiedTo: string) {
|
||||
let className = "";
|
||||
|
||||
switch (occupiedTo) {
|
||||
case "WOLNA":
|
||||
className = "free";
|
||||
break;
|
||||
case "KOŃCZY":
|
||||
className = "ending";
|
||||
break;
|
||||
case "NIEZALOGOWANY":
|
||||
className = "not-signed";
|
||||
break;
|
||||
case "BEZ LIMITU":
|
||||
className = "no-limit";
|
||||
break;
|
||||
case "NIEDOSTĘPNY":
|
||||
className = "unavailable";
|
||||
break;
|
||||
case "Z/W":
|
||||
className = "brb";
|
||||
break;
|
||||
case "BRAK MIEJSCA":
|
||||
className = "no-space";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return className;
|
||||
}
|
||||
return className;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user