├── .gitignore
├── screenshots
├── dark.png
├── light.png
└── tan.png
├── themes
└── cdr
│ └── captivate
│ ├── defaults
│ ├── palette.tid
│ ├── layout.tid
│ ├── vanilla-themetweaks.tid
│ ├── DefaultCaptivateTan.tid
│ ├── DefaultCaptivateDark.tid
│ └── DefaultCaptivateLight.tid
│ ├── ui
│ ├── SideBarDefault.tid
│ ├── AdvancedSearch
│ │ ├── Filter.tid
│ │ ├── AdvancedSearch.tid
│ │ ├── DefaultSearchResultList.tid
│ │ └── System.tid
│ ├── BottomBar.tid
│ ├── FabButtons.tid
│ ├── TopBarMenu.tid
│ ├── TopBar.tid
│ ├── PageLayout.tid
│ ├── SideBar.tid
│ └── TopBarSearch.tid
│ ├── images
│ ├── down-arrow.tid
│ ├── close.tid
│ └── edit.tid
│ ├── settings.multids
│ ├── plugin.info
│ ├── palettes
│ ├── DefaultMappings.multids
│ ├── CaptivateTan.tid
│ ├── CaptivateLight.tid
│ └── CaptivateDark.tid
│ ├── readme.tid
│ ├── css
│ ├── highlight-js-dark.tid
│ ├── base-layout.tid
│ └── base.tid
│ └── tweaks
│ ├── themetweaks.tid
│ └── colors.tid
├── wiki
├── tiddlers
│ ├── default-theme.tid
│ ├── DefaultTiddlers.tid
│ ├── config-home-btn.tid
│ ├── $__SiteTitle.tid
│ ├── $__SiteSubtitle.tid
│ ├── colorschemes-black.tid
│ ├── colorschemes-white.tid
│ └── Intro.tid
└── tiddlywiki.info
├── plugins
└── cdr
│ └── colorlab
│ ├── plugin.info
│ ├── demo
│ ├── styles.css.tid
│ └── lightness.tid
│ ├── color-alpha.js
│ ├── color-over.js
│ ├── color-deviate.js
│ ├── color-eval.js
│ ├── color-mix.js
│ ├── color-mute.js
│ ├── color-autocontrast.js
│ ├── color-lightness.js
│ ├── contrastcolour.js
│ ├── twutils.js
│ ├── color-filters.js
│ ├── action-wikifypalette.js
│ └── lib
│ ├── parse.js
│ ├── color.js
│ └── convert.js
├── .github
└── workflows
│ └── build.yml
├── package.json
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | **/output/
2 | /node_modules/
--------------------------------------------------------------------------------
/screenshots/dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdruan/tw5-captivate/HEAD/screenshots/dark.png
--------------------------------------------------------------------------------
/screenshots/light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdruan/tw5-captivate/HEAD/screenshots/light.png
--------------------------------------------------------------------------------
/screenshots/tan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdruan/tw5-captivate/HEAD/screenshots/tan.png
--------------------------------------------------------------------------------
/themes/cdr/captivate/defaults/palette.tid:
--------------------------------------------------------------------------------
1 | title: $:/palette
2 |
3 | $:/palettes/CaptivateLight
--------------------------------------------------------------------------------
/themes/cdr/captivate/defaults/layout.tid:
--------------------------------------------------------------------------------
1 | title: $:/layout
2 |
3 | $:/themes/cdr/captivate/ui/PageLayout
--------------------------------------------------------------------------------
/wiki/tiddlers/default-theme.tid:
--------------------------------------------------------------------------------
1 | title: $:/theme
2 | type: text/vnd.tiddlywiki
3 |
4 | $:/themes/cdr/captivate
--------------------------------------------------------------------------------
/wiki/tiddlers/DefaultTiddlers.tid:
--------------------------------------------------------------------------------
1 | title: $:/DefaultTiddlers
2 | type: text/vnd.tiddlywiki
3 |
4 | [[Captivate Theme Demo]]
5 |
--------------------------------------------------------------------------------
/wiki/tiddlers/config-home-btn.tid:
--------------------------------------------------------------------------------
1 | title: $:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home
2 | type: text/vnd.tiddlywiki
3 |
4 | show
--------------------------------------------------------------------------------
/wiki/tiddlers/$__SiteTitle.tid:
--------------------------------------------------------------------------------
1 | created: 20220122124515594
2 | modified: 20220122124518366
3 | title: $:/SiteTitle
4 | type: text/vnd.tiddlywiki
5 |
6 | Captivate Theme
--------------------------------------------------------------------------------
/wiki/tiddlers/$__SiteSubtitle.tid:
--------------------------------------------------------------------------------
1 | created: 20220122124527539
2 | modified: 20220122125941360
3 | title: $:/SiteSubtitle
4 | type: text/vnd.tiddlywiki
5 |
6 | gives your wiki a pop of color
--------------------------------------------------------------------------------
/plugins/cdr/colorlab/plugin.info:
--------------------------------------------------------------------------------
1 | {
2 | "title": "$:/plugins/cdr/colorlab",
3 | "name": "Color Library",
4 | "description": "Color manipulation library",
5 | "author": "cdruan",
6 | "list": "",
7 | "version": "0.2.0"
8 | }
--------------------------------------------------------------------------------
/wiki/tiddlers/colorschemes-black.tid:
--------------------------------------------------------------------------------
1 | title: $:/snippets/colorschemes/black
2 | type: application/x-tiddler-dictionary
3 | name: Black (testing)
4 | tags: $:/tags/ColorScheme
5 |
6 | color1: #000000
7 | color2: #000000
8 | color3: #000000
9 |
--------------------------------------------------------------------------------
/wiki/tiddlers/colorschemes-white.tid:
--------------------------------------------------------------------------------
1 | title: $:/snippets/colorschemes/white
2 | type: application/x-tiddler-dictionary
3 | name: White (testing)
4 | tags: $:/tags/ColorScheme
5 |
6 | color1: #ffffff
7 | color2: #ffffff
8 | color3: #ffffff
9 |
--------------------------------------------------------------------------------
/themes/cdr/captivate/ui/SideBarDefault.tid:
--------------------------------------------------------------------------------
1 | title: $:/themes/cdr/captivate/ui/SideBar/default
2 | description: determines default sidebar setting (open or closed)
3 |
4 | [{$:/info/browser/screen/width}] [{$:/info/browser/screen/height}] +[minall[]compare:number:gt[1024]then[yes]else[no]]
--------------------------------------------------------------------------------
/themes/cdr/captivate/defaults/vanilla-themetweaks.tid:
--------------------------------------------------------------------------------
1 | caption: {{$:/language/ThemeTweaks/ThemeTweaks}}
2 | title: $:/themes/tiddlywiki/vanilla/themetweaks
3 | type: text/vnd.tiddlywiki
4 |
5 | Overwritten by $:/themes/cdr/captivate so that the Vanilla theme tweaks do not appear in the control panel.
--------------------------------------------------------------------------------
/themes/cdr/captivate/ui/AdvancedSearch/Filter.tid:
--------------------------------------------------------------------------------
1 | title: $:/core/ui/AdvancedSearch/Filter
2 | tags: $:/tags/AdvancedSearch
3 | caption: {{$:/language/Search/Filter/Caption}}
4 | first-search-filter: [subfilter{$:/temp/advancedsearch}]
5 |
6 | <$transclude tiddler="$:/core" subtiddler="$:/core/ui/AdvancedSearch/Filter"/>
--------------------------------------------------------------------------------
/themes/cdr/captivate/images/down-arrow.tid:
--------------------------------------------------------------------------------
1 | title: $:/core/images/down-arrow
2 | tags: $:/tags/Image
3 |
4 |
--------------------------------------------------------------------------------
/themes/cdr/captivate/settings.multids:
--------------------------------------------------------------------------------
1 | title: $:/themes/cdr/captivate/
2 |
3 | settings/accent-topbar: no
4 | settings/color-primary: #5778d8
5 | settings/color-secondary: #eecc66
6 | settings/color-link: #5778d8
7 | settings/palette-theme: light
8 | settings/text-on-dark: range(67,85)
9 | settings/text-on-light: range(10,48)
10 | settings/tiddlerwidth: 900px
--------------------------------------------------------------------------------
/themes/cdr/captivate/images/close.tid:
--------------------------------------------------------------------------------
1 | title: $:/core/images/close-button
2 | tags: $:/tags/Image
3 |
4 |
--------------------------------------------------------------------------------
/plugins/cdr/colorlab/demo/styles.css.tid:
--------------------------------------------------------------------------------
1 | title: $:/plugins/cdr/colorlab/demo/styles.css
2 | tags: $:/tags/Stylesheet
3 | type: text/css
4 |
5 | .demo-colorbox{
6 | display: inline-block;
7 | font-weight:500;
8 | text-align:center;
9 | width:190px;
10 | margin:10px 5px 0px;
11 | padding:15px 10px;
12 | }
13 |
14 | .demo-rangectrl {
15 | margin: 3px 10px 0px;
16 | width: 45%;
17 | }
18 |
--------------------------------------------------------------------------------
/themes/cdr/captivate/plugin.info:
--------------------------------------------------------------------------------
1 | {
2 | "title": "$:/themes/cdr/captivate",
3 | "name": "Captivate",
4 | "author": "cdruan",
5 | "core-version": ">=5.2.0",
6 | "plugin-type": "theme",
7 | "description": "Switchable layouts with custom palettes",
8 | "dependents": ["$:/themes/tiddlywiki/vanilla","$:/plugins/cdr/colorlab"],
9 | "list": ["contents", "readme"],
10 | "version": "0.2.1"
11 | }
--------------------------------------------------------------------------------
/themes/cdr/captivate/images/edit.tid:
--------------------------------------------------------------------------------
1 | title: $:/core/images/edit-button
2 | tags: $:/tags/Image
3 |
4 |
8 |
--------------------------------------------------------------------------------
/themes/cdr/captivate/ui/AdvancedSearch/AdvancedSearch.tid:
--------------------------------------------------------------------------------
1 | title: $:/AdvancedSearch
2 | icon: $:/core/images/advanced-search-button
3 | color: #bbb
4 |
5 | \whitespace trim
6 |
7 | <$eventcatcher selector="div.tc-advanced-search" $click="""<$action-deletetiddler $tiddler="$:/temp/advancedsearch/input/topbar"/>""" stopPropagation="never" tag="div">
8 | <$transclude tiddler="$:/core" subtiddler="$:/AdvancedSearch"/>
9 | $eventcatcher>
10 |
--------------------------------------------------------------------------------
/wiki/tiddlers/Intro.tid:
--------------------------------------------------------------------------------
1 | title: Captivate Theme Demo
2 | created: 20210701212256020
3 | modified: 20220122122702255
4 | type: text/vnd.tiddlywiki
5 | tags: introduction
6 |
7 | !! Design Your Own Color Palette
8 |
9 | {{$:/themes/cdr/captivate/tweaks/colors}}
10 |
11 | ---
12 |
13 | * For details about the theme, see [[README|$:/themes/cdr/captivate/readme]]
14 |
15 | * Press <
6 |
7 |
8 |
9 | ## Features
10 |
11 | * Adds a pop of color to your wiki with just a few clicks. Pick any three colors and receive these variations of your color scheme: light, dark, and tan.
12 | * Incorporates TiddlyWiki's layout switching mechanism. At a minimum, you can switch between the Captivate layout and the default TiddlyWiki layout by pressing Ctrl-Shift-L.
13 | * Supports display-p3 color values and gracefully falls back to sRGB for browsers that do not support this color space.
14 |
15 | ## Demo
16 |
17 | For a demonstration, visit [https://cdruan.github.io/tw5-captivate](https://cdruan.github.io/tw5-captivate)
18 |
--------------------------------------------------------------------------------
/plugins/cdr/colorlab/color-deviate.js:
--------------------------------------------------------------------------------
1 | /*\
2 | title: $:/plugins/cdr/colorlab/color-deviate.js
3 | type: application/javascript
4 | module-type: macro
5 |
6 | Adjust the color a bit. If the color is on the dark side, make it slightly
7 | lighter; and make a light color slightly darker.
8 | \*/
9 |
10 | (function(){
11 |
12 | /* jslint node: true, browser: true */
13 | /* global $tw: false */
14 | "use strict";
15 |
16 | exports.name = "color-deviate";
17 |
18 | exports.params = [
19 | {name: "color"},
20 | ];
21 |
22 | var Color = require("$:/plugins/cdr/colorlab/lib/color.js");
23 | var utils = require("$:/plugins/cdr/colorlab/twutils.js");
24 |
25 | exports.run = function(color,value) {
26 | color = new Color(utils.wikifyText(color,this));
27 |
28 | var lightness = color.lightness;
29 | var adjust;
30 |
31 | var newval;
32 | if(lightness < 40) {
33 | newval = 0.085 * Math.pow(lightness,1.45) + 28;
34 | } else {
35 | newval = lightness - Math.pow(Math.max(100-lightness,11),0.79) * 0.4;
36 | }
37 | color.lightness = newval;
38 | return color.toString();
39 | };
40 |
41 | })();
--------------------------------------------------------------------------------
/plugins/cdr/colorlab/color-eval.js:
--------------------------------------------------------------------------------
1 | /*\
2 | title: $:/plugins/cdr/colorlab/color-eval.js
3 | type: application/javascript
4 | module-type: macro
5 |
6 | Returns a color string that is supported by the browser. Can be used to
7 | "downgrade" a p3 color string on browsers that don't support p3 color space.
8 | \*/
9 |
10 | (function(){
11 |
12 | /* jslint node: true, browser: true */
13 | /* global $tw: false */
14 | "use strict";
15 |
16 | exports.name = "color-eval";
17 |
18 | exports.params = [
19 | {name: "color"},
20 | ];
21 |
22 | var Color = require("$:/plugins/cdr/colorlab/lib/color.js");
23 | var utils = require("$:/plugins/cdr/colorlab/twutils.js");
24 |
25 | exports.run = function(color) {
26 | var cssColor = utils.wikifyText(color,this);
27 | color = Color.parse(cssColor);
28 | if (! color) {
29 | return "";
30 | }
31 |
32 | if (color.space && color.space !== "rgb" && $tw.browser) {
33 | if (window.matchMedia("(color-gamut: p3)").matches) {
34 | return (new Color(color)).toString("p3");
35 | }
36 | return (new Color(color)).toString("rgb");
37 | }
38 | return cssColor;
39 | };
40 |
41 | })();
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 cdruan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/themes/cdr/captivate/readme.tid:
--------------------------------------------------------------------------------
1 | title: $:/themes/cdr/captivate/readme
2 | created: 20210701212256020
3 | modified: 20220122074304455
4 |
5 | This theme aims to provide another clean and functional layout for <$text text="TiddlyWiki"/>.
6 |
7 | !! Features
8 |
9 | Captivate allows you to:
10 |
11 | * Personalize the colors of your wiki with just a few clicks.
12 | * Switch between Captivate and the default <$text text="TiddlyWiki"/> layout.
13 | * Incorporate [[display-p3|https://webkit.org/blog/10042/wide-gamut-color-in-css-with-display-p3/]] color. The theme will gracefully fall back to sRGB when necessary.
14 |
15 | !! Installation
16 |
17 | To add this theme to your own <$text text="TiddlyWiki"/>
18 |
19 | # Drag the following links to your wiki:
20 | #* [[$:/themes/cdr/captivate]]
21 | #* [[$:/plugins/cdr/colorlab]]
22 | # Save and reload
23 | # Select the ''Captivate'' theme in ''[[$:/ControlPanel]] > Appearance > Theme''
24 |
25 | !! Usage
26 |
27 | * To generate personal color palettes, go to ''[[$:/ControlPanel]] > Appearance > Theme Tweaks''
28 | * To switch the page layout, use the keyboard shortcut <Enter a color and click on the ''Reset'' button to see the color's lightness value:
39 | <$edit-text tiddler=<