|
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
6 | 6 | <meta name="description" content="Python IDE - 掌上的 Python & JavaScript 开发环境" /> |
7 | 7 | <title>Python IDE - 掌上的 Python & JavaScript 开发环境</title> |
8 | | - <link rel="icon" type="image/png" href="icon.png" /> |
| 8 | + <link rel="icon" type="image/png" href="favicon.png" sizes="32x32" /> |
| 9 | + <link rel="icon" type="image/png" href="icon.png" sizes="192x192" /> |
9 | 10 | <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script> |
10 | 11 | <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script> |
11 | 12 | <style> |
|
51 | 52 | overflow-x: hidden; |
52 | 53 | } |
53 | 54 |
|
54 | | - /* Scroll progress - 底部阅读进度,避免被误认为加载条 */ |
55 | | - #scroll-progress { |
56 | | - position: fixed; |
57 | | - bottom: 0; left: 0; |
58 | | - height: 2px; |
59 | | - width: 0%; |
60 | | - background: linear-gradient(90deg, var(--border) 0%, var(--text-muted) 100%); |
61 | | - z-index: 9999; |
62 | | - transition: width 0.1s ease-out; |
63 | | - opacity: 0.7; |
64 | | - } |
65 | | - |
66 | 55 | /* Lang switcher - no glass bar */ |
67 | 56 | .lang-switcher { |
68 | 57 | position: fixed; |
|
539 | 528 | .screenshot-item p { color: #fff; } |
540 | 529 | .why-item .check { background: linear-gradient(135deg, #424a53, #656d76); color: #fff; } |
541 | 530 | } |
| 531 | + /* 回顶部按钮 */ |
| 532 | + .back-to-top { |
| 533 | + position: fixed; |
| 534 | + bottom: 1.5rem; |
| 535 | + right: 1.5rem; |
| 536 | + width: 48px; |
| 537 | + height: 48px; |
| 538 | + border-radius: 50%; |
| 539 | + background: var(--card); |
| 540 | + border: 1px solid var(--border); |
| 541 | + color: var(--text-muted); |
| 542 | + display: flex; |
| 543 | + align-items: center; |
| 544 | + justify-content: center; |
| 545 | + cursor: pointer; |
| 546 | + z-index: 90; |
| 547 | + opacity: 0; |
| 548 | + visibility: hidden; |
| 549 | + transition: opacity 0.3s, visibility 0.3s, transform 0.3s; |
| 550 | + box-shadow: 0 4px 20px rgba(0,0,0,0.2); |
| 551 | + } |
| 552 | + .back-to-top.visible { opacity: 1; visibility: visible; } |
| 553 | + .back-to-top:hover { |
| 554 | + color: var(--text); |
| 555 | + border-color: var(--hover-border); |
| 556 | + background: var(--card-hover); |
| 557 | + transform: translateY(-3px); |
| 558 | + box-shadow: 0 8px 30px rgba(0,0,0,0.3); |
| 559 | + } |
| 560 | + .back-to-top svg { width: 22px; height: 22px; } |
| 561 | + |
542 | 562 | @media (max-width: 768px) { |
543 | 563 | .bento { grid-template-columns: 1fr; } |
544 | 564 | .why-grid { grid-template-columns: 1fr; } |
|
548 | 568 | </style> |
549 | 569 | </head> |
550 | 570 | <body> |
551 | | - <div id="scroll-progress"></div> |
552 | 571 | <div class="lang-switcher"> |
553 | 572 | <button class="lang-btn active" data-lang="zh" aria-label="中文">中文</button> |
554 | 573 | <button class="lang-btn" data-lang="en" aria-label="English">EN</button> |
555 | 574 | </div> |
556 | 575 | <canvas id="particles"></canvas> |
557 | 576 |
|
| 577 | + <button type="button" class="back-to-top" id="back-to-top" aria-label="回到顶部"> |
| 578 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 15l-6-6-6 6"/></svg> |
| 579 | + </button> |
| 580 | + |
558 | 581 | <div class="quick-nav"> |
559 | 582 | <a href="#why" data-i18n="navWhy">为什么选择</a> |
560 | 583 | <a href="#screenshots" data-i18n="navScreenshots">截图</a> |
@@ -776,16 +799,16 @@ <h2 class="section-title animate-el"><span data-i18n="donateTitle">☕ 支持开 |
776 | 799 | applyLang(lang); |
777 | 800 |
|
778 | 801 | // Scroll progress |
779 | | - const prog = document.getElementById('scroll-progress'); |
780 | | - window.addEventListener('scroll', () => { |
781 | | - const sc = window.scrollY, sh = Math.max(1, document.documentElement.scrollHeight - window.innerHeight); |
782 | | - prog.style.width = (sc / sh * 100) + '%'; |
783 | | - }); |
784 | | - |
785 | | - // Quick nav visibility |
| 802 | + // Quick nav & back-to-top visibility |
786 | 803 | const quickNav = document.querySelector('.quick-nav'); |
| 804 | + const backToTop = document.getElementById('back-to-top'); |
787 | 805 | window.addEventListener('scroll', () => { |
788 | | - quickNav.classList.toggle('visible', window.scrollY > window.innerHeight * 0.5); |
| 806 | + const show = window.scrollY > window.innerHeight * 0.5; |
| 807 | + quickNav.classList.toggle('visible', show); |
| 808 | + backToTop.classList.toggle('visible', show); |
| 809 | + }); |
| 810 | + backToTop.addEventListener('click', () => { |
| 811 | + window.scrollTo({ top: 0, behavior: 'smooth' }); |
789 | 812 | }); |
790 | 813 |
|
791 | 814 | // Particles |
|
0 commit comments