├── src
├── component
│ ├── Modal
│ │ └── index.module.less
│ ├── Footer.js
│ ├── modal
│ │ └── index.js
│ ├── Progress
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Footer.module.less
│ ├── Loading
│ │ ├── index.js
│ │ └── index.module.less
│ ├── Contextmenu
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Icon
│ │ └── index.js
│ ├── Search
│ │ ├── index.js
│ │ └── index.module.less
│ ├── Switch
│ │ ├── index.js
│ │ └── index.module.less
│ ├── container
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Clock
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Dropdown
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Header.module.less
│ ├── Select
│ │ ├── index.module.less
│ │ └── index.js
│ ├── OSCNews.module.less
│ ├── OSCNews.js
│ └── Header.js
├── assets
│ ├── add-icon.png
│ ├── github.svg
│ ├── apple.svg
│ ├── gitee.svg
│ ├── setting.svg
│ ├── chrome-app.svg
│ ├── website.svg
│ └── linux-logo.svg
├── utils
│ ├── index.js
│ ├── theWeek.js
│ ├── BlockFetch.js
│ └── fetch.js
├── index.less
├── pages
│ ├── Todo
│ │ ├── icon.js
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Linux
│ │ ├── index.module.less
│ │ └── index.js
│ ├── Search
│ │ ├── index.module.less
│ │ └── index.js
│ ├── History.module.less
│ ├── Github.module.less
│ ├── Navigation
│ │ ├── index.module.less
│ │ ├── Edit.module.less
│ │ ├── Edit.js
│ │ └── index.js
│ ├── Blank.module.less
│ ├── Document
│ │ ├── index.module.less
│ │ ├── index.js
│ │ └── icons.js
│ ├── History.js
│ ├── Blank.js
│ └── Github.js
├── Route.js
├── Root.js
└── index.js
├── .env
├── img
├── newtab.gif
├── newtab1.gif
├── newtab2.gif
├── osc-news1.png
├── osc-news2.png
├── osc-news3.png
├── osc-news4.png
├── osc-news5.png
├── osc-news6.png
├── osc-news7.png
├── osc-news8.png
└── osc-extensions.png
├── public
├── favicon.ico
└── index.html
├── chrome-main
├── osc-logo.png
└── manifest.json
├── .gitmodules
├── .editorconfig
├── .gitignore
├── renovate.json
├── .github
├── FUNDING.yml
└── workflows
│ └── ci.yml
├── .kktrc.js
├── package.json
└── README.md
/src/component/Modal/index.module.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | INLINE_RUNTIME_CHUNK=false
2 | FAST_REFRESH=false
3 | BUILD_PATH=dist
--------------------------------------------------------------------------------
/img/newtab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/newtab.gif
--------------------------------------------------------------------------------
/img/newtab1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/newtab1.gif
--------------------------------------------------------------------------------
/img/newtab2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/newtab2.gif
--------------------------------------------------------------------------------
/img/osc-news1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news1.png
--------------------------------------------------------------------------------
/img/osc-news2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news2.png
--------------------------------------------------------------------------------
/img/osc-news3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news3.png
--------------------------------------------------------------------------------
/img/osc-news4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news4.png
--------------------------------------------------------------------------------
/img/osc-news5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news5.png
--------------------------------------------------------------------------------
/img/osc-news6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news6.png
--------------------------------------------------------------------------------
/img/osc-news7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news7.png
--------------------------------------------------------------------------------
/img/osc-news8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-news8.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/img/osc-extensions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/img/osc-extensions.png
--------------------------------------------------------------------------------
/chrome-main/osc-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/chrome-main/osc-logo.png
--------------------------------------------------------------------------------
/src/assets/add-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaywcjlove/oscnews/HEAD/src/assets/add-icon.png
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/dev-site"]
2 | path = src/dev-site
3 | url = https://github.com/jaywcjlove/dev-site.git
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = false
9 | insert_final_newline = false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | oscnews*/
3 | build*
4 | dist*
5 |
6 | .DS_Store
7 | .cache
8 | .rdoc-dist
9 | .vscode
10 |
11 | *.bak
12 | *.tem
13 | *.temp
14 | #.swp
15 | *.*~
16 | ~*.*
17 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base"
4 | ],
5 | "packageRules": [
6 | {
7 | "matchPackagePatterns": ["*"],
8 | "rangeStrategy": "replace"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/component/Footer.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './Footer.module.less';
3 |
4 | export default function Footer({ children }) {
5 | return (
6 |
64 |
65 | {
69 | const { conf, storage } = config;
70 | conf.pageType = type;
71 | storage.set({ conf }, () => {
72 | this.setState({ type });
73 | });
74 | }}
75 | />
76 |
77 |
78 |
this.siderBar = node} className={styles.oscnews} style={{ marginLeft: OSCNewsLeft(), width: siderBarWidth }}>
79 | {config.conf.isHideOSC && (
80 |
81 | {visible ? '隐藏' : '显示新闻'}
82 |
83 | )}
84 |
85 |
89 |
90 |
91 | {React.Children.map(children, (Child) => {
92 | if (!Child || Child.type.typeName !== this.state.type) return null;
93 | return React.cloneElement(Child, {
94 | contentType: this.state.type,
95 | ...config,
96 | });
97 | })}
98 |
99 |
100 |
101 | );
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/pages/Document/index.module.less:
--------------------------------------------------------------------------------
1 | .warpper {
2 | padding: 10px;
3 | }
4 |
5 | .header {
6 | padding: 15px 25px 25px;
7 | font-size: 24px;
8 | color: #c1c1c1;
9 | // font-size: 18px;
10 | font-weight: 700;
11 | display: flex;
12 | .title {
13 | flex: 1;
14 | }
15 | .tag {
16 | font-size: 12px;
17 | line-height: 25px;
18 | font-weight: normal;
19 | color: #868686;
20 | margin: 0 0 0 10px;
21 | span {
22 | display: inline-block;
23 | padding: 0 3px 0 3px;
24 | border-radius: 2px;
25 | height: 18px;
26 | line-height: 18px;
27 | margin: 0 2px;
28 | cursor: pointer;
29 | transition: background-color .3s;
30 | &:hover, &:global(.active) {
31 | background-color: #868686;
32 | color: #fff;
33 | }
34 | }
35 | }
36 | }
37 |
38 | .noFind {
39 | min-height: 64px;
40 | align-items: center;
41 | justify-content: center;
42 | display: flex;
43 | color: #969696;
44 | }
45 |
46 | .lists {
47 | display: flex;
48 | flex-direction: row;
49 | flex-wrap: wrap;
50 | padding: 0 10px;
51 | li {
52 | display: flex;
53 | flex-direction: column;
54 | flex-grow: 1;
55 | margin: 0 5px 10px 5px;
56 | min-width: 160px;
57 | border-radius: 5px;
58 | background-color: var(--color-active);
59 | box-shadow: 0 1px 2px rgba(0,0,0,.07);
60 | transition: all .3s;
61 | &:hover {
62 | box-shadow: 0 0px 5px rgba(0, 0, 0, 0.6);
63 | .star:not(:global(.active)) svg{
64 | animation-duration: 1s;
65 | animation-fill-mode: both;
66 | animation: twinkling .6s infinite ease-in-out;
67 | }
68 | }
69 | a {
70 | text-decoration: none;
71 | }
72 | }
73 | }
74 | @keyframes twinkling{
75 | 0%{
76 | fill: #D64B24;
77 | }
78 | 50%{
79 | fill: #e0e0e0;
80 | }
81 | 100%{
82 | fill: #D64B24;
83 | }
84 | }
85 |
86 | .itemHeader {
87 | flex: 1;
88 | }
89 |
90 | .logo {
91 | display: flex;
92 | overflow: hidden;
93 | text-overflow: ellipsis;
94 | white-space: nowrap;
95 | align-items: center;
96 | padding: 5px;
97 | h4 {
98 | padding: 0 10px 0 5px;
99 | margin: 0;
100 | line-height: 16px;
101 | height: 16px;
102 | vertical-align: middle;
103 | flex: 1;
104 | }
105 | img {
106 | height: 23px;
107 | min-width: 23px;
108 | min-height: 23px;
109 | vertical-align: middle;
110 | border-radius: 3px;
111 | padding: 3px;
112 | }
113 | }
114 |
115 | .details {
116 | padding: 0px 10px 5px 10px;
117 | max-width: 190px;
118 | color: #969696;
119 | }
120 |
121 | .bottomBar {
122 | padding: 0 10px;
123 | margin: 0 0 5px 0;
124 | display: flex;
125 | svg {
126 | fill: #dcdbdb;
127 | fill: #e0e0e0;
128 | transition: all .3s;
129 | margin-right: 3px;
130 | &:hover {
131 | fill: #333;
132 | }
133 | }
134 | img, svg {
135 | width: 12px;
136 | height: 12px;
137 | }
138 | .urls {
139 | flex: 1;
140 | }
141 | .star {
142 | display: flex;
143 | align-items: center;
144 | &:global(.active) {
145 | svg {
146 | fill: #D64B24;
147 | &:hover {
148 | fill: #D64B24;
149 | }
150 | }
151 | }
152 | svg {
153 | cursor: pointer;
154 | &:hover {
155 | fill: #fbb601;
156 | }
157 | }
158 | }
159 | }
160 |
161 | .zhHans {
162 | circle, path {
163 | color: #606467;
164 | }
165 | path {
166 | fill: #fff;
167 | }
168 | &:hover {
169 | circle {
170 | fill: #D64B24;
171 | }
172 | path {
173 | fill: #FBDC00;
174 | }
175 | }
176 | }
177 |
178 | .search {
179 | outline: 0;
180 | border: 0;
181 | background-color: transparent;
182 | border-bottom: 1px solid #afafaf;
183 | margin-right: 10px;
184 | padding-bottom: 3px;
185 | max-width: 80px;
186 | text-align: center;
187 | &::placeholder {
188 | color: #afafaf;
189 | text-align: center;
190 | }
191 | }
--------------------------------------------------------------------------------
/src/pages/History.js:
--------------------------------------------------------------------------------
1 | import React, { PureComponent } from 'react';
2 | import classNames from 'classnames';
3 | import Footer from '../component/Footer';
4 | import styles from './History.module.less';
5 |
6 | function isToday(str) {
7 | const d = new Date(str.replace(/-/g, '/'));
8 | const todaysDate = new Date();
9 | if (d.setHours(0, 0, 0, 0) === todaysDate.setHours(0, 0, 0, 0)) {
10 | return true;
11 | }
12 | return false;
13 | }
14 |
15 | const time = (str) => {
16 | const date = str ? new Date(str) : new Date();
17 | const hours = date.getHours();
18 | const minutes = date.getMinutes();
19 | // const seconds = date.getSeconds();
20 | const year = date.getFullYear();
21 | const month = date.getMonth() + 1;
22 | const day = date.getDate();
23 | const today = isToday(`${year}/${month}/${day}`);
24 | return (
25 |