Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit 8b856b1

Browse files
authored
Merge pull request #33 from kyubibii/develop
feat: optimize homepage display for small screens
2 parents ebda40a + fa825f4 commit 8b856b1

File tree

1 file changed

+206
-0
lines changed
  • newapi/overrides/assets/stylesheets

1 file changed

+206
-0
lines changed

newapi/overrides/assets/stylesheets/home.css

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,126 @@
326326
width: 100%
327327
}
328328

329+
/* 响应式调整:页面宽度较小时内容轻微上移 */
330+
@media screen and (max-width: 76.1875em) {
331+
.mdx-hero__inner {
332+
top: 53%;
333+
}
334+
}
335+
336+
@media screen and (max-width: 60em) {
337+
.mdx-hero__inner {
338+
top: 51%;
339+
}
340+
}
341+
342+
@media screen and (max-width: 40em) {
343+
.mdx-hero__inner {
344+
top: 48%;
345+
}
346+
}
347+
348+
/* 较小宽屏优化:根据视口高度调整字体大小 */
349+
@media screen and (max-height: 700px) and (min-width: 960px) {
350+
.tx-hero__title {
351+
font-size: 2rem !important;
352+
height: 4rem !important;
353+
line-height: 2rem !important;
354+
}
355+
356+
.tx-hero__stats {
357+
margin: 0.8rem 0;
358+
}
359+
360+
.tx-stat__number {
361+
font-size: 1.5rem;
362+
}
363+
364+
.tx-hero__meta {
365+
margin: 0.8rem 0;
366+
gap: 0.6rem;
367+
}
368+
369+
.tx-hero__meta-item {
370+
padding: 0.3rem 0.8rem;
371+
font-size: 0.9rem;
372+
}
373+
374+
.tx-hero__buttons {
375+
margin-top: 1rem;
376+
}
377+
}
378+
379+
@media screen and (max-height: 600px) and (min-width: 960px) {
380+
.tx-hero__title {
381+
font-size: 1.8rem !important;
382+
height: 3.6rem !important;
383+
line-height: 1.8rem !important;
384+
}
385+
386+
.tx-hero__stats {
387+
margin: 0.6rem 0;
388+
gap: 1.5rem;
389+
}
390+
391+
.tx-stat__number {
392+
font-size: 1.3rem;
393+
}
394+
395+
.tx-stat__label {
396+
font-size: 0.7rem;
397+
}
398+
399+
.tx-hero__meta {
400+
margin: 0.6rem 0;
401+
gap: 0.5rem;
402+
}
403+
404+
.tx-hero__meta-item {
405+
padding: 0.25rem 0.6rem;
406+
font-size: 0.8rem;
407+
}
408+
409+
.tx-hero__buttons {
410+
margin-top: 0.8rem;
411+
}
412+
}
413+
414+
@media screen and (max-height: 500px) and (min-width: 960px) {
415+
.tx-hero__title {
416+
font-size: 1.5rem !important;
417+
height: 3rem !important;
418+
line-height: 1.5rem !important;
419+
}
420+
421+
.tx-hero__stats {
422+
margin: 0.4rem 0;
423+
gap: 1rem;
424+
}
425+
426+
.tx-stat__number {
427+
font-size: 1.1rem;
428+
}
429+
430+
.tx-stat__label {
431+
font-size: 0.65rem;
432+
}
433+
434+
.tx-hero__meta {
435+
margin: 0.4rem 0;
436+
gap: 0.4rem;
437+
}
438+
439+
.tx-hero__meta-item {
440+
padding: 0.2rem 0.5rem;
441+
font-size: 0.75rem;
442+
}
443+
444+
.tx-hero__buttons {
445+
margin-top: 0.6rem;
446+
}
447+
}
448+
329449
.mdx-hero__teaser {
330450
-webkit-backface-visibility: hidden;
331451
backface-visibility: hidden;
@@ -572,21 +692,42 @@
572692
justify-content: center;
573693
}
574694

695+
/* 响应式调整:小屏幕时减少边距 */
696+
@media screen and (max-width: 60em) {
697+
.tx-hero {
698+
margin: 24px 1.5rem;
699+
}
700+
}
701+
702+
@media screen and (max-width: 40em) {
703+
.tx-hero {
704+
margin: 16px 1rem;
705+
}
706+
}
707+
575708
.tx-hero__title {
576709
margin-bottom: 1rem !important;
577710
font-weight: 700 !important;
578711
font-size: 2.5rem !important;
712+
height: 5rem !important; /* 2倍字体大小 */
713+
position: relative !important;
714+
overflow: hidden !important;
715+
line-height: 2.5rem !important; /* 等于字体大小 */
579716
}
580717

581718
@media screen and (max-width: 76.1875em) {
582719
.tx-hero__title {
583720
font-size: 2rem !important;
721+
height: 4rem !important; /* 2倍字体大小 */
722+
line-height: 2rem !important; /* 等于字体大小 */
584723
}
585724
}
586725

587726
@media screen and (max-width: 40em) {
588727
.tx-hero__title {
589728
font-size: 1.5rem !important;
729+
height: 3rem !important; /* 2倍字体大小 */
730+
line-height: 1.5rem !important; /* 等于字体大小 */
590731
}
591732
}
592733

@@ -879,6 +1020,71 @@
8791020
}
8801021

8811022
/* Responsive Design for Architecture */
1023+
1024+
/* 较小宽屏优化:根据视口高度调整架构图 */
1025+
@media screen and (max-height: 700px) and (min-width: 960px) {
1026+
.tx-architecture {
1027+
max-width: 720px;
1028+
padding: 0.6rem;
1029+
gap: 0.4rem;
1030+
margin: 0.6rem auto 0.4rem;
1031+
}
1032+
1033+
.tx-architecture__flow-node {
1034+
padding: 0.4rem 0.8rem;
1035+
min-width: 100px;
1036+
}
1037+
1038+
.tx-architecture__flow-icon {
1039+
font-size: 1.1rem;
1040+
}
1041+
1042+
.tx-architecture__flow-label {
1043+
font-size: 0.65rem;
1044+
}
1045+
1046+
.tx-architecture__features {
1047+
gap: 0.25rem;
1048+
padding: 0.2rem 0;
1049+
}
1050+
1051+
.tx-architecture__feature {
1052+
padding: 0.25rem 0.5rem;
1053+
font-size: 0.6rem;
1054+
}
1055+
1056+
.tx-architecture__feature-icon {
1057+
font-size: 0.8rem;
1058+
}
1059+
1060+
.tx-architecture__providers {
1061+
gap: 0.3rem;
1062+
padding-top: 0.2rem;
1063+
}
1064+
1065+
.tx-architecture__provider {
1066+
padding: 0.25rem 0.5rem;
1067+
font-size: 0.6rem;
1068+
}
1069+
1070+
.tx-architecture__provider-arrow {
1071+
width: 2.5rem;
1072+
height: 0.7rem;
1073+
}
1074+
}
1075+
1076+
@media screen and (max-height: 600px) and (min-width: 960px) {
1077+
.tx-architecture {
1078+
display: none; /* 在较小高度下隐藏架构图以节省空间 */
1079+
}
1080+
}
1081+
1082+
@media screen and (max-height: 650px) and (min-width: 960px) {
1083+
.tx-architecture {
1084+
display: none; /* 在较小高度下隐藏架构图以节省空间 */
1085+
}
1086+
}
1087+
8821088
@media screen and (max-width: 960px) {
8831089
.tx-architecture {
8841090
padding: 1rem;

0 commit comments

Comments
 (0)