Repository navigation
Expand file tree
/
Copy pathNoticeLinks.js
More file actions
50 lines (45 loc) · 1.54 KB
/
Copy pathNoticeLinks.js
File metadata and controls
50 lines (45 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react';
import {Icon} from 'semantic-ui-react';
export default class NoticeLinks extends React.Component {
list = React.createRef();
active = 1;
constructor(props) {
super(props);
}
componentDidMount() {
setInterval(() => this.renderItem(this.list.current.children), 5000);
}
renderItem(list) {
Array.prototype.forEach.call(list, (item, i) => {
if (i === this.active) {
item.classList.add('show');
} else {
item.classList.remove('show');
}
});
this.active++;
if (this.active >= list.length) {
this.active = 0;
}
}
render() {
return (
<div className='notice-links' ref={this.list}>
<a className='animated fadeIn show' target='_blank' rel='noopener noreferrer'
href='https://github.com/unbug/snts'>
<Icon name='heart'/> SAY NO TO SUICIDE PUBLIC LICENSE
</a>
<a className='animated fadeIn' target='_blank' rel='noopener noreferrer' href='//mihtool.com/'>
<Icon name='code'/> [MIHTool] iOS 上调试和优化页面的工具
</a>
<a className='animated fadeIn' target='_blank' rel='noopener noreferrer' href='https://www.wasmrocks.com/'>
<Icon name='hand rock'/> WebAssembly Rocks
</a>
<a className='animated fadeIn' target='_blank' rel='noopener noreferrer'
href='https://www.gitbook.com/book/unbug/react-native-training/details'>
<Icon name='video'/> [开源] React Native 开发培训资料和视频
</a>
</div>
)
}
}