当前位置:网站首页>Simple HelloWorld color change
Simple HelloWorld color change
2022-07-05 05:02:00 【Fierce chicken】
The basic function of this web effect is that clicking the button on the left will change color , Click the button on the right to restore the color
Add some special effects on the basis of this simple function , For practice CSS. The special effects added are :
When the mouse hovers over the button, the button border will move
The realization of button effect needs the help of button Two pseudo elements::beforeand::after, as well as pseudo-classes:hoverThere are also transition stylestransition;
When the mouse hovers over the button , Two above and below the border “ Gap ” Will move in opposite directions , It's actually two with the same color as the background Pseudo element oblique square (transform: skew(-50deg)) It's moving , This has the effect of changing the borderWhen the color changes from the original color to the target color , The circle mask expands from the middle to both sides ; When the color changes back to the original color , The circle mask retracts from both sides to the middle
The implementation here requires With the help ofclip-pathandtransition;
In fact, the black font shown in the figure below “Hello World!” There is an absolutely positioned red on the upper layer of “Hello World!”, Just at the beginningclip-path: circle(0px)Generate a display part as radius0pxThe circular mask space is hidden . When you click “ Turn red ” After button , This circular mask shows that the space changes to a radius200px, The display space is large enough , Red “Hello World! It will be completely displayed ”. In transition propertiestransitionThe red font will slowly display under the action of[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-YO9K3qzU-1644677773265)(img/circleClipPath.png “ Schematic diagram of circular mask ”)]
effect
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-DRaqYgCK-1644677773266)(img/finalEffect.gif “ Final effect ”)]
Demo link
Article source :https://gitee.com/thisismyaddress/bocheng-blogs/tree/master/ Web page effects / ordinary HelloWorld Color change
边栏推荐
- 2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
- Flink cluster configuration
- Pdf to DWG in CAD
- MD5 bypass
- China as resin Market Research and investment forecast report (2022 Edition)
- Forecast report on research and investment prospects of Chinese wormwood industry (2022 Edition)
- Rip notes [rip message security authentication, increase of rip interface measurement]
- Unity and database
- Autocad-- Real Time zoom
- Judge the position of the monster in the role under unity3d
猜你喜欢

Establish cloth effect in 10 seconds

Download and use of font icons

Pdf to DWG in CAD

An article takes you to thoroughly understand descriptors

AutoCAD - workspace settings

UE fantasy engine, project structure

Leetcode word search (backtracking method)

django连接数据库报错,这是什么原因

UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化

AutoCAD - full screen display
随机推荐
Create a pyGame window with a blue background
Unity3d learning notes
China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)
Common database statements in unity
China as resin Market Research and investment forecast report (2022 Edition)
Introduction to JVM principle and process
Panel panel of UI
2021-10-29
3dsmax common commands
UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
Unity check whether the two objects have obstacles by ray
MySQL audit log archiving
Emlog博客主题模板源码简约好看响应式
AutoCAD - stretching
AutoCAD - scaling
Unity intelligent NPC production -- pre judgment walking (method 1)
2020-10-27
Autocad-- dynamic zoom
Unity enables mobile phone vibration
《动手学深度学习》学习笔记