mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 13:29:56 +00:00
250e57cd79
The implementation of the palette preview is much less elegant like this, but it does work
71 lines
3.2 KiB
Plaintext
71 lines
3.2 KiB
Plaintext
title: $:/snippets/currpalettepreview
|
|
|
|
\whitespace trim
|
|
|
|
\procedure colour(name)
|
|
\whitespace trim
|
|
<$transclude $tiddler=<<currentTiddler>> $index=<<name>>>
|
|
<$transclude $tiddler="$:/palettes/Vanilla" $index=<<name>>>
|
|
<$transclude $tiddler={{{ [[$:/config/DefaultColourMappings/]addsuffix<name>] }}}/>
|
|
</$transclude>
|
|
</$transclude>
|
|
\end colour
|
|
|
|
\widget $colour.div(class,styleName,styleColour)
|
|
<%if [<styleName>!match[]] %>
|
|
<$wikify name="colour-result" text={{{ [[<<colour ]addsuffix<styleColour>addsuffix[>>]] }}} mode="inline">
|
|
<div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}>
|
|
<$slot $name="ts-raw"/>
|
|
</div>
|
|
</$wikify>
|
|
<%else%>
|
|
<div class=<<class>>>
|
|
<$slot $name="ts-raw"/>
|
|
</div>
|
|
<%endif%>
|
|
\end $colour.div
|
|
|
|
\procedure palette-preview-thumbnail-tiddler(title)
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler" styleName="background-color" styleColour="tiddler-background">
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler-header">
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler-title" styleName="color" styleColour="tiddler-title-foreground">
|
|
<$text text=<<title>>/>
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler-toolbar" styleName="fill" styleColour="tiddler-controls-foreground">
|
|
{{$:/core/images/down-arrow}}
|
|
{{$:/core/images/edit-button}}
|
|
{{$:/core/images/close-button}}
|
|
</$colour.div>
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler-subtitle" styleName="color" styleColour="tiddler-subtitle-foreground">
|
|
Motovun Jack
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-tiddler-body" styleName="color" styleColour="foreground">
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non arcu ultricies, egestas odio tempus, vestibulum ipsum. Praesent diam lorem, elementum in venenatis eget, tincidunt quis lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam efficitur velit tortor, sit amet tristique felis viverra sit amet. Nullam posuere facilisis purus sed consectetur. Integer vel elit euismod, posuere ligula et, dictum tellus. Donec in odio diam. Sed metus magna, placerat at ligula et, imperdiet sagittis ex.
|
|
</$colour.div>
|
|
</$colour.div>
|
|
\end palette-preview-thumbnail-tiddler
|
|
|
|
\procedure palette-preview-thumbnail()
|
|
<$colour.div class="tc-palette-preview-thumbnail" styleName="background-color" styleColour="page-background">
|
|
<$colour.div class="tc-palette-preview-thumbnail-story">
|
|
<<palette-preview-thumbnail-tiddler "HelloThere">>
|
|
<<palette-preview-thumbnail-tiddler "Getting Started">>
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-sidebar" styleName="color" styleColour="sidebar-foreground">
|
|
<$colour.div class="tc-palette-preview-thumbnail-sidebar-title">
|
|
~TiddlyWiki
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-sidebar-subtitle">
|
|
a non-linear personal web notebook
|
|
</$colour.div>
|
|
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search" styleName="background-color" styleColour="background">
|
|
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search-box">
|
|
</$colour.div>
|
|
</$colour.div>
|
|
</$colour.div>
|
|
</$colour.div>
|
|
\end palette-preview-thumbnail
|
|
|
|
<<palette-preview-thumbnail>>
|