├── Preview.png ├── readme.md └── arxiv-blue.user.js /Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snowmeow2/Blue-arXiv-Theme/HEAD/Preview.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Blue arXiv Theme 2 | 藍色的 [arXiv](https://arxiv.org/) 主題。 3 | 4 | **真正的檔案玩家** 5 | ![preview](https://i.imgur.com/ZkreQPV.png) 6 | 7 | ## 安裝 8 | 1. 確保你有安裝 [Tampermonkey](https://www.tampermonkey.net/) 或 [Greasemonkey](https://www.greasespot.net/) 或其他支援 userscript 的瀏覽器擴充功能。 9 | 2. 將 [arxiv-blue.user.js](arxiv-blue.user.js) 的內容複製到新的 userscript 中。 10 | 3. 確認你是否有啟用 userscript。 11 | 4. 完成! 12 | 13 | ## 預覽 14 | ![preview](Preview.png) 15 | 16 | ## Credits 17 | @arkw0 18 | https://twitter.com/arkw0/status/1710635911506272326 -------------------------------------------------------------------------------- /arxiv-blue.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Blue arXiv Theme 3 | // @namespace https://github.com/snowmeow2/Blue-arXiv-Theme 4 | // @version 1.2 5 | // @description Customize the appearance of arXiv website 6 | // @author snowmeow2 7 | // @match https://arxiv.org/* 8 | // @grant none 9 | // ==/UserScript== 10 | 11 | (function() { 12 | 'use strict'; 13 | // Use custom css 14 | const style = document.createElement('style'); 15 | style.innerHTML = ` 16 | #content, .content { 17 | margin: 0em 1em 0em 1em; 18 | border-radius: 15px; 19 | padding: 1em 2em 1em 2em; 20 | filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.3)); 21 | background-color: #fff; 22 | } 23 | #header { 24 | background: transparent; 25 | border-bottom: 0px; 26 | } 27 | .mobile-header { 28 | background: transparent; 29 | } 30 | .identity { 31 | background: transparent; 32 | } 33 | .header-breadcrumbs { 34 | color: black !important; 35 | } 36 | .header-breadcrumbs a { 37 | color: black !important; 38 | } 39 | .mobile-header .column { 40 | border-left: 0px !important; 41 | border-right: 0px !important; 42 | } 43 | #abs-outer .subheader { 44 | background: transparent; 45 | } 46 | #abs-outer .extra-services { 47 | margin: 1em 0em 0em 0em; 48 | } 49 | .extra-services { 50 | box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3); 51 | border-radius: 15px; 52 | } 53 | .full-text, .browse, .extra-ref-cite, .extra-general { 54 | border-left: 0px; 55 | border-bottom: 1px solid #ccc; 56 | } 57 | .bookmarks { 58 | border-left: 0px; 59 | border-bottom: 0px; 60 | } 61 | footer { 62 | background: transparent; 63 | margin-top: 2.5rem; 64 | } 65 | footer > .columns { 66 | background: rgba(255, 255, 255, 0.9); 67 | box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3); 68 | border-radius: 15px; 69 | } 70 | footer ul li { 71 | justify-content: center; 72 | } 73 | `; 74 | document.head.appendChild(style); 75 | 76 | const content_element = document.getElementById('content'); 77 | const content_class = document.getElementsByClassName('content'); 78 | if (content_element || content_class) { 79 | let body = document.body; 80 | body.style.background = 'linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(20, 100, 220, 0.75), rgba(20, 100, 220, 1)), url("https://p2.bahamut.com.tw/B/2KU/50/1940acba5a56b975233e7e53521e9aq5.JPG")'; 81 | body.style.backgroundSize = 'cover'; 82 | body.style.backgroundRepeat = 'no-repeat'; 83 | body.style.backgroundPosition = 'center'; 84 | body.style.backgroundAttachment = 'fixed'; 85 | body.style.height = 'auto'; 86 | } 87 | 88 | // Replace the logo image 89 | const logoImg = document.querySelector('img[alt="arxiv logo"]'); 90 | if (logoImg) { 91 | logoImg.src = 'https://i.imgur.com/ZkreQPV.png'; 92 | logoImg.style.margin = '0px'; 93 | } 94 | const logoImg2 = document.querySelector('img[alt="arXiv logo"]'); 95 | if (logoImg2) { 96 | logoImg2.src = 'https://i.imgur.com/ZkreQPV.png'; 97 | } 98 | const logoCornell = document.getElementsByClassName('logo-cornell')[0]; 99 | if (logoCornell) { 100 | logoCornell.style.visibility = 'hidden'; 101 | } 102 | 103 | // Replace all text instances of "arXiv" with "Blue arXiv" except URL 104 | function replaceTextInNode(node) { 105 | if (node.nodeType === Node.TEXT_NODE) { 106 | node.nodeValue = node.nodeValue.replace(/arXiv/g, 'Blue arXiv'); 107 | } else { 108 | node.childNodes.forEach(replaceTextInNode); 109 | } 110 | } 111 | replaceTextInNode(document.body); 112 | 113 | // replace the favicon 114 | const link = document.querySelectorAll("link[rel*='icon']"); 115 | link.forEach(el => { 116 | el.href = 'https://play-lh.googleusercontent.com/k-BmewE1HZ4hrF9E9ABVvANeu1dBI5Bya0ttg8KiFGam_NpbmRqmFL4zz_RjgHbojA=s128-rw'; 117 | }); 118 | 119 | })(); --------------------------------------------------------------------------------