Skip to content

Commit

Permalink
adho event alert
Browse files Browse the repository at this point in the history
  • Loading branch information
zipper3030 committed Apr 23, 2024
1 parent a0b6579 commit cea074f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
33 changes: 32 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
bodyClass: home
---


<section id = "meet">
<div class="container">
<div class="row justify-content-center">
Expand Down Expand Up @@ -64,9 +65,21 @@ <h2 class="feature-title">{{ feature.title }}</h2>
</div>
</section>

<!-- Rotate the dandelions!-->
<div id="alert" class="alert">
<span class="closebtn" onclick="dismissAlert()">&times;</span>
<strong>Join Us</strong> @ the ADHO Digital Humanities Conference 2024! Click <a href="https://dh2024.adho.org/program/workshops/">here</a> for more information.
</div>


<!-- Rotate the dandelions and scroll the alert-->
<script>

function dismissAlert() {
document.getElementById("alert").style.display = "none";
}

document.addEventListener("DOMContentLoaded", function () {
document.getElementById("alert").style.display = "block";
const featureIcons = document.querySelectorAll(".feature-image");
const usedRotationAngles = new Set(); // Keep track of used dandelion angles

Expand All @@ -80,6 +93,24 @@ <h2 class="feature-title">{{ feature.title }}</h2>
usedRotationAngles.add(rotationAngle);
icon.style.transform = `rotate(${rotationAngle}deg)`;
});

// Function to handle alert scrolling
window.addEventListener('scroll', function() {
var alertElement = document.getElementById("alert");
var windowHeight = window.innerHeight;
var bodyHeight = document.body.scrollHeight;
var scrollPosition = window.scrollY || window.pageYOffset;

//place the alert at the bottom of the viewport
if (scrollPosition > windowHeight) {
alertElement.style.position = "fixed";
alertElement.style.bottom = "0";
alertElement.style.left = "0";
alertElement.style.width = "50%";
} else {
alertElement.style.position = "relative";
}
});
});
</script>
{% endif %}
27 changes: 27 additions & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,33 @@ ul li {
}
}

// event alert
.alert {
background-color: rgb(237, 219, 122);
font-family: $font-family-base;
color: black;
position: fixed;
bottom: 0;
left: 0;
z-index: 9999;
margin-left: 25%;
}

.closebtn {
//margin-left: 15px;
color: black;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}

.closebtn:hover {
color: black;
}

// meet DHRIFT section
#meet {
margin-top: 50px;
Expand Down

0 comments on commit cea074f

Please sign in to comment.