-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
19cfd09
commit 5f86229
Showing
10 changed files
with
1,575 additions
and
928 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
<style> | ||
svg rect, | ||
svg ellipse, | ||
svg path { | ||
transition: transform 330ms ease-in-out | ||
} | ||
svg rect:hover, | ||
svg ellipse:hover { | ||
transform: translateX(5px); | ||
} | ||
|
||
svg path:hover { | ||
transform: translateX(-5px); | ||
} | ||
</style> |
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,41 @@ | ||
= SVG Images | ||
:imagesdir: images/ | ||
:docinfo: private | ||
|
||
== Options for SVG images | ||
|
||
When the image target is an SVG, the `options` attribute (often abbreviated as `opts`) on the macro accepts one of the following values to control how the SVG is referenced: | ||
|
||
* _none_ (default) | ||
* `interactive` | ||
* `inline` | ||
|
||
The following slide demonstrates the impact these options have. | ||
|
||
== None (default) | ||
|
||
Observe that the SVG does not respond to the hover event. | ||
|
||
[literal] | ||
image::sample.svg[Static,300] | ||
|
||
image::sample.svg[Static,300] | ||
|
||
== Interactive | ||
|
||
Observe that the color changes when hovering over the SVG. | ||
|
||
[literal] | ||
image::sample.svg[Interactive,300,opts=interactive] | ||
|
||
image::sample.svg[Interactive,300,opts=interactive] | ||
|
||
== Inline | ||
|
||
Observe that the color changes when hovering over the SVG. | ||
The SVG also inherits CSS from the document stylesheets. | ||
|
||
[literal] | ||
image::sample.svg[Embedded,300,opts=inline] | ||
|
||
image::sample.svg[Embedded,300,opts=inline] |
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 +1,6 @@ | ||
- width = (attr? :width) ? (attr :width) : nil | ||
- height = (attr? :height) ? (attr :height) : nil | ||
|
||
/ When the stretch class is present, block images will take the most space | ||
/ they can take. Setting width and height can override that. | ||
/ We pinned the 100% to height to avoid aspect ratio breakage and since | ||
/ widescreen monitors are the most popular, chances are that height will | ||
/ be the biggest constraint | ||
- if (has_role? 'stretch') && !((attr? :width) || (attr? :height)) | ||
- height = "100%" | ||
|
||
- unless attributes[1] == 'background' || attributes[1] == 'canvas' | ||
- inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ') | ||
= html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes))) | ||
- if attr? :link | ||
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview) | ||
img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil) | ||
- else | ||
img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil) | ||
= convert_image | ||
- if title? | ||
.title=captioned_title |
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,21 +1,2 @@ | ||
= html_tag('span', { :class => [@type, role, ('fragment' if (option? :step) || (attr? 'step'))], :style => ("float: #{attr :float}" if attr? :float) }.merge(data_attrs(@attributes))) | ||
- if @type == 'icon' && (@document.attr? :icons, 'font') | ||
- style_class = [(attr :set, 'fa'), "fa-#{@target}", ("fa-#{attr :size}" if attr? :size), ("fa-rotate-#{attr :rotate}" if attr? :rotate), ("fa-flip-#{attr :flip}" if attr? :flip)] | ||
- if attr? :link | ||
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview) | ||
i class=style_class title=(attr :title) | ||
- else | ||
i class=style_class title=(attr :title) | ||
- elsif @type == 'icon' && !(@document.attr? :icons) | ||
- if attr? :link | ||
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview) | ||
|[#{attr :alt}] | ||
- else | ||
|[#{attr :alt}] | ||
- else | ||
- src = (@type == 'icon' ? (icon_uri @target) : (image_uri @target)) | ||
- if attr? :link | ||
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview) | ||
img src=src alt=(attr :alt) width=(attr :width) height=(attr :height) title=(attr :title) | ||
- else | ||
img src=src alt=(attr :alt) width=(attr :width) height=(attr :height) title=(attr :title) | ||
= convert_inline_image |
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.