JasonsGong.github.io/js/welcome.js

21 lines
634 B
JavaScript
Raw Permalink Normal View History

2024-03-25 11:28:14 +08:00
function welcome(){
2024-03-25 13:03:44 +08:00
let title = 'WELCOME'
let welcome_text = '嗨,好久不见,欢迎再次回来,希望您能喜欢这里的新变化!'
2024-03-25 11:28:14 +08:00
if(document.referrer!==''){
let referrer=document.referrer.split("/")[2];
2024-03-25 13:03:44 +08:00
welcome_text="嗨,好久不见,欢迎你,来自"+referrer.toUpperCase()+"的用户!";
2024-03-25 11:28:14 +08:00
if(referrer.toUpperCase()==document.domain.toUpperCase())return;
}
swal({
title: title,
text: welcome_text,
2024-03-25 15:41:10 +08:00
imageUrl: "/img/logo.png",
2024-03-25 11:28:14 +08:00
//弹窗时间1000代表一秒
2024-03-25 15:41:10 +08:00
timer: 4000,
2024-03-25 11:28:14 +08:00
showConfirmButton: true
});
}
$(document).ready(()=>{
welcome()
})