✨ feat: boardcast
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<section class="outer">
|
||||
<% if (theme.broadcast.enable && pagination == 2){ %>
|
||||
<%- partial('_partial/broadcast') %>
|
||||
<% } %>
|
||||
<article class="articles">
|
||||
<%
|
||||
var title = '';
|
||||
|
46
layout/_partial/broadcast.ejs
Normal file
46
layout/_partial/broadcast.ejs
Normal file
@@ -0,0 +1,46 @@
|
||||
<% if (theme.broadcast.type===1 && theme.broadcast.text){ %>
|
||||
<div class="notice" style="margin-top:50px">
|
||||
<i class="ri-heart-fill"></i>
|
||||
<div class="notice-content"><%= theme.broadcast.text %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.broadcast.type===2){ %>
|
||||
<div class="notice" style="margin-top:50px">
|
||||
<i class="ri-heart-fill"></i>
|
||||
<div class="notice-content" id="broad"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
fetch('https://v1.hitokoto.cn')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById("broad").innerHTML = data.hitokoto;
|
||||
})
|
||||
.catch(console.error)
|
||||
</script>
|
||||
<% } %>
|
||||
<style>
|
||||
.notice {
|
||||
padding: 20px;
|
||||
border: 1px dashed #e6e6e6;
|
||||
color: #969696;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
background: #fbfbfb50;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.notice i {
|
||||
float: left;
|
||||
color: #999;
|
||||
font-size: 16px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.notice-content {
|
||||
display: initial;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user