当前位置:网站首页>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
边栏推荐
- Pause and resume of cocos2dx Lua scenario
- PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
- Unity find the coordinates of a point on the circle
- LeetCode之单词搜索(回溯法求解)
- GameObject class and transform class of unity
- django连接数据库报错,这是什么原因
- 669. 修剪二叉搜索树 ●●
- C iterator
- AutoCAD - continuous annotation
- #775 Div.1 B. Integral Array 数学
猜你喜欢

嵌入式数据库开发编程(零)

嵌入式数据库开发编程(六)——C API

嵌入式数据库开发编程(五)——DQL

AutoCAD - continuous annotation

UE 虚幻引擎,项目结构

Number theoretic function and its summation to be updated

Do a small pressure test with JMeter tool

【论文笔记】Multi-Goal Reinforcement Learning: Challenging Robotics Environments and Request for Research

AutoCAD - isometric annotation

2021 huashubei mathematical modeling idea + reference + paper
随机推荐
UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
[leetcode] integer inversion [7]
Use assimp library to read MTL file data
2021-10-29
2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
Vs2015 secret key
Lua GBK and UTF8 turn to each other
win10虚拟机集群优化方案
Redis 排查大 key 的4种方法,优化必备
Detailed introduction of OSPF header message
中国针状焦行业发展研究与投资价值报告(2022版)
2022 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
54. Spiral matrix & 59 Spiral matrix II ●●
cocos2dx_ Lua card flip
Research and forecast report on China's solution polymerized styrene butadiene rubber (SSBR) industry (2022 Edition)
2022/7/1 learning summary
2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
669. 修剪二叉搜索树 ●●
2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem