-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
259 additions
and
1 deletion.
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
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,52 @@ | ||
defmodule Storybook.Components.Frame do | ||
use PhoenixStorybook.Story, :component | ||
|
||
@ratios [ | ||
{1, 1}, | ||
{3, 2}, | ||
{2, 3}, | ||
{4, 3}, | ||
{3, 4}, | ||
{5, 4}, | ||
{4, 5}, | ||
{16, 9}, | ||
{9, 16} | ||
] | ||
|
||
def function, do: &Doggo.frame/1 | ||
|
||
def variations do | ||
[ | ||
%VariationGroup{ | ||
id: :ratios, | ||
variations: | ||
for {n, d} = ratio <- @ratios do | ||
%Variation{ | ||
id: :"#{n}_to_#{d}", | ||
attributes: %{ratio: ratio}, | ||
slots: [ | ||
""" | ||
<img | ||
src="https://github.com/woylie/doggo/blob/main/dog_poncho.jpg?raw=true" | ||
alt="A dog wearing a colorful poncho walks down a fashion show runway." | ||
/> | ||
""" | ||
] | ||
} | ||
end | ||
}, | ||
%Variation{ | ||
id: :circle, | ||
attributes: %{circle: true}, | ||
slots: [ | ||
""" | ||
<img | ||
src="https://github.com/woylie/doggo/blob/main/dog_poncho.jpg?raw=true" | ||
alt="A dog wearing a colorful poncho walks down a fashion show runway." | ||
/> | ||
""" | ||
] | ||
} | ||
] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
defmodule Storybook.Components.Image do | ||
use PhoenixStorybook.Story, :component | ||
|
||
def function, do: &Doggo.image/1 | ||
|
||
def variations do | ||
[ | ||
%Variation{ | ||
id: :default, | ||
attributes: %{ | ||
src: | ||
"https://github.com/woylie/doggo/blob/main/dog_poncho.jpg?raw=true", | ||
alt: | ||
"A dog wearing a colorful poncho walks down a fashion show runway.", | ||
ratio: {16, 9} | ||
} | ||
}, | ||
%Variation{ | ||
id: :caption, | ||
attributes: %{ | ||
src: | ||
"https://github.com/woylie/doggo/blob/main/dog_poncho.jpg?raw=true", | ||
alt: | ||
"A dog wearing a colorful poncho walks down a fashion show runway.", | ||
ratio: {16, 9} | ||
}, | ||
slots: [ | ||
""" | ||
<:caption>Spotlight on canine couture: A dog fashion show where four-legged models dazzle the runway with the latest in pet apparel.</:caption> | ||
""" | ||
] | ||
} | ||
] | ||
end | ||
end |