Skip to content

Commit 988ed3c

Browse files
authored
RmJQuery: remove JQuery fade usage (#1448)
1 parent 117c34a commit 988ed3c

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

app/views/tutorials/index.html.erb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,21 @@
2929
<h1><%= t('tutorial.title') %> <span class="orange"><%= t('tutorial.simple') %></span>.</h1>
3030
<h2><%= t('tutorial.subtitle') %></h2>
3131
<hr />
32-
<p id="cta"><%= t('tutorial.description') %></p>
32+
<p id="cta" data-ready="<%= t('tutorial.ready') %>"><%= t('tutorial.description') %></p>
3333
<hr />
3434
<div class="center">
3535
<a href="/news" id="start" style="display: none" class="btn btn-primary"><%= t('tutorial.start') %></a>
3636
</div>
3737
</div>
3838

3939
<script type="text/javascript">
40-
$(document).ready(function() {
41-
setTimeout(function() {
42-
$("#cta").fadeOut(function() {
43-
$(this).html("<%= t('tutorial.ready') %>").fadeIn();
44-
$("#start").fadeIn();
45-
});
40+
document.addEventListener("DOMContentLoaded", () => {
41+
setTimeout(() => {
42+
const cta = document.getElementById("cta");
43+
const start = document.getElementById("start");
44+
45+
cta.textContent = cta.dataset.ready;
46+
start.style.display = "";
4647
}, 10 * 1000);
4748
});
4849
</script>

0 commit comments

Comments
 (0)