Skip to content

Commit

Permalink
animation test
Browse files Browse the repository at this point in the history
  • Loading branch information
vaaaaanquish committed Jun 21, 2024
1 parent ad2d3d4 commit d59cb7a
Showing 1 changed file with 1 addition and 64 deletions.
65 changes: 1 addition & 64 deletions torisetsu/src/jsMain/kotlin/components/pages/TopPageStyle.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package components.pages

import org.jetbrains.compose.web.ExperimentalComposeWebApi
import org.jetbrains.compose.web.css.*
import style.GlobalStyle
import style.forMobile
Expand Down Expand Up @@ -123,26 +122,13 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
}
}

@OptIn(ExperimentalComposeWebApi::class)
private val rotationKeyframes by keyframes {
each(0.percent) { transform { rotate(0.deg) } }
each(10.percent) { transform { rotate(360.deg) } }
each(100.percent) { transform { rotate(360.deg) } }
}

val leftBirds by style {
position(Position.Absolute)
bottom(0.px)
width(100.percent)
property("object-fit", "contain")
property("object-position", "right")

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(15.s)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand All @@ -159,12 +145,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
property("object-fit", "contain")
property("object-position", "right")

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(5.s)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand Down Expand Up @@ -197,12 +177,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
property("object-fit", "contain")
property("object-position", "right")

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(10.s)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand Down Expand Up @@ -246,12 +220,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
width(100.percent)
maxWidth(2000.px)

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(25.s)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand All @@ -266,12 +234,7 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
width(65.percent)
maxWidth(1000.px)

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(20.s)
}

media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand All @@ -295,12 +258,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
}
}

animation(rotationKeyframes) {
duration(50.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
delay(30.s)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand All @@ -316,21 +273,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
}
}

@OptIn(ExperimentalComposeWebApi::class)
private val vibrateKeyframes by keyframes {
each(0.percent) { transform { translateX(-50.percent) } }
each(10.percent) { transform { translateX(-49.percent) } }
each(20.percent) { transform { translateX(-51.percent) } }
each(30.percent) { transform { translateX(-49.percent) } }
each(40.percent) { transform { translateX(-51.percent) } }
each(50.percent) { transform { translateX(-49.percent) } }
each(60.percent) { transform { translateX(-51.percent) } }
each(70.percent) { transform { translateX(-49.percent) } }
each(80.percent) { transform { translateX(-51.percent) } }
each(90.percent) { transform { translateX(-49.percent) } }
each(100.percent) { transform { translateX(-50.percent) } }
}

val centerBirds by style {
position(Position.Fixed)
bottom(20.px) // footerの高さ分あげる
Expand All @@ -347,11 +289,6 @@ object TopPageStyle : StyleSheet(GlobalStyle) {
}
}

animation(vibrateKeyframes) {
duration(20.s)
timingFunction(AnimationTimingFunction.Linear)
iterationCount(null)
}
media("prefers-reduced-motion") {
self style {
property("animation-name", "none")
Expand Down

0 comments on commit d59cb7a

Please sign in to comment.