Automatically translated.View original post

css animation+transform

# Web Site Writing Basics

# Tranform

# animation

# css

CSS Animation is a feature in CSS that allows you to create animations or changes of an element on a web page seamlessly and procedurally. It uses a set of commands called Keyframes to determine the state of the element and uses property animation to control how to play, move, change color, or resize the element without additional JavaScript.

The main components of CSS Animation

1. @ keyframes:

It is a set of commands used to define frames, or steps of the animation, specifying how the element changes state (such as position, color, size, transparency) over a specified period of time.

2. Animation Properties:

Used to determine which element @ keyframes to create and how to play. Important features include:

Animation-name: Define the name of the Keyframes to be adopted.

Animation-duration: Determine the total duration of one animation cycle (e.g. 2 seconds or 500 milliseconds).

animation-timing-function: Determine the acceleration rate or speed of state transition between frames (e.g. Linear, Ease).

Animation-delay: Define a delay period before the animation starts.

animation-iteration-count: Determine how many times the animation will repeat.

Animation-direction: Define the direction of animation play (e.g. play forward, backwards, alternating back and forth).

Animation-fill-mode: Determine whether the element will maintain the final state of the animation.

Benefits and advantages of CSS Animation

Create interesting:

Make the website more lively and interesting.

Performance:

It is lightweight and works well with the CPU, making the website load fast and efficient.

Easy to control:

You can create complex motion effects more easily compared to using JavaScripts.

No JavaScript required:

For most animation tasks, you can create with CSS alone.

CSS Animation is ideal for tasks such as Hover effects, highlighting text, creating slideshows, or moving components on web pages.

2025/9/9 Edited to

... Read moreถ้าคุณกำลังหา “css animations tutorial” แบบเริ่มจากศูนย์ ฉันแนะนำให้โฟกัส 2 อย่างก่อนเลย: 1) @keyframes และ 2) การใช้ transform ร่วมกับ animation เพราะ transform เป็นตัวที่ทำให้การเคลื่อนไหวลื่นมาก (ย้ายตำแหน่ง/ย่อ-ขยาย/หมุน) โดยไม่ต้องพึ่ง JavaScript ตัวอย่างที่ฉันชอบใช้ฝึกคือ “เด้งกลับไปสู่รูปแบบเดิม” (เหมือนยืดแล้วคืนตัว) ซึ่งทำได้ด้วย scale + timing-function แบบง่ายๆ: 1) สร้าง keyframes - 0%: scale(1) - 50%: scale(1.15) - 100%: scale(1) เพื่อให้กลับไปสู่รูปแบบเดิม 2) ผูกกับ element - ตั้ง animation-duration เช่น 600ms - ใช้ animation-timing-function: ease-in-out จะได้ความรู้สึกธรรมชาติ - ถ้าอยากให้ “วนเรียนตลอดไป” ก็ใส่ animation-iteration-count: infinite ทริคที่เจอว่าช่วยมาก: - ถ้าต้องการให้เริ่มช้าแล้วเร็ว หรือเร็วแล้วช้า ลองสลับ timing-function ระหว่าง ease, ease-in, ease-out, linear (เริ่มจาก ease-in-out ก่อน ปลอดภัยสุด) - ถ้าอยากให้มันสลับไปมาแบบไป-กลับ (เด้งกลับ) ใช้ animation-direction: alternate จะช่วยลดการเขียน keyframes ซ้ำ - ถ้าคุณอยากให้จบแล้วค้างที่เฟรมสุดท้าย (ไม่กลับ) ใช้ animation-fill-mode: forwards แต่ถ้าเป้าหมายคือ “กลับไปสู่รูปแบบเดิม” ให้ปล่อยค่า default หรือกำหนด keyframes ให้กลับมาที่ 100% เปรียบเทียบแบบคนทำเว็บ: “CSS animation” vs “Postman” หลายคนเสิร์ชคำว่า “postman vs css animations” แล้วงง เพราะมันคนละโลกกันเลย: Postman คือเครื่องมือทดสอบ API (ส่ง request/ดู response) ส่วน CSS Animations คือทำเอฟเฟกต์ภาพเคลื่อนไหวบนหน้าเว็บ ถ้าคุณกำลังทำเว็บแอปจริงๆ มักจะใช้ทั้งคู่ร่วมกัน: Postman ไว้เช็ค API และ CSS animation ไว้ทำให้ UI ดูไหลลื่น เช่น ปุ่มโหลด, skeleton, hover effect เสริมสำหรับคนออกแบบที่เจอคำว่า “Scale strokes & effects (Figma) checkbox” ถ้าคุณออกแบบใน Figma แล้ว export มาใช้บนเว็บ บางครั้งขนาดเส้น/เอฟเฟกต์อาจย่อ-ขยายตามการ scale ทำให้ตอนเอาไปทำ CSS transform: scale() แล้วความหนาดูไม่เท่าที่คิด ใน Figma จะมีตัวเลือก “Scale strokes & effects” เพื่อกำหนดว่าจะให้ stroke/เอฟเฟกต์ถูกสเกลไปด้วยไหม - ถ้าต้องการให้ไอคอน/เส้นคมเท่าเดิมตอนปรับขนาด อาจปิดไว้ - ถ้าต้องการให้ทุกอย่างโตไปพร้อมกัน เปิดไว้ สุดท้าย ถ้าจะทำแอนิเมชันให้ลื่นจริงๆ ฉันจะพยายามใช้ transform และ opacity เป็นหลัก (เช่น translate/scale/rotate + fade) เพราะมักทำงานได้ดีและไม่หน่วง ช่วยให้เว็บดูโปรขึ้นแบบง่ายมาก

