2023-08-22 16:08:11 -07:00
|
|
|
@import "../partials/clean/constants"
|
|
|
|
@import "../partials/clean/mixins"
|
2024-01-21 03:38:02 -08:00
|
|
|
@import "../partials/item_header"
|
2023-08-22 16:08:11 -07:00
|
|
|
|
2010-11-05 13:43:26 -07:00
|
|
|
body.items-show
|
2024-09-08 18:54:11 -07:00
|
|
|
#container
|
|
|
|
width: 900px // A bit more generous to the preview area!
|
|
|
|
|
2024-01-21 03:38:02 -08:00
|
|
|
.item-header
|
|
|
|
+item-header
|
2024-01-18 22:16:56 -08:00
|
|
|
|
2012-10-24 20:09:05 -07:00
|
|
|
#item-contributors
|
|
|
|
+subtle-banner
|
|
|
|
clear: both
|
2012-10-24 20:16:01 -07:00
|
|
|
margin:
|
|
|
|
bottom: 0
|
|
|
|
top: 2em
|
2012-10-24 20:09:05 -07:00
|
|
|
|
|
|
|
header
|
|
|
|
display: inline
|
|
|
|
font-weight: bold
|
|
|
|
margin-right: .25em
|
|
|
|
|
|
|
|
footer
|
|
|
|
display: inline
|
|
|
|
|
|
|
|
ul
|
2024-01-23 04:37:43 -08:00
|
|
|
display: inline
|
|
|
|
list-style: none
|
|
|
|
|
|
|
|
li
|
|
|
|
display: inline
|
|
|
|
|
|
|
|
&::after
|
|
|
|
content: ", "
|
2012-10-24 20:09:05 -07:00
|
|
|
|
2024-01-23 04:37:43 -08:00
|
|
|
&:last-child::after
|
|
|
|
content: "."
|
2012-03-23 14:37:53 -07:00
|
|
|
|
2010-11-05 13:43:26 -07:00
|
|
|
.nc-icon
|
|
|
|
height: 16px
|
|
|
|
width: 16px
|
2024-06-30 23:09:28 -07:00
|
|
|
|
2024-09-06 16:24:58 -07:00
|
|
|
.preview-area
|
|
|
|
margin: 0 auto
|
2024-09-06 17:12:11 -07:00
|
|
|
position: relative
|
|
|
|
|
|
|
|
.customize-more
|
|
|
|
position: absolute
|
|
|
|
top: 1em
|
|
|
|
right: 1em
|
|
|
|
|
|
|
|
display: flex
|
|
|
|
align-items: center
|
|
|
|
text-decoration: none
|
|
|
|
|
|
|
|
background: #EDF2F7
|
|
|
|
padding: .75em
|
|
|
|
border-radius: .375em
|
|
|
|
min-height: 2rem
|
|
|
|
min-width: 2rem
|
|
|
|
box-sizing: border-box
|
2024-09-06 16:24:58 -07:00
|
|
|
|
2024-07-08 13:43:28 -07:00
|
|
|
outfit-viewer
|
2024-06-30 23:09:28 -07:00
|
|
|
display: block
|
2024-07-08 10:36:16 -07:00
|
|
|
position: relative
|
2024-06-30 23:09:28 -07:00
|
|
|
width: 300px
|
|
|
|
height: 300px
|
|
|
|
border: 1px solid $module-border-color
|
|
|
|
border-radius: 1em
|
|
|
|
overflow: hidden
|
|
|
|
|
2024-07-08 17:29:22 -07:00
|
|
|
// There's no useful text in here, but double-clicking the play/pause
|
|
|
|
// button can cause a weird selection state. Disable text selection.
|
|
|
|
user-select: none
|
|
|
|
-webkit-user-select: none
|
|
|
|
|
2024-07-02 22:16:37 -07:00
|
|
|
outfit-layer
|
2024-06-30 23:09:28 -07:00
|
|
|
display: block
|
|
|
|
position: absolute
|
|
|
|
inset: 0
|
|
|
|
|
2024-07-08 17:24:18 -07:00
|
|
|
// We disable pointer-events most importantly for the iframes, which
|
|
|
|
// will ignore our `cursor: wait` and show a plain cursor for the
|
|
|
|
// inside of its own document. But also, the context menus for these
|
|
|
|
// elements are kinda actively misleading, too!
|
|
|
|
pointer-events: none
|
|
|
|
|
2024-07-03 20:15:35 -07:00
|
|
|
img, iframe
|
2024-06-30 23:09:28 -07:00
|
|
|
width: 100%
|
|
|
|
height: 100%
|
2024-06-30 23:34:27 -07:00
|
|
|
|
2024-07-07 21:32:41 -07:00
|
|
|
.loading-indicator
|
|
|
|
position: absolute
|
2024-07-08 13:43:28 -07:00
|
|
|
z-index: 1000
|
2024-07-07 21:32:41 -07:00
|
|
|
bottom: 0px
|
|
|
|
right: 4px
|
|
|
|
padding: 8px
|
|
|
|
background: radial-gradient(circle closest-side, white 45%, #ffffff00)
|
|
|
|
|
2024-07-07 19:05:48 -07:00
|
|
|
opacity: 0
|
|
|
|
transition: opacity .5s
|
|
|
|
|
2024-07-08 13:43:28 -07:00
|
|
|
.play-pause-button
|
|
|
|
position: absolute
|
|
|
|
z-index: 1001
|
|
|
|
left: 8px
|
|
|
|
bottom: 8px
|
|
|
|
display: none
|
2024-07-08 17:19:14 -07:00
|
|
|
align-items: center
|
|
|
|
justify-content: center
|
|
|
|
color: white
|
|
|
|
background: rgba(0, 0, 0, 0.64)
|
|
|
|
width: 2.5em
|
|
|
|
height: 2.5em
|
|
|
|
border-radius: 100%
|
|
|
|
border: 2px solid transparent
|
|
|
|
transition: all .25s
|
|
|
|
|
|
|
|
.playing-label, .paused-label
|
|
|
|
display: none
|
|
|
|
width: 1em
|
|
|
|
height: 1em
|
|
|
|
|
|
|
|
.play-pause-toggle
|
|
|
|
// Visually hidden
|
|
|
|
clip: rect(0 0 0 0)
|
|
|
|
clip-path: inset(50%)
|
|
|
|
height: 1px
|
|
|
|
overflow: hidden
|
|
|
|
position: absolute
|
|
|
|
white-space: nowrap
|
|
|
|
width: 1px
|
|
|
|
|
|
|
|
&:checked ~ .playing-label
|
|
|
|
display: block
|
|
|
|
|
|
|
|
&:not(:checked) ~ .paused-label
|
|
|
|
display: block
|
|
|
|
|
|
|
|
&:hover, &:has(.play-pause-toggle:focus)
|
|
|
|
border: 2px solid $module-border-color
|
|
|
|
background: $module-bg-color
|
|
|
|
color: $text-color
|
|
|
|
|
2024-07-08 17:25:55 -07:00
|
|
|
&:has(.play-pause-toggle:active)
|
2024-07-08 17:19:14 -07:00
|
|
|
transform: translateY(2px)
|
2024-07-08 13:43:28 -07:00
|
|
|
|
|
|
|
&:has(outfit-layer:state(has-animations))
|
|
|
|
.play-pause-button
|
2024-07-08 17:19:14 -07:00
|
|
|
display: flex
|
2024-07-08 13:43:28 -07:00
|
|
|
|
2024-07-08 10:36:16 -07:00
|
|
|
.error-indicator
|
|
|
|
font-size: 85%
|
|
|
|
color: $error-color
|
|
|
|
margin-top: .25em
|
|
|
|
margin-bottom: .5em
|
|
|
|
display: none
|
2024-07-03 20:15:35 -07:00
|
|
|
|
Fix bug where item preview loading indicator sometimes doesn't delay
The loading indicator *should* fade in after two seconds, to avoid a
flash of a loading indicator when the page loads quickly - but in some
circumstances it wouldn't delay:
1. Visit an item page. (It delays correctly the first time!)
2. Click "Infinite Closet", then click a link to another item page.
3. The loading indicator appears immediately, because this time the
web component JS is already loaded, so the `outfit-layer` elements
enter `:state(loading)` *immediately*. The element starts at
`opacity: 1`, and the delay doesn't matter, because it was never at
anything else.
In this change, we have the `outfit-viewer` web component take on a
`:state(after-first-frame)`, after a `setTimeout(0)` resolves. That
enables the loading state CSS to *never* apply on the first frame, but
then sometimes kick in on the *second* frame, so that the element is
correctly perceived as "transitioning" from hidden to visible, and the
two-second delay will apply.
2024-09-06 12:13:10 -07:00
|
|
|
// When loading, fade in the loading spinner after a brief delay. We are
|
|
|
|
// loading when the <turbo-frame> is busy, or when at least one layer
|
2024-07-08 10:36:16 -07:00
|
|
|
// is loading.
|
Fix bug where item preview loading indicator sometimes doesn't delay
The loading indicator *should* fade in after two seconds, to avoid a
flash of a loading indicator when the page loads quickly - but in some
circumstances it wouldn't delay:
1. Visit an item page. (It delays correctly the first time!)
2. Click "Infinite Closet", then click a link to another item page.
3. The loading indicator appears immediately, because this time the
web component JS is already loaded, so the `outfit-layer` elements
enter `:state(loading)` *immediately*. The element starts at
`opacity: 1`, and the delay doesn't matter, because it was never at
anything else.
In this change, we have the `outfit-viewer` web component take on a
`:state(after-first-frame)`, after a `setTimeout(0)` resolves. That
enables the loading state CSS to *never* apply on the first frame, but
then sometimes kick in on the *second* frame, so that the element is
correctly perceived as "transitioning" from hidden to visible, and the
two-second delay will apply.
2024-09-06 12:13:10 -07:00
|
|
|
//
|
|
|
|
// We only apply the delay here, not on the base styles, because fading
|
|
|
|
// *out* on load should be instant. We also wait for the outfit-viewer to
|
|
|
|
// execute a `setTimeout(0)`, to make sure we always *start* in the
|
|
|
|
// non-loading state. This is because it's sometimes possible for the page to
|
|
|
|
// start with the web component already in `state(loading)`, and we need to
|
|
|
|
// make sure we *start* in *non-loading* state for the transition delay to
|
|
|
|
// happen. (This can happen when you Turbo-navigate between multiple items.)
|
2024-07-08 13:43:28 -07:00
|
|
|
#item-preview[busy] outfit-viewer, outfit-viewer:has(outfit-layer:state(loading))
|
2024-07-08 10:36:16 -07:00
|
|
|
cursor: wait
|
Fix bug where item preview loading indicator sometimes doesn't delay
The loading indicator *should* fade in after two seconds, to avoid a
flash of a loading indicator when the page loads quickly - but in some
circumstances it wouldn't delay:
1. Visit an item page. (It delays correctly the first time!)
2. Click "Infinite Closet", then click a link to another item page.
3. The loading indicator appears immediately, because this time the
web component JS is already loaded, so the `outfit-layer` elements
enter `:state(loading)` *immediately*. The element starts at
`opacity: 1`, and the delay doesn't matter, because it was never at
anything else.
In this change, we have the `outfit-viewer` web component take on a
`:state(after-first-frame)`, after a `setTimeout(0)` resolves. That
enables the loading state CSS to *never* apply on the first frame, but
then sometimes kick in on the *second* frame, so that the element is
correctly perceived as "transitioning" from hidden to visible, and the
two-second delay will apply.
2024-09-06 12:13:10 -07:00
|
|
|
|
|
|
|
&:state(after-first-frame)
|
|
|
|
.loading-indicator
|
|
|
|
opacity: 1
|
|
|
|
transition-delay: 2s
|
2024-07-07 21:32:41 -07:00
|
|
|
|
2024-07-08 10:36:16 -07:00
|
|
|
#item-preview:has(outfit-layer:state(error))
|
2024-07-08 13:43:28 -07:00
|
|
|
outfit-viewer
|
2024-07-08 10:36:16 -07:00
|
|
|
border: 2px solid red
|
|
|
|
.error-indicator
|
|
|
|
display: block
|
|
|
|
|
2024-09-05 17:34:54 -07:00
|
|
|
species-color-picker
|
2024-06-30 23:34:27 -07:00
|
|
|
.error-icon
|
|
|
|
cursor: help
|
|
|
|
margin-right: .25em
|
|
|
|
|
2024-09-05 17:34:54 -07:00
|
|
|
form[data-is-valid="false"]
|
2024-06-30 23:34:27 -07:00
|
|
|
select
|
|
|
|
border-color: $error-border-color
|
|
|
|
color: $error-color
|
2024-08-31 13:07:18 -07:00
|
|
|
|
2024-09-05 17:34:54 -07:00
|
|
|
// If JS is enabled, but auto-loading isn't ready yet (script loading or
|
|
|
|
// failed?), hide the submit button for .75sec, to give it time to load.
|
|
|
|
@media (scripting: enabled)
|
|
|
|
input[type=submit]
|
|
|
|
position: absolute
|
|
|
|
margin-left: .5em
|
|
|
|
opacity: 0
|
|
|
|
animation: fade-in .25s forwards
|
|
|
|
animation-delay: .75s
|
|
|
|
|
|
|
|
// Once the auto-loading behavior is ready, remove the submit button.
|
|
|
|
&:state(auto-loading)
|
|
|
|
input[type=submit]
|
|
|
|
display: none
|
|
|
|
|
2024-09-03 17:07:53 -07:00
|
|
|
species-face-picker
|
|
|
|
display: block
|
2024-09-03 13:46:29 -07:00
|
|
|
position: relative
|
2024-09-08 18:54:11 -07:00
|
|
|
margin-top: -10px
|
2024-09-03 13:46:29 -07:00
|
|
|
|
2024-09-03 17:54:56 -07:00
|
|
|
species-face-picker-options
|
|
|
|
display: flex
|
2024-09-05 16:28:17 -07:00
|
|
|
justify-content: center
|
2024-09-03 17:54:56 -07:00
|
|
|
flex-wrap: wrap
|
2024-09-08 13:29:34 -07:00
|
|
|
isolation: isolate // avoid z-index conflicts between pets and noscript
|
|
|
|
overflow: auto
|
|
|
|
max-height: 200px // 4 rows of 50px images, and padding will offer a hint of below
|
|
|
|
padding: 10px // leave enough room for the zoomed-in selected face
|
2024-09-03 17:54:56 -07:00
|
|
|
|
2024-09-03 17:34:31 -07:00
|
|
|
img
|
2024-09-08 18:54:11 -07:00
|
|
|
width: 54px
|
|
|
|
height: 54px
|
2024-09-03 17:54:56 -07:00
|
|
|
transition: all 0.2s
|
|
|
|
|
|
|
|
// Calm down the default color, just a smidge! There's a lot of color
|
|
|
|
// on this page already, y'know?
|
|
|
|
opacity: .9
|
|
|
|
filter: saturate(90%)
|
|
|
|
|
|
|
|
label
|
|
|
|
display: flex
|
|
|
|
overflow: hidden
|
|
|
|
transition: all 0.2s
|
|
|
|
position: relative
|
|
|
|
line-height: 1
|
|
|
|
|
|
|
|
// NOTE: The box-shadows here were copy-pasted from Impress 2020, which uses
|
|
|
|
// Chakra UI's styling system to generate them! (The colors are from their
|
|
|
|
// color palette, too.)
|
|
|
|
&:has(input:checked)
|
|
|
|
border-radius: 6px
|
|
|
|
z-index: 1
|
|
|
|
background: #9AE6B4
|
|
|
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),0 10px 10px -5px rgba(0, 0, 0, 0.04), #2F855A 0 0 2px 2px
|
|
|
|
transform: scale(1.1)
|
|
|
|
|
|
|
|
&:has(input:focus)
|
|
|
|
background: #BEE3F8
|
|
|
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),0 10px 10px -5px rgba(0, 0, 0, 0.04), #4299e1 0 0 0 3px
|
|
|
|
transform: scale(1.2)
|
2024-09-03 17:34:31 -07:00
|
|
|
|
2024-09-03 13:23:58 -07:00
|
|
|
input[type=radio]
|
|
|
|
position: absolute
|
|
|
|
left: -10000px
|
|
|
|
top: auto
|
|
|
|
width: 1px
|
|
|
|
height: 1px
|
|
|
|
overflow: hidden
|
|
|
|
|
2024-09-03 17:54:56 -07:00
|
|
|
&:checked + img
|
|
|
|
opacity: 1
|
|
|
|
filter: saturate(110%)
|
2024-09-03 13:23:58 -07:00
|
|
|
|
2024-09-03 16:42:04 -07:00
|
|
|
&:disabled + img
|
2024-09-03 17:54:56 -07:00
|
|
|
opacity: .6
|
|
|
|
filter: saturate(0%)
|
2024-09-03 16:42:04 -07:00
|
|
|
|
|
|
|
label:has(input[type=radio]:disabled)
|
|
|
|
cursor: not-allowed
|
|
|
|
|
2024-09-03 13:46:29 -07:00
|
|
|
noscript
|
|
|
|
position: absolute
|
|
|
|
inset: 0
|
2024-09-08 13:29:34 -07:00
|
|
|
padding: 1em
|
|
|
|
background: rgba(white, .8)
|
2024-09-03 13:46:29 -07:00
|
|
|
z-index: 1
|
2024-09-03 17:07:53 -07:00
|
|
|
cursor: auto
|
2024-09-03 13:46:29 -07:00
|
|
|
|
|
|
|
display: flex
|
|
|
|
align-items: center
|
|
|
|
justify-content: center
|
|
|
|
text-align: center
|
|
|
|
|
2024-09-03 17:07:53 -07:00
|
|
|
&:has(species-face-picker-options[inert])
|
2024-09-03 13:46:29 -07:00
|
|
|
cursor: wait
|
|
|
|
|
2024-09-05 18:48:41 -07:00
|
|
|
.item-preview-meta-info
|
|
|
|
display: grid
|
|
|
|
grid-template-columns: 1fr auto
|
|
|
|
gap: .5em
|
|
|
|
align-items: center
|
|
|
|
|
2024-08-31 13:07:18 -07:00
|
|
|
.item-zones-info
|
|
|
|
h3
|
|
|
|
display: inline
|
|
|
|
font: inherit
|
|
|
|
font-weight: bold
|
|
|
|
&:after
|
|
|
|
content: ": "
|
|
|
|
|
|
|
|
ul
|
|
|
|
list-style-type: none
|
|
|
|
display: inline
|
|
|
|
|
|
|
|
li
|
|
|
|
display: inline
|
|
|
|
&:not(:last-of-type):after
|
|
|
|
content: ", "
|
|
|
|
|
|
|
|
.no-zones
|
|
|
|
font-style: italic
|
|
|
|
opacity: .85
|
2024-09-03 12:55:10 -07:00
|
|
|
|
|
|
|
.zone-species-info
|
|
|
|
font-style: italic
|
|
|
|
text-decoration: underline dotted
|
2024-09-05 16:51:06 -07:00
|
|
|
|
2024-09-05 18:48:41 -07:00
|
|
|
// Many of these styles copied from Impress 2020 and its Chakra UI styles!
|
|
|
|
.item-html5-info
|
|
|
|
display: flex
|
|
|
|
align-items: center
|
|
|
|
border: 1px solid
|
|
|
|
border-radius: .375em
|
|
|
|
padding: 4px 8px
|
|
|
|
min-height: 30px
|
|
|
|
box-sizing: border-box
|
|
|
|
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px
|
|
|
|
|
|
|
|
&[data-status=converted]
|
|
|
|
background: $module-bg-color
|
|
|
|
color: $text-color
|
|
|
|
|
|
|
|
svg:nth-of-type(2)
|
|
|
|
margin-right: -4px // spacing hacks!
|
|
|
|
|
|
|
|
&[data-status=unconverted]
|
|
|
|
background: $warning-bg-color
|
|
|
|
color: #975A16
|
|
|
|
gap: .25em // spacing hacks!
|
|
|
|
|
|
|
|
svg:first-of-type
|
|
|
|
width: 12px
|
|
|
|
height: 12px
|
|
|
|
|
|
|
|
svg:nth-of-type(2)
|
|
|
|
width: 20px
|
|
|
|
height: 20px
|
|
|
|
|
2024-09-05 16:51:06 -07:00
|
|
|
#item-preview
|
|
|
|
display: flex
|
|
|
|
flex-direction: column
|
|
|
|
gap: .75em
|
|
|
|
|
2024-09-08 18:54:11 -07:00
|
|
|
@media (min-width: 700px)
|
2024-09-05 16:51:06 -07:00
|
|
|
display: grid
|
2024-09-05 18:48:41 -07:00
|
|
|
grid-template-areas: "viewer faces" "picker meta"
|
2024-09-05 16:51:06 -07:00
|
|
|
gap: .5em
|
|
|
|
|
2024-09-06 16:24:58 -07:00
|
|
|
.preview-area
|
2024-09-05 16:51:06 -07:00
|
|
|
grid-area: viewer
|
2024-09-06 16:24:58 -07:00
|
|
|
outfit-viewer
|
2024-09-08 18:54:11 -07:00
|
|
|
width: 380px
|
|
|
|
height: 380px
|
2024-09-05 16:51:06 -07:00
|
|
|
|
2024-09-05 17:34:54 -07:00
|
|
|
species-color-picker
|
2024-09-05 16:51:06 -07:00
|
|
|
grid-area: picker
|
|
|
|
|
|
|
|
species-face-picker
|
|
|
|
grid-area: faces
|
2024-09-08 13:29:34 -07:00
|
|
|
species-face-picker-options
|
2024-09-08 19:08:27 -07:00
|
|
|
max-height: 380px
|
2024-09-05 16:51:06 -07:00
|
|
|
|
2024-09-05 18:48:41 -07:00
|
|
|
.item-preview-meta-info
|
|
|
|
grid-area: meta
|
2024-09-05 17:34:54 -07:00
|
|
|
|
|
|
|
@keyframes fade-in
|
|
|
|
from
|
|
|
|
opacity: 0
|
|
|
|
to
|
|
|
|
opacity: 1
|