greenlight/app/views/main/index.html.erb

53 lines
1.2 KiB
Plaintext

<div class="container">
<% if current_user %>
<h1 id="user-text" class="display-3 text-center text-primary mt-9"><%= "Welcome, #{current_user.firstname}." %></h1>
<% else %>
<h1 id="main-text" class="display-3 text-center text-primary mt-9">Teach Students Online.</h1>
<%= render "shared/modals/video_modal" %>
<% end %>
<hr class="small-rule">
<% if current_user %>
<div class="row">
<% current_user.rooms.each do |room| %>
<div class="col-4">
<%= link_to room do %>
<%= render "shared/components/room_block", room: room %>
<% end %>
</div>
<% end %>
</div>
<br>
<% else %>
<%= render "shared/features" %>
<% end %>
</div>
<script>
$(window).on('load',function(){
$('#welcomeModal').modal('show');
});
textOptions = [
"Start your own Meeting.",
"Collaborate with Friends.",
"Connect in Real-Time.",
"Teach Students Online.",
]
textOpt = 0
var changeText = function(){
$('#main-text').text(textOptions[textOpt]);
$('#main-text').fadeIn(1000)
textOpt++;
if (textOpt > textOptions.length) { textOpt = 0; }
}
setInterval(function(){
$('#main-text').fadeOut(1000, changeText)
}, 7000);
</script>