Related posts

CSS Cheat Sheet
Essential CSS tricks every developer needs! 🔥 Save this for your next project - covers flexbox, grid, animations, and responsive design in one handy reference. Perfect for beginners and pros alike! 💻✨ #CSS #WebDevelopment #Coding #Programming #Developer
EM

EM

4 likes

Powerful Websites
#fyplemon8 # #fypシ #websites #fy #websiteideas
Tha Smoke Websites

Tha Smoke Websites

238 likes

A dark blue background with the title 'CSS KNOWLEDGE TEST!' and a purple lightbulb icon. Text asks 'How many can you get right? comment your score below!' with a Lemon8 logo and username.
A dark blue background with a white box containing 'Q1: What does the CSS property justify-content: space-between; do?' and four multiple-choice options (A-D).
A dark blue background with a white box containing 'Q2: Which unit is relative to the parent element's font size?' and four multiple-choice options (A-D).
💡 Think you know CSS? Let’s find out!
💡 Think you know CSS? Let’s find out! Take this short quiz and see how many you get right 😎 Comment your score below 👇 #CodeWithAysha #CSSQuiz #LearnToCode
Aysha

Aysha

3 likes

Stunning Hover Border Effects with Animations!
#webdesign #cssanimation #creativecoding #frontenddevelopment #techcontent
Aysha

Aysha

2 likes

A customized Steam Deck with a pink and white floral skin, a bunny joystick cap, and a pink-themed interface, next to a white mechanical keyboard. The image highlights plugins used for Steam Deck customization.
A close-up of a customized Steam Deck displaying the Decky plugin menu, showing options like CSS Loader, SteamGridDB, and PowerTools. The text explains Decky Loader as a plugin launcher.
A list of favorite Steam Deck plugins, including PowerTools, CSS Loader, Audio Loader, Animation Changer, SteamGrid DB, and VibrantDeck, presented over a blurred background of a customized Steam Deck.
My Favorite Steam Deck Plugins!
One of my favorite things about the steam deck is all the customization options and the best part it’s super easy to do! With just a few downloads you can alter your Steam Deck’s wallpaper, startup & sleep screen, and so much more! Sharing some of my favorite Steam Deck plugins: Deckylo
doms.cozyspot

doms.cozyspot

416 likes

A laptop, a Starbucks drink, and a muffin on a wooden table, with the overlaid text "5 WEBSITES TO LEARN PROGRAMMING FOR BEGINNERS".
A MacBook Air displaying the FreeCodeCamp website, which offers free coding lessons and certifications. The text "FREECODECAMP" with an arrow points to the screen.
A MacBook Air showing the Codecademy website, featuring its basic, plus, and pro pricing plans. The text "CODECADEMY" with an arrow points to the screen.
Learn programming for free 👩‍💻
1. FreeCodeCamp - Languages: JavaScript, Python, SQL, HTML/CSS, and more. - Hands-on Projects: FreeCodeCamp is project-driven, meaning as you go through the curriculum, you'll build real-world applications like weather apps, portfolio websites, and data visualization projects. The full-
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

612 likes

Quick tutorial on how to isolate your lines or sketch and separate it from the background in clip studio. There’s actually a lot of ways, but this is how I’ve done it for years. lol #clipstudiopaint #art #drawing
Riven Harlow

