refactor: switch how tabs work in an effort to make downstream stuff
easier
This commit is contained in:
parent
7c4649924e
commit
873773bc91
14 changed files with 846 additions and 947 deletions
|
|
@ -5,7 +5,7 @@
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
|
@ -18,13 +18,11 @@
|
|||
|
||||
#auth-container {
|
||||
width: 95%;
|
||||
min-height: 25rem;
|
||||
position: relative;
|
||||
background: hsl(from var(--bg) h s calc(l/1.1) / 0.5);
|
||||
max-width: 40em;
|
||||
margin: 0 auto;
|
||||
border-radius: calc( var(--border-radius) * 2);
|
||||
overflow: hidden;
|
||||
|
||||
transition: all 0.33s ease;
|
||||
animation: zoomsettle 0.4s ease;
|
||||
|
|
@ -41,15 +39,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
#login-tab .tab-content {
|
||||
min-height: 17rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#signup-tab .tab-content {
|
||||
min-height: 21rem;
|
||||
}
|
||||
|
||||
body[data-user] #signup-login-wall {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
|
|
@ -58,7 +47,7 @@
|
|||
|
||||
#signup-login-wall form {
|
||||
width: 100%;
|
||||
padding: 1.5rem 1.5rem 0 1.5rem;
|
||||
padding: 0.5rem 1.5rem 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -66,18 +55,17 @@
|
|||
<!-- #include "./files/settings/signup_pitch.html" or "./files/settings/signup_pitch.md" or "./signup_pitch.default.md" -->
|
||||
|
||||
<div class="tabs">
|
||||
<div id="signup-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="signup-login-tabs"
|
||||
id="signup-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
checked="checked"
|
||||
/>
|
||||
<label for="signup-tab-input" class="tab-label">
|
||||
<label for="signup-tab-input" class="tablabel">
|
||||
<div class="label">Sign Up</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div id="signup-tab" class="panel">
|
||||
<form data-smart="true" data-method="POST" id="signup-form" action="/api/users">
|
||||
<script>
|
||||
{
|
||||
|
|
@ -121,18 +109,17 @@
|
|||
<button id="signup-submit" type="submit" class="primary">Sign Up</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="login-tab" class="tab">
|
||||
|
||||
<input
|
||||
type="radio"
|
||||
name="signup-login-tabs"
|
||||
id="login-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
/>
|
||||
<label for="login-tab-input" class="tab-label">
|
||||
<label for="login-tab-input" class="tablabel">
|
||||
<div class="label">Log In</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div id="login-tab" class="panel">
|
||||
<form data-smart="true" data-method="POST" id="login-form" action="/api/auth">
|
||||
<script>
|
||||
{
|
||||
|
|
@ -158,7 +145,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener( 'DOMContentLoaded', () => {
|
||||
|
|
|
|||
|
|
@ -127,19 +127,18 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div id="blurbs" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="blurb-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="blurbs"
|
||||
/>
|
||||
<label for="blurb-tab-input" class="tab-label"
|
||||
<label for="blurb-tab-input" class="tablabel"
|
||||
><div class="icon blurb"></div>
|
||||
<div class="label">Blurbs</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<div id="blurbs-container" class="container">
|
||||
<!-- #include "./README.md" -->
|
||||
|
||||
|
|
@ -245,4 +244,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
<div id="calendar" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="calendar-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="calendar"
|
||||
/>
|
||||
<label for="calendar-tab-input" class="tab-label mockup"
|
||||
<label for="calendar-tab-input" class="tablabel mockup"
|
||||
><div class="icon calendar"></div>
|
||||
<div class="label">Calendar</div></label
|
||||
>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<!-- #include "./README.md" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#chat #chat-container {
|
||||
#chat-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#chat #chat-content {
|
||||
#chat-container #chat-content {
|
||||
overflow-y: scroll;
|
||||
scroll-behavior: smooth;
|
||||
position: absolute;
|
||||
|
|
@ -14,13 +14,14 @@
|
|||
bottom: 5rem;
|
||||
padding: 1.5rem 1.5rem 0.75rem 1.5rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
#chat #chat-content {
|
||||
#chat-container #chat-content {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
#chat #chat-entry-container {
|
||||
#chat-container #chat-entry-container {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
|
@ -29,18 +30,18 @@
|
|||
padding: 1rem;
|
||||
}
|
||||
|
||||
#chat #chat-entry-container form {
|
||||
#chat-container #chat-entry-container form {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
#chat #chat-entry-container form input[type="file"] {
|
||||
#chat-container #chat-entry-container form input[type="file"] {
|
||||
opacity: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#chat #chat-entry-container form button,
|
||||
#chat #chat-entry-container form label {
|
||||
#chat-container #chat-entry-container form button,
|
||||
#chat-container #chat-entry-container form label {
|
||||
position: relative;
|
||||
top: inherit;
|
||||
font-size: inherit;
|
||||
|
|
@ -54,12 +55,12 @@
|
|||
border: 1px solid rgba(128, 128, 128, 0.2);
|
||||
}
|
||||
|
||||
#chat #chat-entry-container form textarea {
|
||||
#chat-container #chat-entry-container form textarea {
|
||||
flex-grow: 1;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#chat .message-container {
|
||||
#chat-container .message-container {
|
||||
position: relative;
|
||||
transition: all 0.33s;
|
||||
background: var(--bg-lighter);
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
#chat .message-container .html-from-markdown {
|
||||
#chat-container .message-container .html-from-markdown {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
|
@ -112,33 +113,21 @@
|
|||
margin-bottom: -0.75rem !important;
|
||||
}
|
||||
|
||||
#chat
|
||||
.message-container.user-tick.time-tick
|
||||
+ .message-container.user-tick.time-tick
|
||||
.info-container,
|
||||
#chat
|
||||
.message-container.user-tick.time-tock
|
||||
+ .message-container.user-tick.time-tock
|
||||
.info-container,
|
||||
#chat
|
||||
.message-container.user-tock.time-tick
|
||||
+ .message-container.user-tock.time-tick
|
||||
.info-container,
|
||||
#chat
|
||||
.message-container.user-tock.time-tock
|
||||
+ .message-container.user-tock.time-tock
|
||||
.info-container {
|
||||
#chat .message-container.user-tick.time-tick+.message-container.user-tick.time-tick .info-container,
|
||||
#chat .message-container.user-tick.time-tock+.message-container.user-tick.time-tock .info-container,
|
||||
#chat .message-container.user-tock.time-tick+.message-container.user-tock.time-tick .info-container,
|
||||
#chat .message-container.user-tock.time-tock+.message-container.user-tock.time-tock .info-container {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#chat .message-container.sending {
|
||||
#chat-container .message-container.sending {
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
#chat .message-container button[commandfor] {
|
||||
#chat-container .message-container button[commandfor] {
|
||||
position: absolute;
|
||||
top: 0.1rem;
|
||||
right: 0.1rem;
|
||||
|
|
@ -147,13 +136,13 @@
|
|||
z-index: 10;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container:has(input[type="checkbox"]:checked) {
|
||||
#chat-container .message-container .message-actions-container:has(input[type="checkbox"]:checked) {
|
||||
background: rgb(from var(--bg) r g b / 0.9);
|
||||
border-color: var(--border-subtle);
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container .message-action {
|
||||
#chat-container .message-container .message-actions-container .message-action {
|
||||
border: none;
|
||||
opacity: 0;
|
||||
transition: 0.2s ease-in-out;
|
||||
|
|
@ -169,79 +158,75 @@
|
|||
background: none;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container label {
|
||||
#chat-container .message-container .message-actions-container label {
|
||||
cursor: pointer;
|
||||
width: 2rem;
|
||||
text-align: right;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container input[type="checkbox"] {
|
||||
#chat-container .message-container .message-actions-container input[type="checkbox"] {
|
||||
opacity: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#chat
|
||||
.message-container
|
||||
.message-actions-container
|
||||
input[type="checkbox"]:checked
|
||||
~ .message-action {
|
||||
#chat .message-container .message-actions-container input[type="checkbox"]:checked~.message-action {
|
||||
opacity: 1;
|
||||
width: 3.25rem;
|
||||
margin-right: 1.25rem;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container .message-action .action-name {
|
||||
#chat-container .message-container .message-actions-container .message-action .action-name {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container {
|
||||
#chat-container .message-container .info-container {
|
||||
display: flex;
|
||||
margin-bottom: -1.75rem;
|
||||
height: 3.75rem;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .username-container {
|
||||
#chat-container .message-container .info-container .username-container {
|
||||
margin: 0 4px;
|
||||
font-weight: bold;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .datetime-container {
|
||||
#chat-container .message-container .info-container .datetime-container {
|
||||
margin: 0 4px;
|
||||
padding-top: 0.4rem;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .datetime-container .long {
|
||||
#chat-container .message-container .info-container .datetime-container .long {
|
||||
font-size: x-small;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .datetime-container .short {
|
||||
#chat-container .message-container .info-container .datetime-container .short {
|
||||
font-size: xx-small;
|
||||
visibility: hidden;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#chat .message-container .message-content-container,
|
||||
#chat .message-container .message-media-container,
|
||||
#chat .message-container .reactions-container {
|
||||
#chat-container .message-container .message-content-container,
|
||||
#chat-container .message-container .message-media-container,
|
||||
#chat-container .message-container .reactions-container {
|
||||
padding-left: 8rem;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
#chat .message-container .reactions-container:has(> .reaction-container) {
|
||||
#chat-container .message-container .reactions-container:has(> .reaction-container) {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
#chat .embed-container {
|
||||
#chat-container .embed-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
#chat .embed-container .embed-actions-container {
|
||||
#chat-container .embed-container .embed-actions-container {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: 0.25rem;
|
||||
|
|
@ -253,31 +238,31 @@
|
|||
opacity: 0;
|
||||
}
|
||||
|
||||
#chat .embed-container audio {
|
||||
#chat-container .embed-container audio {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#chat .embed-container.rounded {
|
||||
#chat-container .embed-container.rounded {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
#chat .embed-container.short {
|
||||
#chat-container .embed-container.short {
|
||||
height: 120px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#chat .embed-container.tidal {
|
||||
#chat-container .embed-container.tidal {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
#chat .embed-container.vertical {
|
||||
#chat-container .embed-container.vertical {
|
||||
max-width: 320px;
|
||||
overflow: hidden;
|
||||
aspect-ratio: 9 / 16 !important;
|
||||
}
|
||||
|
||||
#chat .embed-container.letterbox {
|
||||
#chat-container .embed-container.letterbox {
|
||||
/* height: 0; */
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
|
@ -285,14 +270,14 @@
|
|||
aspect-ratio: 16 / 9 !important;
|
||||
}
|
||||
|
||||
#chat .embed-container.square {
|
||||
#chat-container .embed-container.square {
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
aspect-ratio: 1 / 1 !important;
|
||||
}
|
||||
|
||||
#chat .embed-container iframe,
|
||||
#chat .embed-container video {
|
||||
#chat-container .embed-container iframe,
|
||||
#chat-container .embed-container video {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
@ -305,7 +290,7 @@
|
|||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
#chat #chat-container {
|
||||
#chat-container #chat-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
@ -313,28 +298,28 @@
|
|||
bottom: 0;
|
||||
}
|
||||
|
||||
#chat #chat-container #chat-entry-container,
|
||||
#chat #chat-container #chat-entry-container form {
|
||||
#chat-container #chat-container #chat-entry-container,
|
||||
#chat-container #chat-container #chat-entry-container form {
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
#chat #chat-container #chat-entry-container form button,
|
||||
#chat #chat-container #chat-entry-container form label {
|
||||
#chat-container #chat-container #chat-entry-container form button,
|
||||
#chat-container #chat-container #chat-entry-container form label {
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
|
||||
#chat .message-container .message-content-container,
|
||||
#chat .message-container .message-media-container,
|
||||
#chat .message-container .reactions-container {
|
||||
#chat-container .message-container .message-content-container,
|
||||
#chat-container .message-container .message-media-container,
|
||||
#chat-container .message-container .reactions-container {
|
||||
padding-left: 4rem;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .datetime-container .long {
|
||||
#chat-container .message-container .info-container .datetime-container .long {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#chat .message-container .info-container .datetime-container .short {
|
||||
#chat-container .message-container .info-container .datetime-container .short {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
<div id="chat" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="chat-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="chat"
|
||||
/>
|
||||
<label for="chat-tab-input" class="tab-label"
|
||||
<label for="chat-tab-input" class="tablabel"
|
||||
><div class="icon chat"></div>
|
||||
<div class="label">Chat</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<style>
|
||||
<!-- #include "./chat.css" -->
|
||||
</style>
|
||||
|
|
@ -231,5 +230,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- #include "./channel_sidebar.html" -->
|
||||
|
|
|
|||
|
|
@ -95,19 +95,18 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div id="essays" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="essay-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="essays"
|
||||
/>
|
||||
<label for="essay-tab-input" class="tab-label"
|
||||
<label for="essay-tab-input" class="tablabel"
|
||||
><div class="icon essay"></div>
|
||||
<div class="label">Essays</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<div id="essays-container" class="container">
|
||||
<!-- #include "./README.md" -->
|
||||
<!-- #include "./new_essay.html" -->
|
||||
|
|
@ -212,4 +211,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
<div id="exchange" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="exchange-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="exchange"
|
||||
/>
|
||||
<label for="exchange-tab-input" class="tab-label"
|
||||
<label for="exchange-tab-input" class="tablabel"
|
||||
><div class="icon exchange"></div>
|
||||
<div class="label">Exchange</div></label
|
||||
>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<!-- #include "./README.md" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -127,19 +127,18 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div id="forum" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="forum-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="forum"
|
||||
/>
|
||||
<label for="forum-tab-input" class="tab-label"
|
||||
<label for="forum-tab-input" class="tablabel"
|
||||
><div class="icon forum"></div>
|
||||
<div class="label">Forum</div></label
|
||||
>
|
||||
<div class="tab-content forum-container">
|
||||
<div class="panel forum-container">
|
||||
<!-- #include "./README.md" -->
|
||||
|
||||
<div
|
||||
|
|
@ -253,4 +252,3 @@
|
|||
|
||||
<!-- #include "./new_post.html" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
<div id="home" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="home-tab-input"
|
||||
checked="checked"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="home"
|
||||
/>
|
||||
<label for="home-tab-input" class="tab-label">
|
||||
<label for="home-tab-input" class="tablabel">
|
||||
<div class="icon home"></div>
|
||||
<div class="label">Home</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<!-- #include "./README.md" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
<script></script>
|
||||
<style></style>
|
||||
<div id="live-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="live-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="profile"
|
||||
/>
|
||||
<label for="live-tab-input" class="tab-label mockup"
|
||||
<label for="live-tab-input" class="tablabel mockup"
|
||||
><div class="icon live"></div>
|
||||
<div class="label">Live</div></label
|
||||
>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<div
|
||||
class="live-container"
|
||||
style="
|
||||
|
|
@ -70,4 +69,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
</script>
|
||||
<style>
|
||||
#map-tab .tab-content {
|
||||
#map-tab .panel {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
|
@ -37,19 +37,17 @@
|
|||
}
|
||||
}
|
||||
</style>
|
||||
<div id="map-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="map-tab-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="map"
|
||||
/>
|
||||
<label for="map-tab-tab-input" class="tab-label"
|
||||
<label for="map-tab-tab-input" class="tablabel"
|
||||
><div class="icon map-pin"></div>
|
||||
<div class="label">Map</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<div class="panel">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
<div id="resources" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="resources-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="resources"
|
||||
/>
|
||||
<label for="resources-tab-input" class="tab-label mockup"
|
||||
<label for="resources-tab-input" class="tablabel mockup"
|
||||
><div class="icon resources"></div>
|
||||
<div class="label">Resources</div></label
|
||||
>
|
||||
<div class="tab-content"><!-- #include "./README.md" --></div>
|
||||
</div>
|
||||
<div class="panel"><!-- #include "./README.md" --></div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
APP.on( "view_changed", ({ view }) => {
|
||||
const target_tab = document.querySelector(`.tab-switch[data-view="${view}"]`);
|
||||
const target_tab = document.querySelector(`.tabswitch[data-view="${view}"]`);
|
||||
|
||||
if (target_tab) {
|
||||
target_tab.click();
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
});
|
||||
|
||||
APP.on( 'load', () => {
|
||||
const tab_switchers = document.querySelectorAll(".tab-switch");
|
||||
const tab_switchers = document.querySelectorAll(".tabswitch");
|
||||
for (const tab_switch of tab_switchers) {
|
||||
tab_switch.addEventListener("input", (event) => {
|
||||
const tab_selector = event.target;
|
||||
|
|
@ -22,98 +22,46 @@
|
|||
});
|
||||
</script>
|
||||
<style>
|
||||
.tabs-container {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
:root {
|
||||
--tab-label-height: 4em;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
min-height: inherit;
|
||||
background: inherit;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.tabs::before,
|
||||
.tabs::after {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.tabs::after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.tab {
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
.tab-switch {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
position: relative;
|
||||
width: 6rem;
|
||||
height: 5rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tab-label .label {
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
.tabs .tabswitch {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 5rem;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
transition: all 0.35s;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
margin-top: 1px;
|
||||
overflow-y: scroll;
|
||||
visibility: hidden;
|
||||
display: none;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
.tab-switch,
|
||||
.tab-switch + .tab-label {
|
||||
transition: none;
|
||||
.tabs .tablabel {
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
text-align: center;
|
||||
padding: 1em;
|
||||
height: var(--tab-label-height);
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
.tab-switch:checked + .tab-label {
|
||||
margin-top: 1px;
|
||||
.tabs .tabswitch:checked + .tablabel {
|
||||
border-bottom: 1px solid var(--accent);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tab-switch:checked + label + .tab-content {
|
||||
z-index: 2;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
.tabs .panel {
|
||||
display: none;
|
||||
position: relative;
|
||||
padding: 1em;
|
||||
width: 100%;
|
||||
height: calc( 100vh - var(--tab-label-height) );
|
||||
order: 99;
|
||||
}
|
||||
|
||||
.tabs .tabswitch:checked + .tablabel + .panel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) {
|
||||
.tab-label {
|
||||
width: 4rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="tabs">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<div id="work" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="work-tab-input"
|
||||
class="tab-switch"
|
||||
class="tabswitch"
|
||||
data-view="work"
|
||||
/>
|
||||
<label for="work-tab-input" class="tab-label"
|
||||
<label for="work-tab-input" class="tablabel"
|
||||
><div class="icon work"></div>
|
||||
<div class="label">Work</div>
|
||||
</label>
|
||||
<div class="tab-content"><!-- #include "./README.md" --></div>
|
||||
<div class="panel">
|
||||
<!-- #include "./README.md" -->
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue