diff --git a/source/_patterns/00-atoms/18-collapsibles/accordeon-row-preview.mustache b/source/_patterns/00-atoms/18-collapsibles/accordeon-row-preview.mustache index 8e93559e88c81562d23349bc36b8a777160151d6..560c1a75bf23175208ad183ba5e81e1394294d1f 100644 --- a/source/_patterns/00-atoms/18-collapsibles/accordeon-row-preview.mustache +++ b/source/_patterns/00-atoms/18-collapsibles/accordeon-row-preview.mustache @@ -1,5 +1,7 @@ <div class="__js-root"> <ui-app inline-template> - <ui-ellipsis /> + <ui-ellipsis heading="Lorem Ipsum"> + {{ description }} + </ui-ellipsis> </ui-app> </div> \ No newline at end of file diff --git a/source/_patterns/01-molecules/11-flip-clock/flip-clock.mustache b/source/_patterns/01-molecules/11-flip-clock/flip-clock.mustache index 4d9724dd1ce56c8bb17dc68286788da707006efd..ad23a047c8768f2f7a21ef3046acda97d70a803d 100644 --- a/source/_patterns/01-molecules/11-flip-clock/flip-clock.mustache +++ b/source/_patterns/01-molecules/11-flip-clock/flip-clock.mustache @@ -2,7 +2,7 @@ <ui-flip-clock clock-classes="{{ clockClasses }}" slot-classes="{{ slotClasses }}" - deadline="2020-12-10 00:00:00" + deadline="2022-07-05 17:00:00" {{# units }}units="{{ units }}"{{/ units }} /> </div> diff --git a/source/js/components/FlipClock.vue b/source/js/components/FlipClock.vue index 800b112fbe4f9e4bf2b8bc66395c2307793f25bb..b3659b023043df4ca7b1633566b3ddd26dce5155 100644 --- a/source/js/components/FlipClock.vue +++ b/source/js/components/FlipClock.vue @@ -29,7 +29,7 @@ export default { }, units: { type: String, - default: 'years,days,hours,minutes,seconds' + default: 'years,months,days,hours,minutes,seconds' }, clockClasses: { type: String, @@ -52,35 +52,42 @@ export default { { current: 0, previous: 0, - label: "Let", + label: "Let",//will be overridden by Czech vysklonuj() elementId: 'flip-card-years-' + uuid, show: this.units.indexOf("years") !== -1, }, { current: 0, previous: 0, - label: "Dní", + label: "Měs",//will be overridden by Czech vysklonuj() + elementId: 'flip-card-months-' + uuid, + show: this.units.indexOf("months") !== -1, + }, + { + current: 0, + previous: 0, + label: "Dní",//will be overridden by Czech vysklonuj() elementId: 'flip-card-days-' + uuid, show: this.units.indexOf("days") !== -1, }, { current: 0, previous: 0, - label: "Hod", + label: "Hod",//will be overridden by Czech vysklonuj() elementId: 'flip-card-hours-' + uuid, show: this.units.indexOf("hours") !== -1, }, { current: 0, previous: 0, - label: "Min", + label: "Min",//will be overridden by Czech vysklonuj() elementId: 'flip-card-minutes-' + uuid, show: this.units.indexOf("minutes") !== -1, }, { current: 0, previous: 0, - label: "Sek", + label: "Sek",//will be overridden by Czech vysklonuj() elementId: 'flip-card-seconds-' + uuid, show: this.units.indexOf("seconds") !== -1, }, @@ -124,10 +131,12 @@ export default { this.diff = 0; this.updateTime(3, 0); } else { - this.updateTime(0, Math.trunc(this.diff / 60 / 60 / 24)); - this.updateTime(1, Math.trunc(this.diff / 60 / 60) % 24); - this.updateTime(2, Math.trunc(this.diff / 60) % 60); - this.updateTime(3, Math.trunc(this.diff) % 60); + this.updateTime(0, Math.trunc(this.diff / 60 / 60 / 24 / 30.44 / 12)); + this.updateTime(1, Math.trunc(this.diff / 60 / 60 / 24 / 30.44) % 12); + this.updateTime(2, Math.trunc((this.diff / 60 / 60 / 24) % 30.44)); + this.updateTime(3, Math.trunc(this.diff / 60 / 60) % 24); + this.updateTime(4, Math.trunc(this.diff / 60) % 60); + this.updateTime(5, Math.trunc(this.diff) % 60); } }, }, @@ -145,6 +154,25 @@ export default { return; } + const vysklonuj = (idx, val) => { + if(idx==0){//let + if(val==1 || (val > 11 && val % 10 == 1)) return "Rok"; + else if((val>=2 && val<=4) || (val > 14 && (val % 10 >= 2 && val % 10 <= 4))) return "Roky"; + else return "Let"; + }else if(idx==1){//měs + return "Měs"; + }else if(idx==2){//dní + if(val==1 || (val > 11 && val % 10 == 1)) return "Den"; + else if((val>=2 && val<=4) || (val > 14 && (val % 10 >= 2 && val % 10 <= 4))) return "Dny"; + else return "Dní"; + }else if(idx==3){//hod + return "Hod"; + }else if(idx==4){//min + return "Min"; + }else if(idx==5){//sek + return "Sek"; + } + }; const applyUpdate = () => { const d = this.timeData[idx]; const val = newValue < 0 ? 0 : newValue; @@ -153,6 +181,8 @@ export default { d.previous = d.current; d.current = val; if (el) { + + el.getElementsByClassName('flip-clock__slot')[0].innerHTML=vysklonuj(idx, val); el.classList.remove('flip'); void el.offsetWidth; el.classList.add('flip');