SHOW:
|
|
- or go back to the newest paste.
| 1 | <!-- 小红帽友链_v2.00 2022-08-28 星球彦 https://storeweb.cn --> | |
| 2 | ||
| 3 | 这些友情链接是来自<a class='domain-url' href="" target="_blank" class="site-friend-link-project">个站商店</a>的一个子项目 <a href="" target="_blank" class="site-friend-link-project">『<span class='site-url'></span>』</a>,点<a | |
| 4 | href="https://storeweb.cn" target="_blank" class="site-friend-link-homepage"> 这里 </a>访问我在个站商店上的主页 | |
| 5 | <br> | |
| 6 | ||
| 7 | <script src='https://libs.baidu.com/jquery/1.11.1/jquery.min.js'></script> | |
| 8 | ||
| 9 | <style type="text/css"> | |
| 10 | .hide {
| |
| 11 | display: none; | |
| 12 | } | |
| 13 | .clear {
| |
| 14 | clear: both; | |
| 15 | } | |
| 16 | .site-friend-link {
| |
| 17 | margin-bottom: 20px; | |
| 18 | overflow: hidden; | |
| 19 | line-height: 175%; | |
| 20 | } | |
| 21 | .site-friend-link div {
| |
| 22 | position: relative; | |
| 23 | float: left; | |
| 24 | width: 266px; | |
| 25 | margin: 12px 12px; | |
| 26 | padding: 8px; | |
| 27 | border-radius: 4px; | |
| 28 | border: 1px solid #d1c7b7; | |
| 29 | background-color: #fffef9; | |
| 30 | overflow: visible; | |
| 31 | min-height: 80px; | |
| 32 | } | |
| 33 | .site-friend-link-image {
| |
| 34 | float: left; | |
| 35 | width: 50px; | |
| 36 | height: 50px !important; | |
| 37 | border-radius: 25px; | |
| 38 | margin-top: 5px; | |
| 39 | } | |
| 40 | .site-friend-link-name {
| |
| 41 | float: left; | |
| 42 | width: calc(100% - 50px); | |
| 43 | text-align: left; | |
| 44 | padding-left: 15px; | |
| 45 | font-size: 16px; | |
| 46 | white-space: nowrap; | |
| 47 | text-overflow: ellipsis; | |
| 48 | overflow: hidden; | |
| 49 | } | |
| 50 | .site-friend-link-into {
| |
| 51 | float: left; | |
| 52 | width: calc(100% - 50px); | |
| 53 | text-align: left; | |
| 54 | padding-left: 15px; | |
| 55 | color: #999; | |
| 56 | white-space: nowrap; | |
| 57 | text-overflow: ellipsis; | |
| 58 | overflow: hidden; | |
| 59 | font-size: 14px; | |
| 60 | } | |
| 61 | .site-friend-link-count {
| |
| 62 | position: absolute; | |
| 63 | top: -8px; | |
| 64 | right: -8px; | |
| 65 | width: 16px; | |
| 66 | height: 16px; | |
| 67 | border-radius: 8px; | |
| 68 | background-color: #ff7d1e; | |
| 69 | color: white !important; | |
| 70 | font-size: 10px; | |
| 71 | padding-left: 5px; | |
| 72 | } | |
| 73 | </style> | |
| 74 | <script data-no-instant> | |
| 75 | var store = 'https://storeweb.cn' | |
| 76 | // ----------------------------------- 配置 --------------------------------------- | |
| 77 | var url = 'https://api.note-star.cn/api/third/read/{siteId}'; // <--- {siteId}改为你的网站id,网站id是在你的个站网站页的url最右边的数字
| |
| 78 | // ----------------------------------- 配置 --------------------------------------- | |
| 79 | function get_friend_link_api() {
| |
| 80 | - | $.post(url, {},function(result){
|
| 80 | + | $.get(url, {},function(result){
|
| 81 | console.log(result) | |
| 82 | $('.domain-url').attr('href',result.data.domainUrl)
| |
| 83 | $('.site-friend-link-homepage').attr('href',result.data.siteUrl)
| |
| 84 | $('.site-url').html(result.data.introTitle)
| |
| 85 | $('.site-friend-link-project').attr('href',result.data.introUrl)
| |
| 86 | template_make(result.data.list) | |
| 87 | }) | |
| 88 | } | |
| 89 | $(function () {
| |
| 90 | $('.site-friend-link').html('正在向『个站商店』请求友链数据……');
| |
| 91 | get_friend_link_api(); | |
| 92 | }) | |
| 93 | function template_make(list) {
| |
| 94 | //console.log(data) | |
| 95 | $('.site-friend-link').html('');
| |
| 96 | $.each(list, function (key, value) {
| |
| 97 | //console.log(value.name); | |
| 98 | var template = $('#links-template').text();
| |
| 99 | template = template.replace('%%name%%', value.name);
| |
| 100 | template = template.replace('%%logo_cn%%', value.logoUrl);
| |
| 101 | template = template.replace('%%intro_link%%', value.friendIntro);
| |
| 102 | template = template.replace('%%domain%%', value.http+ value.domain);
| |
| 103 | template = template.replace('%%update_count%%', '');
| |
| 104 | if (!value.isRssUpdate) {
| |
| 105 | template = template.replace('%%update_hide%%', 'hide');
| |
| 106 | } else {
| |
| 107 | template = template.replace('%%update_hide%%', 'F');
| |
| 108 | } | |
| 109 | var template_id = $(template); | |
| 110 | $('.site-friend-link').append(template_id);
| |
| 111 | }) | |
| 112 | } | |
| 113 | function set_storeweb_info(information) {
| |
| 114 | $('.site-friend-link-homepage').attr('href', information['homepage']);
| |
| 115 | $('.site-friend-link-project').attr('href', information['project']);
| |
| 116 | //$('.site-friend-link-storeweb').attr('href',information['storeweb']);
| |
| 117 | } | |
| 118 | </script> | |
| 119 | <div class="clear"></div> | |
| 120 | <div class="site-friend-link"> | |
| 121 | </div> | |
| 122 | <script type="text/html" id="links-template" data-no-instant> | |
| 123 | <div> | |
| 124 | <a class="site-friend-link-count %%update_hide%%"> | |
| 125 | %%update_count%% | |
| 126 | </a> | |
| 127 | <img class="site-friend-link-image" | |
| 128 | src="%%logo_cn%%"/> | |
| 129 | <a class="site-friend-link-name" | |
| 130 | href="%%domain%%" target="_blank"> | |
| 131 | %%name%% | |
| 132 | </a> | |
| 133 | <span class="site-friend-link-into">%%intro_link%%</span> | |
| 134 | </div> | |
| 135 | </script> | |
| 136 | Advert |