Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: animationize my icon in rotate-my-icon when slidev dev #381

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions slides/rotate-my-icon/pages/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const MyIcon = (props: IMyIconProps) => {
layout: center
---

<img border="rounded" width="250" src="/rotate_z.png"/>
<img class="rotate-animation-z" src="/rotated_my_icon.png" width="225" border="rounded"/>

<br />

Expand Down Expand Up @@ -295,39 +295,39 @@ layout: center
<p>
X 軸
</p>
<img src="/rotate_x.png" width="225" border="rounded"/>
<img class="rotate-animation-x" src="/rotated_my_icon.png" width="225" border="rounded"/>
</div>
<div class="panel">
<p>
Y 軸
</p>
<img src="/rotate_y.png" width="225" border="rounded"/>
<img class="rotate-animation-y" src="/rotated_my_icon.png" width="225" border="rounded"/>
</div>
<div class="panel">
<p>
Z 軸
</p>
<img src="/rotate_z.png" width="225" border="rounded"/>
<img class="rotate-animation-z" src="/rotated_my_icon.png" width="225" border="rounded"/>
</div>
<div class="panel col-span-3">
<p style="text-align: center; font-size: x-large">
回転した!
</p>
</div>
<div class="panel">
<img src="/rotate_xy.png" width="225" border="rounded"/>
<img class="rotate-animation-xy" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
X 軸 & Y 軸
</p>
</div>
<div class="panel">
<img src="/rotate_xz.png" width="225" border="rounded"/>
<img class="rotate-animation-xz" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
X 軸 & Z 軸
</p>
</div>
<div class="panel">
<img src="/rotate_yz.png" width="225" border="rounded"/>
<img class="rotate-animation-yz" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
Y 軸 & Z 軸
</p>
Expand Down Expand Up @@ -992,7 +992,7 @@ layout: default

<div>

<img src="/rotated_my_icon.png">
<img class="rotate-animation-xz" src="/rotated_my_icon.png">

</div>

Expand Down
12 changes: 6 additions & 6 deletions slides/rotate-my-icon/pages/intro_random_rotate.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,37 @@ layout: center
<!-- grid で 6 等分する -->
<div class="grid grid-cols-6 gap-4">
<div class="col-span-2 panel">
<img src="/rotate_x.png" width="225" border="rounded"/>
<img class="rotate-animation-x" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
X 軸
</p>
</div>
<div class="col-span-2 panel">
<img src="/rotate_y.png" width="225" border="rounded"/>
<img class="rotate-animation-y" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
Y 軸
</p>
</div>
<div class="col-span-2 panel">
<img src="/rotate_z.png" width="225" border="rounded"/>
<img class="rotate-animation-z" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
Z 軸
</p>
</div>
<div class="col-span-2 panel">
<img src="/rotate_xy.png" width="225" border="rounded"/>
<img class="rotate-animation-xy" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
X 軸 & Y 軸
</p>
</div>
<div class="col-span-2 panel">
<img src="/rotate_xz.png" width="225" border="rounded"/>
<img class="rotate-animation-xz" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
X 軸 & Z 軸
</p>
</div>
<div class="col-span-2 panel">
<img src="/rotate_yz.png" width="225" border="rounded"/>
<img class="rotate-animation-yz" src="/rotated_my_icon.png" width="225" border="rounded"/>
<p>
Y 軸 & Z 軸
</p>
Expand Down
2 changes: 1 addition & 1 deletion slides/rotate-my-icon/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info: |
CSS, JavaScript, React, Astro, Browser
drawings:
persist: false
transition: slide-left
transition: none
title: カチカチするたびランダムに回転する僕の作り方 with Astro
---

Expand Down
2 changes: 1 addition & 1 deletion slides/rotate-my-icon/slides_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info: |
CSS, JavaScript, React, Astro, Browser
drawings:
persist: false
transition: slide-left
transition: none
title: How to make myself rotate randomly every time I click with Astro (Translated by DeepL)
---

Expand Down
87 changes: 87 additions & 0 deletions slides/rotate-my-icon/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,90 @@ h1 {
h1 > code {
background: none;
}


/*
/ DRYとは何だったのか
/ CSSよくわからん
*/

/* 全部回すと変化無し
@keyframes rotate-anime-xzy {
0% {transform: rotate(0deg) rotateX(0deg) rotateY(0deg) scale(1);}
25% {transform: rotate(90deg) rotateX(90deg) rotateY(90deg) scale(1.5);}
50% {transform: rotate(180deg) rotateX(180deg) rotateY(180deg) scale(1);}
75% {transform: rotate(270deg) rotateX(270deg) rotateY(270deg) scale(1.5);}
100% {transform: rotate(360deg) rotateX(360deg) rotateY(360deg) scale(1);}
} */

.rotate-animation-xy {
animation: rotate-anime-xy 1.5s linear infinite
}

@keyframes rotate-anime-xy {
0% {transform: rotateX(0deg) rotateY(0deg) scale(1);}
25% {transform: rotateX(90deg) rotateY(90deg) scale(1.5);}
50% {transform: rotateX(180deg) rotateY(180deg) scale(1);}
75% {transform: rotateX(270deg) rotateY(270deg) scale(1.5);}
100% {transform: rotateX(360deg) rotateY(360deg) scale(1);}
}

.rotate-animation-xz {
animation: rotate-anime-xz 1.5s linear infinite
}

@keyframes rotate-anime-xz {
0% {transform: rotate(0deg) rotateX(0deg) scale(1);}
25% {transform: rotate(90deg) rotateX(90deg) scale(1.5);}
50% {transform: rotate(180deg) rotateX(180deg) scale(1);}
75% {transform: rotate(270deg) rotateX(270deg) scale(1.5);}
100% {transform: rotate(360deg) rotateX(360deg) scale(1);}
}

.rotate-animation-yz {
animation: rotate-anime-yz 1.5s linear infinite
}

@keyframes rotate-anime-yz {
0% {transform: rotate(0deg) rotateY(0deg) scale(1);}
25% {transform: rotate(90deg) rotateY(90deg) scale(1.5);}
50% {transform: rotate(180deg) rotateY(180deg) scale(1);}
75% {transform: rotate(270deg) rotateY(270deg) scale(1.5);}
100% {transform: rotate(360deg) rotateY(360deg) scale(1);}
}

.rotate-animation-z {
animation: rotate-anime-z 1.5s linear infinite
}

@keyframes rotate-anime-z {
0% {transform: rotate(0deg) scale(1);}
25% {transform: rotate(90deg) scale(1.5);}
50% {transform: rotate(180deg) scale(1);}
75% {transform: rotate(270deg) scale(1.5);}
100% {transform: rotate(360deg) scale(1);}
}

.rotate-animation-y {
animation: rotate-anime-y 1.5s linear infinite
}

@keyframes rotate-anime-y {
0% {transform: rotateY(0deg) scale(1);}
25% {transform: rotateY(90deg) scale(1.5);}
50% {transform: rotateY(180deg) scale(1);}
75% {transform: rotateY(270deg) scale(1.5);}
100% {transform: rotateY(360deg) scale(1);}
}

.rotate-animation-x {
animation: rotate-anime-x 1.5s linear infinite
}

@keyframes rotate-anime-x {
0% {transform: rotateX(0deg) scale(1);}
25% {transform: rotateX(90deg) scale(1.5);}
50% {transform: rotateX(180deg) scale(1);}
75% {transform: rotateX(270deg) scale(1.5);}
100% {transform: rotateX(360deg) scale(1);}
}