admin管理员组文章数量:1126420
When someone lands on my blog homepage (blog-name.tumblr), I want them to see a fake restricted page with a hidden link. The link leads to blog-name.tumblr/page/1 and shows the true blog homepage. Every other blog link (/post, /tagged...) should also work.
I am thus working with two HTML scripts:
- Restricted blog
- Normal blog
My question: Is there a way to conditionally activate the one or the other HTML script based on the current URL (blog-name.tumblr or blog-name.tumblr/[anything])?
HTML for restricted blog:
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #36465d;
color: white;
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 18px;
font-weight: bold;
margin: 0;
text-align: center;
}
a {
color: #36465d; /* hidden link, same color as background */
text-decoration: none;
font-size: 8px;
}
.gif-container {
margin-top: 20px; /* space and then gif for distraction */
}
img {
max-width: 100%;
height: auto;
border-radius: 10px;
}
</style>
<div class="restricted-message">
<p>This blog is private.</p>
<p><a href=";>.</a></span></p> /* link to true blog */
<div class="gif-container">
<img src="gif.gif" alt="Private Page GIF">
</div>
</div>
The HTML for my normal blog is much longer (ca. 2000 lines). Consider a normal custom Tumblr HTML.
本文标签:
版权声明:本文标题:javascript - Conditionally activate HTML for restricted page or for normal Tumblr blog based on current URL - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736686888a1947714.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论