1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
| /* 引入 google 字体 */ @font-face { font-family: "Montserrat"; font-style: italic; font-weight: 800; font-display: swap; src: url(https://fonts.gstatic.com/s/montserrat/v15/JTUPjIg1_i6t8kCHKm459WxZbgjD-w.ttf) format("truetype"); } @font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100; font-display: swap; src: url(https://fonts.gstatic.com/s/montserrat/v15/JTUQjIg1_i6t8kCHKm45_Qphzg.ttf) format("truetype"); } @font-face { font-family: "Montserrat"; font-style: normal; font-weight: 300; font-display: swap; src: url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_cJD7g4.ttf) format("truetype"); } /* 全局reset */ * { padding: 0; margin: 0; /* 更改盒子模型 */ box-sizing: border-box; /* 设置全局字体 */ font-family: "Montserrat", sans-serif; } body { width: 100vw; height: 100vh; /* flex 布局,设置子元素水平垂直居中 */ display: flex; justify-content: center; align-items: center; /* 设置渐变的背景颜色 */ background: linear-gradient(to bottom right, #272c46, #464c6d); } /* 包含所有布局样式的容器 */ .container { width: 480px; height: 1042px; border-radius: 50px; /* 设置一个渐变的背景颜色,用来模拟渐变边框 */
position: relative; } /* 设置一个稍小于容器的伪元素并居中,使得container的背景颜色只露出四周一圈,从而达到渐变边框的效果 */ .container:after { content: ""; position: absolute; top: 1px; left: 1px; width: 478px; height: 1040px; background-color: #363c5a; box-shadow: 26px 16px 35px rgba(0, 0, 0, 0.29); border-radius: 50px; } .container .top_bar { width: 100%; position: absolute; top: 160px; display: flex; align-items: center; justify-content: center; z-index: 1; } /* 返回按钮 */ .container .top_bar .back { width: 50px; height: 50px; background: #414768; box-shadow: -2px -2px 4px rgba(159, 159, 159, 0.25), 2px 2px 4px rgba(0, 0, 0, 0.25); border-radius: 15px; position: relative; } /* 同样用到伪元素,达到双层的效果 */ .container .top_bar .back:after { content: ""; position: absolute; width: 46px; height: 46px; left: 2px; top: 2px; background: linear-gradient(135deg, #404666 0%, #495077 100%); border-radius: 15px; cursor: pointer; z-index: 1; transition: all 0.6s; } /* 当鼠标hover的时候,有一个向内凹陷的效果 */ .container .top_bar .back:hover::after { box-shadow: inset -2px -2px 4px rgba(160, 160, 160, 0.25), inset 2px 2px 4px rgba(0, 0, 0, 0.25); } /* 字体图标样式 */ .container .top_bar .back .fa { position: absolute; top: 13px; left: 13px; font-size: 24px; color: #fff; z-index: 2; cursor: pointer; } .container .top_bar .content { font-style: italic; font-size: 36px; line-height: 21px; color: #8d92af; margin: 0 29px; } /* menu 菜单,同样使用之前的方式做渐变边框 */ .container .top_bar .menu { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(to bottom right, #b56773, #000); box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); position: relative; } .container .top_bar .menu:after { content: ""; position: absolute; top: 1px; left: 1px; width: 34px; height: 34px; background: #454c70; border-radius: 12px; } .container .top_bar .menu .fa { position: absolute; top: 10px; left: 10px; font-size: 16px; color: #fff; z-index: 2; cursor: pointer; } /* 搜索栏 */ .container .search { position: absolute; top: 132px; width: 100%; display: flex; align-items: center; justify-content: center; z-index: 1; } .container .search .input_out { position: relative; width: 413px; height: 70px; background: linear-gradient(270.11deg, #363b59 0.09%, #42486a 99.92%); box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.12), inset -1px -1px 2px rgba(171, 171, 171, 0.12); border-radius: 21px; } /* 使用after伪元素制作四周凹陷效果 */ .container .search .input_out:after { content: ""; position: absolute; width: 407px; height: 64px; top: 3px; left: 3px; background: linear-gradient(270.11deg, #363b59 0.09%, #42486a 99.92%); box-shadow: 1px 1px 2px rgba(130, 130, 130, 0.25), -1px -1px 1px rgba(170, 170, 170, 0.12); border-radius: 18px; } /* 使用before伪元素制作渐变边框填充四周凹陷区域 */ .container .search .input_out:before { content: ""; position: absolute; width: 413px; height: 70px; top: 0; left: 0; background: linear-gradient(to right, #5360d7, rgba(0, 0, 0, 0)); border-radius: 18px; } .container .search .input_out .fa { position: absolute; font-size: 24px; top: 22px; left: 20px; color: #fff; z-index: 2; } /* 真正的输入栏 */ .container .search .input { width: 407px; height: 64px; outline: none; border: none; color: #797e9c; font-size: 18px; position: absolute; border-radius: 18px; padding: 0 20px 0 50px; background-color: transparent; } .container .files { position: absolute; top: 249px; height: 160px; width: 100%; display: flex; align-items: center; justify-content: space-evenly; z-index: 1; } .container .files .file_pupple { width: 184px; height: 154px; padding-left: 40px; /* 设置了宽度,使字体图标自适应(以下同理) */ background-size: cover; /* 使用提前设计好的svg字体图标(以下同理) */ background-image: url(../svg/file_pupple.svg); display: flex; flex-direction: column; justify-content: center; } .container .files .file_orange { width: 184px; height: 154px; padding-left: 40px; background-size: cover; background-image: url(../svg/file_orange.svg); display: flex; flex-direction: column; justify-content: center; } .container .files .file_icon_container { width: 39px; height: 39px; margin-top: 10px; background: #444b6d; box-shadow: inset -2px -2px 4px rgba(255, 255, 255, 0.25), inset 3px 3px 4px rgba(0, 0, 0, 0.25); border-radius: 12px; display: flex; justify-content: center; align-items: center; } .container .files .file_icon_container .file_icon { width: 15px; height: 19px; background-size: cover; background-image: url(../svg/file_icon_orange.svg); } .container .files .file_icon_container .file_icon_blue { width: 15px; height: 19px; background-size: cover; background-image: url(../svg/file_icon_blue.svg); } .container .files .name { margin-top: 10px; font-weight: 600; font-size: 18px; line-height: 21px; color: #9da1bf; } .container .files .folder { font-size: 12px; line-height: 14px; color: #747999; } /* 进度条 */ .container .progress { position: absolute; top: 445px; height: 187px; width: 100%; display: flex; align-items: center; justify-content: space-evenly; z-index: 1; } .container .progress .left { position: relative; width: 192px; height: 192px; display: flex; align-items: center; justify-content: center; } /* 使用多个div分别制作圆形和进度条的圆环 */ .container .progress .left .circle1 { position: absolute; width: 192px; height: 192px; background: #3a4263; box-shadow: inset -2px -2px 4px rgba(134, 134, 134, 0.25), inset 2px 2px 4px rgba(0, 0, 0, 0.25); border-radius: 50%; } .container .progress .left .circle2 { position: absolute; width: 187px; height: 187px; border-radius: 50%; background: #3a4263; box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25), -2px -2px 2px rgba(149, 144, 144, 0.25); } .container .progress .left .circle4 { position: absolute; border-radius: 50%; width: 133px; height: 133px; background: #3a4263; box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.25), -2px -2px 1px rgba(82, 88, 129, 0.2); } .container .progress .left .circle3 { position: absolute; border-radius: 50%; width: 138px; height: 138px; background: #3a4263; box-shadow: inset -2px -2px 1px rgba(134, 134, 134, 0.25), inset 2px 2px 1px rgba(0, 0, 0, 0.25); } .container .progress .left .circle5 { position: absolute; border-radius: 50%; width: 138px; height: 138px; border: 2.5px solid #47affd; /* 通过clip-path来制作填充圆环(之前的视频说过这个属性) */ clip-path: polygon(50% 0%, 100% 0%, 100% 3600%, 50% 50%); } .container .progress .left .circle6 { position: absolute; width: 192px; height: 192px; border-radius: 50%; border: 2.5px solid #e5777a; transform: rotate(60deg); clip-path: polygon(50% 0%, 100% 0%, 100% 3600%, 50% 50%); } .container .progress .left .circle7 { position: absolute; width: 54px; height: 54px; border-radius: 50%; background: #464d71; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25), -2px -3px 4px rgba(255, 255, 255, 0.25); } .container .progress .right { display: flex; flex-direction: column; } .container .progress .right .margin { margin-top: 40px; } .container .progress .right .used { font-size: 14px; line-height: 16px; color: #9da1bf; } .container .progress .right .line { display: flex; align-items: center; } .container .progress .right .line .toggle { margin-right: 6px; } .container .progress .right .line .toggle .big { display: flex; justify-content: center; align-items: center; width: 13px; height: 13px; border-radius: 50%; background: #e5777a; } .container .progress .right .line .toggle .small { width: 5px; height: 5px; border-radius: 50%; background: #3b486a; } .container .progress .right .line .toggle .blue { background: #47affd; } .container .progress .right .line .text { font-size: 18px; line-height: 21px; color: #747999; } .container .items { position: absolute; top: 673px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; z-index: 1; overflow: hidden; } /* item 制作思路和上面的大体一致 */ .container .items .item { width: 414px; height: 258px; box-shadow: 0px 6px 13px rgba(0, 0, 0, 0.25); border-radius: 21px; position: relative; margin-top: 20px; display: flex; align-items: center; } .container .items .item:after { content: ""; position: absolute; width: 410px; height: 254px; left: 2px; top: 2px; border-radius: 21px; background: linear-gradient(270.11deg, #363b59 0.09%, #42486a 99.92%); cursor: pointer; z-index: 1; } .container .items .item .icon_container { margin-left: 26px; display: flex; align-items: center; justify-content: center; z-index: 2; width: 55px; height: 55px; background: linear-gradient(135deg, #323753 0%, #58608a 100%); box-shadow: 2px 4px 20px rgba(0, 0, 0, 0.25), -3px -2px 20px rgba(255, 255, 255, 0.25); border-radius: 13px; } .container .items .item .icon_container .icon { width: 18px; height: 18px; background-size: cover; background-image: url(../svg/image_icon.svg); } .container .items .item .item_text { z-index: 2; display: flex; flex-direction: column; justify-content: center; margin-left: 24px; } .container .items .item .item_text .item_name { font-size: 24px; line-height: 28px; color: #9da1bf; } .container .items .item .item_text .num_item { font-size: 14px; line-height: 32px; color: #747999; } .container .items .item .fa { z-index: 2; position: absolute; right: 26px; font-size: 24px; color: #fff; } .container .items .item1 { background: linear-gradient(to right, #a67b60, #50577f); transition: all 0.6s; } .container .items .item1:hover { background: #a67b60; }
|