惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
GbyAI
GbyAI
美团技术团队
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
U
Unit 42
P
Proofpoint News Feed
V
V2EX

北门清燕

🎙️ 科技热文播报 - 2026-03-14 【vscode扩展】apis-tester Notion工具人bot VPS橱窗 - 一个简单的哪吒面板主题 ios17.0可以安装Trollstore了 windows服务器安装mysql踩坑指北 为哪吒面板增加视频背景 继续折腾astro serv00部署FreshRSS 【原创】油猴脚本:哪吒VPS橱窗后台脚本 哪吒面板终极进化之VPS橱窗 Typecho二开魔改简单指北 【原创】油猴脚本:论坛快捷回帖 简单米表:Typecho-Simple-Mibiao Windows 11 23H2更新遇到下载错误解决方法 Microsoft 365 E5开发者订阅管理员双重认证丢失解决方法 Virtualbox安装Ubuntu不完全指北 一剑开天门 将chrome谷歌浏览器轻松打造成rss阅读器 地震云 罗刹海市 关于笑果我觉得还是罗翔老师说的好 推荐正在玩的游戏:SimpleMMO,附游戏助手SMMOHelper 集成Elog使用notion数据库 【原创】ios捷径:法定工作日打卡提醒 测试AI 再次折腾hexo docker部署freshrss apifox自动导入apidoc接口数据 node项目部署到ftp
哪吒面板default主题小鸡底部增加购买同款按钮
bmqy · 2024-05-08 · via 北门清燕

javascript

<script>
window.onload = function(){
	const affLinks = {
		crunchbits: 'https://get.crunchbits.com/order/lblk-yearly-kvm-ssd-vps/84',
		rainyun: 'https://www.rainyun.com/MjYzMTk=_',
		colocrossing: 'https://cloud.colocrossing.com/aff.php?aff=316',
		racknerd: 'https://my.racknerd.com/aff.php?aff=9727',
	}
	const extraData = {
	  2: {
	    pid: 0,
	    price: '$27.38/Year',
	    expire: '08/13/2024'
	  },
	  15: {
	    pid: 0,
	    price: '$22.69/Year',
	    expire: '04/08/2024'
	  },
	  10: {
	    pid: 358,
	    price: '$10.98/Year',
	    expire: '11/14/2024'
	  },
	  12: {
	    pid: 23,
	    price: '$10.00/Year',
	    expire: '02/13/2025'
	  },
	  13: {
	    pid: 0,
	    price: '¥245/Year',
	    expire: '08/09/2024'
	  },
	  14: {
	    pid: 0,
	    price: '1500P/Week',
	    expire: '-'
	  },
	}
	const cats = document.querySelectorAll('.ui.accordion');
	cats.forEach((e, i)=>{
	  let $catsTitle = e.querySelector('.title');
	  let ct = $catsTitle.innerText;
	  ct = ct.trim();	
	  if(ct === '默认'){
	    return;
	  }
	  
	  let $itemCard = e.querySelectorAll('.ui.card');
	  $itemCard.forEach((ee, ii)=>{
	    let $content = ee.querySelector('.content');
	    let $descriptionGrid = ee.querySelector('.description .ui.grid');
	    let $itemTitle = $content.querySelector('.header');
	    let id = ee.getAttribute('id');
	    let pid = extraData[id].pid;
	    pid = parseInt(pid);
	    let price = extraData[id].price;
	    let expire = extraData[id].expire;
	    let $aLinkBox = document.createElement('div');
			$aLinkBox.setAttribute('style', 'margin-top: 10px;position: absolute;bottom: 5px;right: 10px;');
			let $aLink = document.createElement('a');
			$aLink.setAttribute('style', 'background-color: rgb(10, 148, 242);color:white;padding: 3px 10px;border-radius: 5px;');
			$aLink.setAttribute('target', '_blank');
	    $aLink.innerHTML = '购买同款';
	    $aLink.href = affLinks[ct];
	    if(pid){
	      $aLink.href += '&pid='+ pid;
	    }
	    if(price){
	      let $priceL = document.createElement('div');
	      $priceL.setAttribute('class', 'three wide column');
	      $priceL.innerHTML = '价格';
	      $descriptionGrid.insertBefore($priceL, $descriptionGrid.childNodes[$descriptionGrid.childNodes.length-3]);
	      let $priceR = document.createElement('div');
	      $priceR.setAttribute('class', 'thirteen wide column');
	      $priceR.innerHTML = '<i class="bi-cash-coin icon" style="color: rgb(228, 30, 16);"></i>'+ price;
	      $descriptionGrid.insertBefore($priceR, $descriptionGrid.childNodes[$descriptionGrid.childNodes.length-3])
	    }
	    if(expire){
	      let $expireL = document.createElement('div');
	      $expireL.setAttribute('class', 'three wide column');
	      $expireL.innerHTML = '到期';
	      $descriptionGrid.insertBefore($expireL, $descriptionGrid.childNodes[$descriptionGrid.childNodes.length-3])
	      let $expireR = document.createElement('div');
	      $expireR.setAttribute('class', 'thirteen wide column');
	      $expireR.innerHTML = '<i class="bi-calendar-x icon" style="color: rgb(228, 30, 16);"></i>'+ expire;
	      $descriptionGrid.insertBefore($expireR, $descriptionGrid.childNodes[$descriptionGrid.childNodes.length-3])
	    }
	    $aLinkBox.append($aLink);
	    $content.append($aLinkBox);
	  });
	});
}
</script>

javascript

$aLinkBox.setAttribute('style', 'position: absolute;bottom: 23px;right: 10px;');
$aLink.setAttribute('style', 'background-color: #21ba45f0;color: #fff;padding: 3px 10px;border-radius: 100px;box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .15), 0 0 0 1px rgba(34, 36, 38, .15)');