Skip to content

Instantly share code, notes, and snippets.

View eshans's full-sized avatar

Eric Shans eshans

View GitHub Profile
@eshans
eshans / app.css
Created January 3, 2024 18:41 — forked from alvises/app.css
Phoenix LiveView Gallery with Slideshow
/* to add to assets/css/app.css */
.thumb-selected {
border: 4px solid #0069d9;
}
.thumb-unselected {
opacity: 0.5;
}
@eshans
eshans / 1_searchbar_live.ex
Created December 1, 2023 21:37 — forked from caspg/1_searchbar_live.ex
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end