Pixiv Additional Navigator

Add navigation menu.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Pixiv Additional Navigator
// @name:ja      Pixiv Additional Navigator
// @namespace    https://greasyfork.org/ja/users/166153-hac
// @version      1.1.1
// @description  Add navigation menu.
// @description:ja Pixivにナビゲーションメニューを追加して作品一覧やブックマークへのアクセスをよくします。2019年末のPixivのUI改変にキレて作りました。
// @author       HAC
// @match        https://www.pixiv.net/*
// @grant        none
// @license      MIT License
// @noframes
// ==/UserScript==

{
    'use strict';

    const userstyle = `
#additional_navigator {
  margin: 4px auto 0;
  padding: 0;
  width: 970px;
  display: flex;
  list-style: none;
  border-bottom: 1px solid #e4e7ee;
  box-shadow: 0 0 5px 0 rgba(0,0,0,0.1);
}
#additional_navigator > li {
  border-radius: 5px 5px 0 0;
  background-color: #fbfbfb;
  flex-grow: 1;
}
#additional_navigator > li:not(:last-child) {
  border-right: 1px solid #e4e7ee;
}
#additional_navigator > li > a {
  display: block;
  text-align: center;
  font-size: 14px;
  line-height: 32px;
  color: #258fb8;
  text-decoration: none;
}
#additional_navigator > li > a:hover {
  background: #f2f4f6;
  text-decoration: none;
}
#header-banner.spa {
  margin-top: 32px;
}
`;

    const head = document.getElementsByTagName('head')[0];
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = userstyle;
    head.appendChild(style);

    const textArray = [
        {title: 'トップ', url: '/'},
        {title: '作品管理', url: '/manage/illusts/'},
        {title: 'ブックマーク', url: '/bookmark.php'},
        {title: '非公開ブックマーク', url: '/bookmark.php?rest=hide'},
        {title: '閲覧履歴', url: '/history.php'},
        {title: 'しおり', url: '/novel/marker_all.php'},
        {title: '設定', url: '/setting_user.php'}
    ];

    const ul = document.createElement('ul');
    ul.id = 'additional_navigator';
    textArray.forEach(({title, url}) => {
        const a = document.createElement('a');
        const li = document.createElement('li');
        a.append(title);
        a.href = url;
        li.append(a);
        ul.append(li);
    });
    const wrapper = document.body.prepend(ul);
}