Related to this discussion Teaching Tiddlywiki to Interactive Media & Game Design Students - #24 by telumire
I tried to build a gamingcard animation using this tutorial resp: this github
The problem I stumbled into is that it is hard to use the counter to set css-variables because of the --
which is transformed. Is there a solution for this?
<div class="cardcontainer">
<$list filter="[range[1;12]]" counter="counter">
<$wikify name="stylo" text={{{ [<counter>subtract[6]addprefix[--i:]] }}}>
<div class="ccard" style=<<stylo>> ><<stylo>>
</div>
</$wikify>
</$list>
</div>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.cardcontainer {
heigth:400px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color:green
}
.cardcontainer .ccard {
position: absolute;
width: 240px;
height: 320px;
border-radius: 10px;
background: white;
display: flex;
justify-content: center;
align-items: center;
border: 10px solid white;
cursor: pointer;
transition: 0.5s;
transform-origin: 50% 100%;
}
.cardcontainer .ccard img {
width: 100%;
height: 100%;
}
.cardcontainer:hover .ccard {
transform: rotate(calc(var(--i)*5deg))translate(calc(var(--i)*50px), -40px);
}
.cardcontainer .ccard:active {
translate: calc(var(--i)*20px)-50px;
}
</style>