In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use pure CSS to achieve the animation effect of the Windows startup interface, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Code interpretation
Define dom. The container contains 2 elements, representing logo and progress bar, and logo contains 3 paragraphs of text:
Microsoft
Windows
Professional
Centered display:
Body {
Margin:0
Height:100vh
Display:flex
Align-items:center
Justify-content:center
Background-color:black
}
Define the container size:
. windows-boot {
Width:21.5em
Height:15em
}
Style the paragraph:
.logop {
Color:white
Font-family:sans-serif
Margin:0
Padding:0
}
Set the font size:
.logo.ms {
Font-size:1.6em
}
.logo.win {
Font-size:4.2em
}
.logo.pro {
Font-size:3em
}
Set the font weight:
.logo.ms {
Font-weight:lighter
}
.logo.win {
Font-weight:bold
}
.logo.pro {
Font-weight:lighter
}
Set the row height:
.logo.ms {
Line-height:1em
}
.logo.win {
Line-height:86%
}
.logo.pro {
Line-height:1em
Padding-left:0.2em
}
Add a trademark copyright symbol after "Microsoft":
.logo.ms:: after {
Content:'\ 00a9'
Font-size:0.625em
Vertical-align:top
Position:relative
Top:-0.3em
Left:0.2em
}
Add "xp" after "Windows":
.logo.win:: after {
Content:'XP'
Font-size:0.5em
Vertical-align:top
Position:relative
Top:-0.4em
Color:tomato
}
Define the progress bar size:
.bar {
Width:15em
Height:1em
Border:0.2emsolidsilver
}
Increase the spacing between the logo and the progress bar:
.windows-xp-loader {
Display:flex
Flex-direction:column
Justify-content:space-between
Align-items:center
}
Style the progress bar:
.bar {
Border-radius:0.7em
Position:relative
Padding:0.2em
}
.bar:: before {
Content:''
Position:absolute
Width:3em
Height:70%
Background-color:dodgerblue
Border-radius:0.2em
}
Style the blue blocks in the progress bar with a linear gradient:
.bar:: before {
Background:
Linear-gradient (
Toright
Transparent30%
Black30%,black35%
Transparent35%,transparent65%
Black65%,black70%
Transparent70%
),
Linear-gradient (
Blue0%
Royalblue17%
Deepskyblue32%,deepskyblue45%
Royalblue60%
Blue100%
)
Filter:brightness (1.2)
}
Add animation effects:
.bar:: before {
Animation:run2slinearinfinite
}
@ keyframesrun {
From {
Transform:translateX (- 3em)
}
To {
Transform:translateX (15em)
}
}
Finally, hide what is outside the progress bar:
.bar {
Overflow:hidden
}
Thank you for reading this article carefully. I hope the article "how to use pure CSS to achieve the animation effect of Windows startup interface" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.