CSS animations

This commit is contained in:
Face
2025-08-10 15:24:49 +03:00
parent 0e069bd438
commit 6b687b4837
7 changed files with 111 additions and 74 deletions

View File

@@ -132,26 +132,12 @@ static func parse_scale_utility(utility_name: String) -> Dictionary:
static func parse_rotation_utility(utility_name: String) -> Dictionary:
var result = {}
if utility_name.begins_with("rotate-x-"):
var val = utility_name.substr(9) # after "rotate-x-"
if val.begins_with("[") and val.ends_with("]"):
val = val.substr(1, val.length() - 2)
var rotation = parse_rotation(val)
result["rotate-x"] = rotation
return result
elif utility_name.begins_with("rotate-y-"):
var val = utility_name.substr(9) # after "rotate-y-"
if val.begins_with("[") and val.ends_with("]"):
val = val.substr(1, val.length() - 2)
var rotation = parse_rotation(val)
result["rotate-y"] = rotation
return result
elif utility_name.begins_with("rotate-"):
if utility_name.begins_with("rotate-"):
var val = utility_name.substr(7) # after "rotate-"
if val.begins_with("[") and val.ends_with("]"):
val = val.substr(1, val.length() - 2)
var rotation = parse_rotation(val)
result["rotate-z"] = rotation # Default rotation is around Z-axis
result["rotate"] = rotation
return result
return result

View File

@@ -43,8 +43,9 @@ static func init_patterns():
"^cursor-[a-zA-Z-]+$", # cursor types
"^scale-(x-|y-)?\\d+$", # scale utilities like scale-100, scale-x-75, scale-y-150
"^scale-(x-|y-)?\\[.*\\]$", # custom scale values like scale-[1.5], scale-x-[2.0]
"^rotate-(x-|y-)?\\d+$", # rotation utilities like rotate-45, rotate-x-90, rotate-y-180
"^rotate-(x-|y-)?\\[.*\\]$", # custom rotation values like rotate-[45deg], rotate-x-[90deg], rotate-y-[3.5rad]
"^rotate-\\d+$", # rotation utilities like rotate-45, rotate-90
"^rotate-\\[.*\\]$", # custom rotation values like rotate-[45deg], rotate-[3.5rad]
"^transition(-colors|-opacity|-transform)?$", # transition utilities
"^(hover|active):", # pseudo classes
]
for pattern in utility_patterns: