1
我正在嘗試創建較少的循環,以便使用CSS爲硬幣左側和頂部位置設置動畫。我創建了一些少mixin,創建一個關鍵幀並將其分配給當前元素,但我得到的是較少的錯誤。 有人可以說,這段代碼有什麼問題嗎?導致編譯錯誤的關鍵幀循環動畫
.boom (@index) when (@index > 0){
@keyframes [email protected] {
0% {
top: 50%;
left: 50%;
}
50%{
top: random(2500)+px;
left: random(2500)+px;
}
}
.coin:nth-child(@{@]index}){
left: unit(@{i}* 10, px);
animation-duration: 2.6s;
animation-name: [email protected]{i};
animation-direction: alternate;
animation-timing-function: ease-in-out;
}
.boom(@index - 1);
}
.boom(5);
'隨機的(2500)+ px'! –
哦,上帝,我怎麼錯過@七階段最大值。應該是因爲它沒有導致編譯錯誤。順便說一下,真的有一個'random()'內置函數? – Harry
不,沒有'隨機',所以我想知道丹尼斯在哪裏收集了他認爲可以工作的很多錯誤的想法(對於'1 + px',我認爲她可以使用'lessphp',它允許'+'用於字符串連接,但是它不支持'@keyframes'中的任何類型的插值)。 –