Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/claper_web/live/event_live/presenter.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@
<%= if @current_poll do %>
<div
id="poll"
class={"#{if @state.poll_visible, do: "opacity-100", else: "opacity-0 pointer-events-none"} h-full w-full flex flex-col justify-center bg-black/90 absolute z-30 left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2 p-10 transition-opacity"}
class={"#{if @state.poll_visible, do: "opacity-100", else: "opacity-0 pointer-events-none"} h-full w-full flex flex-col justify-center-safe overflow-y-auto bg-black/90 absolute z-30 left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2 p-10 transition-opacity"}
>
<div class="w-full md:w-1/2 mx-auto h-full">
<div class="w-full md:w-1/2 mx-auto min-h-full pb-10">
<p class={"#{if @iframe, do: "text-xl mb-12", else: "text-5xl mb-24"} text-white font-bold text-center"}>
{@current_poll.title}
</p>

<div class={"#{if @iframe, do: "space-y-5", else: "space-y-8"} flex flex-col"}>
<%= if (length @current_poll.poll_opts) > 0 do %>
<%= for opt <- @current_poll.poll_opts do %>
<%= for opt <- Enum.sort_by(@current_poll.poll_opts, & &1.vote_count, :desc) do %>
<div class={"#{if @iframe, do: "py-1", else: "py-4"} bg-gray-500 px-6 rounded-3xl flex justify-between items-center relative text-white"}>
<div
style={"width: #{opt.percentage}%;"}
Expand Down
49 changes: 37 additions & 12 deletions lib/claper_web/live/event_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@
<% captions_visible? =
@transcription_config && @transcription_config.enabled &&
@transcription_config.visibility in ["both", "attendee"] %>
<%!-- Without chat, the interaction takes the space of the message feed --%>
<% expand? = interaction_mode? && !@state.chat_enabled %>
<% reactions? = @state.message_reaction_enabled %>
<% interaction_box_class = [
"overflow-y-auto overscroll-contain p-3",
!expand? && "max-h-[40dvh]",
expand? && "h-full",
expand? && !reactions? && "pb-18"
] %>
<div class="h-[100dvh] overflow-hidden bg-black lg:bg-primary-700">
<main
id="attendee-room"
class={[
"relative mx-auto grid h-[100dvh] w-full max-w-lg overflow-hidden bg-black font-display shadow-2xl",
focus_content? && captions_visible? &&
!expand? && focus_content? && captions_visible? &&
"grid-rows-[auto_auto_auto_minmax(0,1fr)]",
focus_content? != captions_visible? && "grid-rows-[auto_auto_minmax(0,1fr)]",
!focus_content? && !captions_visible? && "grid-rows-[auto_minmax(0,1fr)]"
!expand? && focus_content? != captions_visible? && "grid-rows-[auto_auto_minmax(0,1fr)]",
!focus_content? && !captions_visible? && "grid-rows-[auto_minmax(0,1fr)]",
expand? && captions_visible? && reactions? && "grid-rows-[auto_minmax(0,1fr)_auto_9rem]",
expand? && captions_visible? && !reactions? && "grid-rows-[auto_minmax(0,1fr)_auto]",
expand? && !captions_visible? && reactions? && "grid-rows-[auto_minmax(0,1fr)_9rem]",
expand? && !captions_visible? && !reactions? && "grid-rows-[auto_minmax(0,1fr)]"
]}
>
<div
Expand Down Expand Up @@ -143,8 +156,9 @@
data-collapse-key={"focus-slot:#{@event.uuid}"}
data-interaction-mode={to_string(interaction_mode?)}
class={[
"relative z-10 min-h-0 overflow-hidden border-y border-white/10 bg-gray-950 transition-[height] duration-300",
interaction_mode? && "h-auto max-h-[40dvh]",
"relative z-10 min-h-0 overflow-hidden border-t border-white/10 bg-gray-950 transition-[height] duration-300",
!expand? && "border-b",
interaction_mode? && !expand? && "h-auto max-h-[40dvh]",
!interaction_mode? && "h-[40dvh] min-h-40 max-h-[26rem]"
]}
>
Expand All @@ -157,7 +171,7 @@

<%= case @current_interaction do %>
<% %Claper.Polls.Poll{} -> %>
<div class="max-h-[40dvh] overflow-y-auto overscroll-contain p-3">
<div class={interaction_box_class}>
<.live_component
module={ClaperWeb.EventLive.PollComponent}
id={"#{@current_interaction.id}-poll"}
Expand All @@ -172,7 +186,7 @@
/>
</div>
<% %Claper.Forms.Form{} -> %>
<div class="max-h-[40dvh] overflow-y-auto overscroll-contain p-3">
<div class={interaction_box_class}>
<.live_component
module={ClaperWeb.EventLive.FormComponent}
id={"#{@current_interaction.id}-form"}
Expand All @@ -186,7 +200,7 @@
/>
</div>
<% %Claper.Quizzes.Quiz{} -> %>
<div class="max-h-[40dvh] overflow-y-auto overscroll-contain p-3">
<div class={interaction_box_class}>
<.live_component
module={ClaperWeb.EventLive.QuizComponent}
id={"#{@current_interaction.id}-quiz"}
Expand All @@ -202,7 +216,7 @@
/>
</div>
<% %Claper.WordClouds.WordCloud{} -> %>
<div class="max-h-[40dvh] overflow-y-auto overscroll-contain p-3">
<div class={interaction_box_class}>
<.live_component
module={ClaperWeb.EventLive.WordCloudComponent}
id={"#{@current_interaction.id}-word-cloud"}
Expand All @@ -212,7 +226,7 @@
/>
</div>
<% %Claper.Embeds.Embed{attendee_visibility: true} -> %>
<div class="max-h-[40dvh] overflow-y-auto overscroll-contain p-3">
<div class={interaction_box_class}>
<.live_component
id={"#{@current_interaction.id}-embed"}
module={ClaperWeb.EventLive.EmbedComponent}
Expand Down Expand Up @@ -356,11 +370,18 @@
</div>
</section>

<section id="chat-panel" class="relative min-h-0 overflow-visible bg-black">
<section
id="chat-panel"
class={[
"relative min-h-0 overflow-visible bg-black",
expand? && !reactions? && "hidden"
]}
>
<div
id="chat-feed"
class={[
"h-full space-y-3 overflow-y-auto overscroll-contain px-4 pt-4",
expand? && "hidden",
@state.message_reaction_enabled && "pb-40",
!@state.message_reaction_enabled && "pb-24"
]}
Expand Down Expand Up @@ -406,7 +427,11 @@
id="reacts"
phx-hook="GlobalReacts"
data-class-name="h-12 w-12"
class="pointer-events-none absolute inset-0 z-10 overflow-hidden"
class={[
"pointer-events-none absolute inset-x-0 bottom-0 z-10 overflow-hidden",
!expand? && "top-0",
expand? && "h-[100dvh]"
]}
phx-update="ignore"
>
</div>
Expand Down
Loading