Riven Harlow

28 likes

Come shopping with me at five below 💖✨
Transform your space without breaking the bank! 🍋✨ Discover budget-friendly decor at 5 Below that makes every room pop! #Lemon8Finds #RoomGoals Chicago
Shanti🙃🥰

Shanti🙃🥰

112 likes

I can’t be aloneeee
Bitesizemedia_

Bitesizemedia_

0 likes

The transform tool in Toonsquid is so goood #creatorsearchinsights #artvlog #sketch #toonsquid #ocart #animation
missink_toons

missink_toons

1 like

The cover image for a CSS Cheatsheet for Beginners, featuring the CSS3 logo and the text "Learn the most-used properties in one place!" on a dark blue background.
A CSS Cheatsheet section detailing properties for Background (color, image, repeat, position, size), Border (border, radius, top), and Outline (outline, offset) with example values.
A CSS Cheatsheet section outlining properties for Position (relative, top, left, z-index), Size & Dimension (width, height, max-width), and Float & Clear (float, clear) with example values.
CSS CHEATSHEET for Beginners
#css3cheatsheet #learncss #webdesignbasics #frontendtips #codingforbeginners
Aysha

Aysha

31 likes

A person is shown coding on a laptop with a tablet displaying an anime character nearby. The image features text overlays 'Level Up Your React.js Apps' and 'Using these 4 Frameworks and Libraries', indicating a guide for developers.
How I build amazing React.js Apps
Motion Formerly known as Framer Motion; A CSS Animation framework to easily add advanced animations to your JS and React applications. Headless UI Unstyled Tailwind components for React and Vue.js that integrate into Tailwind’s styling system while adding accessibility to components such as di
Karelle

Karelle

1 like

Did you know? #fyp #animation #usa #zackdfilms #tiktoklive
BEAUTIFUL LIFE 💐

BEAUTIFUL LIFE 💐

0 likes

