-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into sound-effect
- Loading branch information
Showing
30 changed files
with
806 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
# Used by "mix format" | ||
[ | ||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] | ||
plugins: [TailwindFormatter, Phoenix.LiveView.HTMLFormatter], | ||
inputs: [ | ||
"{mix,.formatter}.exs", | ||
"{config,lib,test}/**/*.{ex,exs}", | ||
"*.{heex,ex,exs}", | ||
"priv/*/seeds.exs", | ||
"{config,lib,test}/**/*.{heex,ex,exs}" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
defmodule BloomSiteWeb.Components.Avatar do | ||
use Phoenix.Component | ||
|
||
@doc """ | ||
Avatar component using https://avatars.dicebear.com styles. | ||
Can be overridden by an image URL. | ||
Styles available: | ||
Adventurer | ||
Adventurer Neutral | ||
Avataaars | ||
Avataaars Neutral | ||
Big Ears | ||
Big Ears Neutral | ||
Big Smile | ||
Bottts | ||
Bottts Neutral | ||
Croodles | ||
Croodles Neutral | ||
Fun Emoji | ||
Icons | ||
Identicon | ||
Initials | ||
Lorelei | ||
Lorelei Neutral | ||
Micah | ||
Miniavs | ||
Notionists | ||
Notionists Neutral | ||
Open Peeps | ||
Personas | ||
Pixel Art | ||
Pixel Art Neutral | ||
Rings | ||
Shapes | ||
Thumbs | ||
""" | ||
|
||
attr(:name, :string, required: true, doc: "Name for avatar and seed for dicebear API") | ||
attr(:style, :string, default: "miniavs", doc: "Style for dicebear API") | ||
attr(:img_src, :string, required: false, doc: "Image URL - overrides dicebear API") | ||
attr(:class, :string, default: "", doc: "CSS class for parent div") | ||
attr(:rest, :global) | ||
|
||
def avatar(assigns) do | ||
image = | ||
assigns[:img_src] || | ||
"https://api.dicebear.com/8.x/#{assigns[:style]}/svg?seed=#{assigns[:name]}" | ||
|
||
~H""" | ||
<div class={["flex items-center w-12 h-12", @class]} {@rest}> | ||
<img | ||
src={image} | ||
alt={"#{@name} avatar"} | ||
class="rounded-lg" | ||
/> | ||
</div> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
defmodule BloomSiteWeb.Components.Card do | ||
use Phoenix.Component | ||
|
||
@moduledoc """ | ||
@doc """ | ||
Card component | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
defmodule BloomSiteWeb.Components.Hero do | ||
use Phoenix.Component | ||
|
||
@moduledoc """ | ||
@doc """ | ||
Hero component | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.