{% block stylesheet %}
<style>
/* バナー全体のスタイル */
.float_btn {
width: 200px;
height: 200px;
position: fixed;
right: 25px;
bottom: 25px;
z-index: 500;
}
.float_btn img {
width: 200px;
}
/* クローズボタンのスタイル */
.close-btn {
position: absolute;
top: -10px;
right: -10px;
background-color: #000000; /* 赤い背景色 */
color: #ffffff; /* 白い文字 */
border: none;
border-radius: 50%;
width: 30px;
height: 30px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.close-btn:hover {
background-color: #000000; /* ホバー時の色 */
}
</style>
{% endblock %}
{% block javascript %}
<script>
document.addEventListener("DOMContentLoaded", function () {
const banner = document.getElementById("banner");
// セッションストレージに閉じた情報があるか確認
const isClosed = sessionStorage.getItem("bannerClosed");
// フラグが無ければ(未閉じ状態なら)表示する
if (isClosed !== "true") {
banner.style.display = "block";
}
});
function closeBanner() {
const banner = document.getElementById('banner');
banner.style.display = 'none';
sessionStorage.setItem("bannerClosed", "true");
}
</script>
{% endblock %}
<div class="float_btn" id="banner" style="display: none;">
<a href="{{ url('user_data', { 'route': '1yen_2025_lp' }) }}">
<img src="{{ asset('assets/img/common/float_banner_1yen.png', 'user_data') }}" alt="1円キャンペーン" style="">
</a>
<button class="close-btn" onclick="closeBanner()">×</button>
</div>