1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-26 08:56:52 +00:00
TiddlyWiki5/themes/tiddlywiki/vanilla/sidebar-resizer.tid

238 lines
8.8 KiB
Plaintext
Raw Normal View History

2024-10-25 04:19:28 +00:00
title: $:/themes/tiddlywiki/vanilla/sidebar-resizer
tags: [[$:/tags/Stylesheet]]
code-body: yes
\import [function[get.base.functions.theme],<get.current.theme>first[]is[tiddler]] :else[function[get.base.functions.theme],<get.current.theme>first[]is[shadow]] :else[[$:/themes/tiddlywiki/vanilla/functions]]
2024-10-26 04:52:23 +00:00
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional html
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer {
position: fixed;
top: 0;
height: 100%;
width: <<sidebar.resizer.width>>;
opacity: <<get.theme.metric slideropacity>>;
cursor: ew-resize;
background: linear-gradient(<<colour muted-foreground>>, <<colour muted-foreground>>) no-repeat center/2px 100%;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer:hover {
opacity: <<get.theme.metric slideropacityhover>>;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper {
height: 100%;
}
2024-10-25 04:19:28 +00:00
.tc-edit-texteditor-slider > .tc-sidebar-resizer-pointerdown-eventcatcher.tc-editor-preview-eventcatcher {
position: absolute;
width: 100%;
top: 0;
left: 0;
}
2024-11-03 10:48:33 +00:00
.tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
min-height: 100%;
z-index: -1;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointerdown-eventcatcher:not(.tc-main-sidebar-resizer), .tc-sidebar-resizer-pointermove-eventcatcher:not(.tc-main-sidebar-resizer), .tc-sidebar-resizer-pointermove-eventcatcher-wrapper:not(.tc-main-sidebar-resizer) {
display: flex;
flex-direction: column;
flex-grow: 1;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointermove-eventcatcher-wrapper:not(.tc-main-sidebar-resizer) {
flex-direction: row;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointerdown-eventcatcher:not(.tc-main-sidebar-resizer), .tc-sidebar-resizer-pointermove-eventcatcher-wrapper:not(.tc-main-sidebar-resizer) {
position: relative;
}
.tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove {
touch-action: none;
user-select: none;
}
2024-10-31 05:44:34 +00:00
.tc-sidebar-resizer-pointermove-eventcatcher-wrapper.tc-resizer-active {
z-index: 801;
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointermove-eventcatcher.tc-resizer-active {
z-index: 802;
}
2024-10-29 17:02:08 +00:00
.tc-sidebar-resizer-pointermove.tc-resizer-active {
z-index: 803;
cursor: ew-resize;
}
2024-10-30 04:48:36 +00:00
.tc-sidebar-resizer.tc-resizer-active {
opacity: <<get.theme.metric slideropacityhover>>;
}
2024-10-29 17:02:08 +00:00
<%if [<get.theme.explicit.option sidebarresizer>match[show]] %>
2024-10-25 04:19:28 +00:00
@media (min-width: <<sidebarbreakpoint>>) {
2024-10-25 04:19:28 +00:00
@media (pointer: coarse) {
.tc-sidebar-resizer.tc-main-sidebar-resizer {
background: <<colour muted-foreground>>;
}
.tc-sidebar-resizer.tc-main-sidebar-resizer:hover {
2024-11-12 20:23:38 +00:00
opacity: <<get.theme.metric slideropacity>>;
}
}
2024-10-25 04:19:28 +00:00
2024-10-31 06:18:44 +00:00
<%if [[$:/state/sidebar/resizing]is[tiddler]] %>
2024-10-25 04:19:28 +00:00
@media (pointer: coarse) {
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer.tc-main-sidebar-resizer {
2024-11-12 20:23:38 +00:00
opacity: min(calc(3 * <<get.theme.metric slideropacity>>),1);
}
}
2024-10-25 04:19:28 +00:00
<% endif %>
2024-10-25 04:19:28 +00:00
<%if [<set.storywidth.storyright>match[yes]] %>
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer.tc-main-sidebar-resizer {
2024-11-11 05:11:23 +00:00
left: clamp(calc(<<get.theme.metric storyleft>> + <<get.theme.metric storyminwidth>> + <<get.theme.storyleftpadding.excess>> + <<get.theme.storyrightpadding.excess>> - (2 * <<get.story-sidebar.overlap>> / 3)),calc(<<get.theme.metric storyleft>> + <<get.theme.metric storywidth>> - (2 * <<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> + <<get.story-sidebar.overlap>> + <<get.theme.storywidthoverlap>> - (2 * <<get.story-sidebar.overlap>> / 3)));
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-left .tc-sidebar-resizer.tc-main-sidebar-resizer {
left: auto;
2024-11-11 05:11:23 +00:00
right: clamp(calc(<<get.theme.metric storyleft>> + <<get.theme.metric storyminwidth>> + <<get.theme.storyleftpadding.excess>> + <<get.theme.storyrightpadding.excess>> - (2 * <<get.story-sidebar.overlap>> / 3)),calc(<<get.theme.metric storyleft>> + <<get.theme.metric storywidth>> - (2 * <<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> + <<get.story-sidebar.overlap>> + <<get.theme.storywidthoverlap>> - (2 * <<get.story-sidebar.overlap>> / 3)));
}
2024-10-25 04:19:28 +00:00
<% endif %>
2024-10-25 04:19:28 +00:00
<%if [<set.sidebarwidth>match[yes]] %>
2024-10-26 04:52:23 +00:00
.tc-sidebar-resizer.tc-main-sidebar-resizer {
left: min(clamp(calc(<<get.theme.metric storyleft>> + <<get.theme.metric storyminwidth>> + <<get.theme.storyleftpadding.excess>> + <<get.theme.storyrightpadding.excess>> - <<get.story-sidebar.overlap>> + (<<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarwidth>> + (<<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> + (<<get.story-sidebar.overlap>> / 3))),calc(100% - <<get.theme.metric sidebarminwidth>> + (<<get.story-sidebar.overlap>> / 3)));
}
2024-10-26 04:52:23 +00:00
.tc-sidebar-left .tc-sidebar-resizer.tc-main-sidebar-resizer {
left: auto;
right: min(clamp(calc(<<get.theme.metric storyleft>> + <<get.theme.metric storyminwidth>> + <<get.theme.storyleftpadding.excess>> + <<get.theme.storyrightpadding.excess>> - <<get.story-sidebar.overlap>> + (<<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarwidth>> + (<<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> + (<<get.story-sidebar.overlap>> / 3))),calc(100% - <<get.theme.metric sidebarminwidth>> + (<<get.story-sidebar.overlap>> / 3)));
}
2024-10-26 04:52:23 +00:00
<% endif %>
2024-10-26 04:52:23 +00:00
<%if [<set.centralised>match[yes]] %>
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer.tc-main-sidebar-resizer {
left: min(calc(50% + (<<get.theme.metric storywidth>> / 2) - (2 * <<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> - (2 * <<get.story-sidebar.overlap>> / 3)));
}
2024-10-25 04:19:28 +00:00
.tc-sidebar-left .tc-sidebar-resizer.tc-main-sidebar-resizer {
left: auto;
z-index: 1;
right: min(calc(50% + (<<get.theme.metric storywidth>> / 2) - (2 * <<get.story-sidebar.overlap>> / 3)),calc(100% - <<get.theme.metric sidebarminwidth>> - (2 * <<get.story-sidebar.overlap>> / 3)));
}
2024-10-25 04:19:28 +00:00
<% endif %>
<%if [{$:/state/sidebar}match[no]] %>
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointerdown-eventcatcher.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove.tc-main-sidebar-resizer, .tc-sidebar-resizer.tc-main-sidebar-resizer {
display: none;
}
<% endif %>
2024-10-25 04:19:28 +00:00
}
2024-10-25 04:19:28 +00:00
@media (max-width: <<sidebarbreakpoint-minus-one>>) {
2024-10-25 04:19:28 +00:00
.tc-sidebar-resizer-pointerdown-eventcatcher.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher.tc-main-sidebar-resizer, .tc-sidebar-resizer-pointermove.tc-main-sidebar-resizer, .tc-sidebar-resizer.tc-main-sidebar-resizer {
display: none;
}
2024-10-25 04:19:28 +00:00
}
<% endif %>
.tc-tiddler-frame iframe[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor,
.tc-tiddler-frame textarea[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor,
.tc-tiddler-frame div[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor {
width: calc(100% - <<get.theme.metric previewsliderwidth>>);
min-width: 0px;
}
2024-10-31 16:06:49 +00:00
.tc-tiddler-frame iframe[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor + .tc-tiddler-preview-preview,
.tc-tiddler-frame textarea[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor + .tc-tiddler-preview-preview,
.tc-tiddler-frame div[class*="tc-edit-texteditor-identified-"].tc-edit-texteditor + .tc-tiddler-preview-preview {
min-width: 0px;
}
2024-11-01 06:29:32 +00:00
2024-11-13 16:40:18 +00:00
div[class*="tc-editor-preview-slider-"] {
position: absolute;
left: calc(50% - <<get.theme.metric previewsliderwidth>>);
width: <<get.theme.metric previewsliderwidth>>;
}
2024-11-12 20:23:38 +00:00
@media (pointer: coarse) {
2024-11-13 16:40:18 +00:00
div[class*="tc-editor-preview-slider-"] {
2024-11-12 20:23:38 +00:00
background-color: <<colour muted-foreground>>;
}
2024-11-13 16:40:18 +00:00
div[class*="tc-editor-preview-slider-"]:hover {
2024-11-12 20:23:38 +00:00
opacity: <<get.theme.metric slideropacityhover>>;
}
}
<$list filter="[all[tiddlers]prefix[$:/state/resizer/previewwidth-]]" variable="previewWidthTiddler">
2024-11-01 06:29:32 +00:00
<$let
identifier={{{ [<previewWidthTiddler>removeprefix[$:/state/resizer/previewwidth-]] }}}
width={{{ [<previewWidthTiddler>get[text]] }}}>
2024-11-01 06:29:32 +00:00
.tc-tiddler-frame .tc-tiddler-editor.tc-tiddler-preview.tc-tiddler-preview-identified-<<identifier>> {
grid-template-columns: calc(100% - <<width>>) <<width>>;
}
2024-11-13 16:40:18 +00:00
div.tc-sidebar-resizer.tc-editor-preview-slider-<<identifier>> {
left: calc(100% - <<width>> - <<get.theme.metric previewsliderwidth>>);
}
2024-11-12 20:23:38 +00:00
<%if [[$:/state/resizing/editor-preview-]addsuffix<identifier>is[tiddler]] %>
2024-11-13 16:40:18 +00:00
div.tc-sidebar-resizer.tc-editor-preview-slider-<<identifier>> {
2024-11-12 20:23:38 +00:00
opacity: min(calc(3 * <<get.theme.metric slideropacity>>),1);
}
<% endif %>
<%if [<width>compare:number:lteq[1]] %>
2024-11-01 06:29:32 +00:00
.tc-tiddler-preview-preview-identified-<<identifier>> {
display: none;
}
2024-11-01 06:29:32 +00:00
<% endif %>
2024-11-01 06:29:32 +00:00
<%if [<width>compare:number:gteq[99]] %>
2024-11-01 06:29:32 +00:00
.tc-edit-texteditor-identified-<<identifier>> {
display: none !important;
}
2024-11-01 06:29:32 +00:00
<% endif %>
2024-11-01 06:29:32 +00:00
</$let>
2024-11-01 06:29:32 +00:00
</$list>