Skip to content

Commit

Permalink
fixed serviceworker caching bug; enabled dark mode; enabled screen ke…
Browse files Browse the repository at this point in the history
…ep-on while app is active
  • Loading branch information
addcninblue committed Mar 31, 2021
1 parent 1dad3bc commit 9cd6f48
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 108 deletions.
Binary file added assets/static/images/pomodoro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ module.exports = {
extend: {},
},
plugins: [],
darkMode: 'media',
}
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Config
# watchers to your application. For example, we use it
# with webpack to recompile .js and .css sources.
config :pomodoro, PomodoroWeb.Endpoint,
http: [port: 10101],
http: [port: 4001],
debug_errors: true,
code_reloader: true,
check_origin: false,
Expand Down
4 changes: 2 additions & 2 deletions lib/pomodoro_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ defmodule PomodoroWeb.Endpoint do
plug Plug.Static,
at: "/",
from: :pomodoro,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
gzip: true,
only: ~w(css fonts images js favicon.ico robots.txt manifest.webmanifest sw.js)

# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
Expand Down
7 changes: 4 additions & 3 deletions lib/pomodoro_web/live/page_live.html.leex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<nav role="navigation">
<div class="relative flex items-center justify-between">
<div class="absolute inset-y-10 left-0 flex items-center">
<span class="px-10 py-2 text-2xl font-medium font-mono">pomodoro.addcnin.blue</span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono hidden sm:flex">pomodoro.addcnin.blue</span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono sm:hidden">pomodoro</span>
</div>
<div class="absolute inset-y-10 right-0 flex items-center">
<span class="px-10 py-2 text-2xl font-medium font-mono"><%= link "help", to: Routes.help_path(@socket, :index) %> </span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono"><%= link "help", to: Routes.help_path(@socket, :index) %> </span>
</div>
<%# <%= if function_exported?(Routes, :live_dashboard_path, 2) do %1> %>
<%# <li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@socket, :home) %1></li> %>
Expand All @@ -21,7 +22,7 @@
<div class="flex h-screen">
<div class="m-auto">
<form phx-submit="search">
<input class="font-medium text-xl font-mono text-center" type="text" name="q" value="<%= @room %>" placeholder="Create Room" autocomplete="off"/>
<input class="text-black dark:text-white bg-white dark:bg-black font-medium text-xl font-mono text-center" type="text" name="q" value="<%= @room %>" placeholder="Create Room" autocomplete="off"/>
</form>
</div>
</div>
39 changes: 0 additions & 39 deletions lib/pomodoro_web/live/page_live_builtin.ex

This file was deleted.

48 changes: 0 additions & 48 deletions lib/pomodoro_web/live/page_live_builtin.html.leex

This file was deleted.

27 changes: 14 additions & 13 deletions lib/pomodoro_web/live/room_live.html.leex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<nav role="navigation">
<div class="relative flex items-center justify-between">
<div class="absolute inset-y-10 left-0 flex items-center">
<span class="px-10 py-2 text-2xl font-medium font-mono">pomodoro.addcnin.blue/room/<%= @id %></span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono hidden sm:flex">pomodoro.addcnin.blue/room/<%= @id %></span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono sm:hidden">pomodoro/<%= @id %></span>
</div>
<div class="absolute inset-y-10 right-0 flex items-center">
<span class="px-10 py-2 text-2xl font-medium font-mono"><%= link "help", to: Routes.help_path(@socket, :index) %> </span>
<span class="text-black dark:text-white px-10 py-2 text-2xl font-medium font-mono"><%= link "help", to: Routes.help_path(@socket, :index) %> </span>
</div>
<%# <%= if function_exported?(Routes, :live_dashboard_path, 2) do %1> %>
<%# <li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@socket, :home) %1></li> %>
Expand All @@ -22,20 +23,20 @@
<div class="m-auto text-center">
<%= case @state do %>
<% :start -> %>
<div class="text-5xl font-medium font-mono py-4 underline text-gray-600"><button>start</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="time-55">55:00</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="time-25">25:00</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="time-20">20:00</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="time-10">10:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4 underline text-gray-600"><button>start</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="time-55">55:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="time-25">25:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="time-20">20:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="time-10">10:00</button></div>
<% state when state in [:timer, :timer_paused] -> %>
<div class="text-5xl font-medium font-mono"> <%= @time_remaining %> </div>
<div class="text-black dark:text-white text-5xl font-medium font-mono"> <%= @time_remaining %> </div>
<% :start_break -> %>
<div class="text-5xl font-medium font-mono py-4 underline text-gray-600"><button>break</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="break-15">15:00</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="break-10">10:00</button></div>
<div class="text-5xl font-medium font-mono py-4"><button phx-click="break-5">05:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4 underline text-gray-600"><button>break</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="break-15">15:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="break-10">10:00</button></div>
<div class="text-black dark:text-white text-5xl font-medium font-mono py-4"><button phx-click="break-5">05:00</button></div>
<% state when state in [:break_timer, :break_timer_paused] -> %>
<div class="text-5xl font-medium font-mono"> <%= @time_remaining %> </div>
<div class="text-black dark:text-white text-5xl font-medium font-mono"> <%= @time_remaining %> </div>
<% end %>
</div>
</div>
7 changes: 5 additions & 2 deletions lib/pomodoro_web/templates/layout/root.html.leex
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<%= csrf_meta_tag() %>
<%= live_title_tag assigns[:page_title] || "Pomodoro", suffix: " · Phoenix Framework" %>
<%= live_title_tag assigns[:page_title] || "Pomodoro"%>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/index.js") %>"></script>
<%# <link rel="manifest" href="<%= Routes.static_path(@conn, "/manifest.webmanifest") %1>" /> %>
<link rel="manifest" href="/manifest.webmanifest" />
</head>
<body>
<body class="bg-white dark:bg-black">
<%# <header> %>
<%# <section class="container"> %>
<%# <nav role="navigation"> %>
Expand Down

0 comments on commit 9cd6f48

Please sign in to comment.