当前位置:网站首页>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::before
and::after
, as well as pseudo-classes:hover
There 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-path
andtransition
;
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 radius0px
The 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 propertiestransition
The 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 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem
- cocos2dx_ Lua particle system
- BUUCTF MISC
- 【Leetcode】1352. 最后 K 个数的乘积
- How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
- AutoCAD - lengthening
- Personal required code
- UE fantasy engine, project structure
- 数论函数及其求和 待更新
- 2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
猜你喜欢
Download and use of font icons
Redis 排查大 key 的4种方法,优化必备
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
用 Jmeter 工具做个小型压力测试
AutoCAD - scaling
Rip notes [rip message security authentication, increase of rip interface measurement]
54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
django连接数据库报错,这是什么原因
UE fantasy engine, project structure
On-off and on-off of quality system construction
随机推荐
2021 huashubei mathematical modeling idea + reference + paper
2020-10-27
2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
2022 / 7 / 1 Résumé de l'étude
Kali 2018 full image download
AutoCAD - workspace settings
Redis has four methods for checking big keys, which are necessary for optimization
Thinking of 2022 American College Students' mathematical modeling competition
AutoCAD - feature matching
SQLServer 存储过程传递数组参数
中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
2021 electrician cup idea + code - photovoltaic building integration plate index development trend analysis and prediction: prediction planning issues
UE fantasy engine, project structure
Do a small pressure test with JMeter tool
[LeetCode] 整数反转【7】
Introduction to JVM principle and process
2022/7/2做题总结
Listview pull-down loading function
3dsmax scanning function point connection drawing connection line
Pdf to DWG in CAD