A customized white Steam Deck with Hello Kitty and bear thumb grips displays a game carousel and a desert background. The image is titled "MY FAVORITE DECKY PLUGINS AND CSS LOADERS" with "DOWN BELOW" and an arrow, introducing the article's topic.
My Favorite Plugins
The first thing I did when I got my steam deck was customize it! But I realize I never posted what plugins and css loaders I used to customize. So here they are now! Plug ins: 1. Animation Changer (this allows you to change your boot up or shut down screen) 2. CSS Loader (this is how I customi
Larissa📖🎮

Larissa📖🎮

26 likes

A computer screen displays a code editor with JavaScript/TypeScript code, showing a project structure and a file named 'EditForm.tsx'. An overlay text reads 'Best AI Coding App'.
Best AI Coding App
Best AI Coding App in 2025? It’s BootSelf – And Here’s Why You’ll Love It! If you’ve ever tried to learn coding and felt overwhelmed, confused, or just stuck… you're not alone. I’ve tested a dozen apps, platforms, and tutorials — but BootSelf is the AI-powered coding mentor that finally mad
devswitchwithai

devswitchwithai

142 likes

Chevron-Style Breadcrumb Navigation in CSS
#webdesign #codinglife #studytips #codingforbeginners #breadcrumbs
Aysha

Aysha

5 likes

No one tells you about the 12 hour days… They’re long but they’re some of my favorite 😍❤️ #teacher #grwmforschool #morningvlog #morningroutine #classroomsetup @Andi Accessories @Free People @Alani Nutrition @DIFF Charitable Eyewear
Kristen Friend

Kristen Friend

4 likes

The image introduces "HTML + CSS IN ACTION: 30 Days of Mini Projects Modal Popup," showcasing a modal example with text "This is a Modal" and an "Open Modal" button. It highlights "Pop up power—no JavaScript needed" for Day 23, by Code With Aysha.
This image defines a modal popup as a small overlay that captures user attention and "locks" the screen. It displays a side panel with "Quick Settings" including Dark Mode, Font Size, Accent Color, Animations, Notifications, and Quick Links.
The image explains why building modals with HTML + CSS matters, demonstrating a "Page" and an "Overlay + Centered Card" modal. It emphasizes learning CSS selectors, visibility control, layering, transitions, and responsive centering without JavaScript.
Build a Sleek Slide-in Side Panel with HTML CSS
Build a modern slide-in side panel using only HTML and CSS! Perfect for quick settings, theme controls, and navigation links. Fully responsive and beginner-friendly — no JavaScript required. #HTMLCSS #WebDesign #FrontendDevelopment #codewithaysha
Aysha

Aysha

5 likes

The title slide for 'CSS ESSENTIALS Part 6 CSS UNITS EXPLAINED' features a graphic of a measuring tape around a 'Content' box, illustrating various CSS units like px, em, %, vw, and vh. It introduces the topic of breaking down CSS units for clarity.
This slide explains 'px (Pixels)' as a fixed sizing unit. It shows examples of 16px and 24px text, detailing that pixels provide predictable, fixed sizes based on screen pixels, ideal for precise control over spacing, icons, or borders.
This slide describes '% (Percentage)' as a unit relative to the parent element. An illustration shows a 'Parent Container (100%)' with a child element set to 'width: 50%'. It's highlighted as great for fluid layouts, scaling elements with their containers.
CSS Units Explained
Mastering CSS units can transform your layouts. Whether you're building pixel-perfect UI or responsive designs, knowing when to use px, %, em, rem, vh, and vw is a game-changer. Let's break them down together in this post! #CSSUnits #LearnCSS #FrontendTips #WebDesignBasics #c
Aysha

Aysha

8 likes

HTML and Css Fundamentals.
1. Core HTML Elements: Defines HTML as the "skeleton" of a website, explaining the use of h1 to h6 for headings, <p> for paragraphs, and styling tags like <strong> for importance, <em> for emphasis, <sub> for subscripts, and <sup> for superscripts. 2. Lists
ZeroandoneHQ

ZeroandoneHQ

1 like

A dark blue graphic titled 'CSS Tips to Write Cleaner & Shorter Code!' with a lightbulb and CSS file icon. It displays a code snippet `margin: 10px 20px;` and text encouraging beginners to cut down on repetition and level up their styling game.
A graphic demonstrating CSS margin and padding shorthand. It contrasts separate `margin-top`, `margin-right`, `margin-bottom`, `margin-left` properties with the concise `margin: 10px 20px;` shorthand, explaining 10px for top/bottom and 20px for left/right.
A graphic illustrating CSS font shorthand. It compares multiple font properties like `font-style`, `font-weight`, `font-size`, `line-height`, and `font-family` with the single-line shorthand `font: italic bold 16px/1.5 'Poppins', sans-serif;` for cleaner code.
CSS Tips to Write Cleaner & Shorter Code!
#csstips #webdevelopment #learntocode #frontendtips #codebetter
Aysha

Aysha

20 likes

Want to go back to MySpace?
Follow me to spacehey #myspace #90s #90skid #90sthrowback #socialmedia
80sBaby90sKid

80sBaby90sKid

7 likes

A hand holds an iPad displaying a home screen with various app icons and widgets, including a Miffy character. Text overlay reads "productive ipad apps you need to try." A coffee cup is visible on a table.
An iPad displays the Skillshare app interface, showing various online courses like "Premiere Pro" and "Notion Masterclass." Text overlay highlights "SKILL SHARE," "many courses," and "learn at your own pace."
An iPad shows the Notion app, featuring a "Home Cleaning" template with a daily checklist and reminders. Text overlay states "notion!," "download free templates," and "helps with everyday tasks."
ipad productivity apps to try! ✨
boost your productivity with these essential ipad apps: skillshare for learning new skills, notion for organizing your tasks and projects, and forest for staying focused with a unique approach✏️ whether you're planning, learning, or trying to stay on track, these apps will keep you efficient
sanae ☕️

sanae ☕️

124 likes

A dark blue cover page titled "Beginner-Friendly CSS Visual Guide" with a CSS file icon, inviting users to master CSS basics and style websites like a pro. The Lemon8 logo and username are at the bottom.
A dark blue slide introducing CSS, defining it as Cascading Style Sheets for styling HTML elements. It shows a CSS icon and provides examples of CSS syntax with a selector, property, and value.
A dark blue slide explaining CSS Selectors. It features a diagram showing a CSS file icon branching to 'p', 'div', 'class', and 'id' selectors, with text describing common selector types and their usage.
Beginner-Friendly CSS Visual Guide
#cssforbeginners #frontenddevelopment #cssvisualguide #codingforbeginners #htmlandcss
Aysha

Aysha

9 likes

Cessna 172
If you could take to the skies in any aircraft, which one would you choose and why? #pilot #cessna #flight #instructor
Maria Alejandra - P I L O T

Maria Alejandra - P I L O T

1 like

See more