-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slide parts (and mark private methods) #11
Conversation
✅ Deploy Preview for slide-deck ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
* main: Favicon
Discussion this morning:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, and I am also wondering about the idea of a "part mode" or something like that- instead of specifying what is hidden, could we expose another view mode
, where the options are View canvas, View Notes, and View Both? This more closely matches how I would think of it.
This overlaps in name and function with the existing view modes of grid and list. In List, should we allow notes only mode? I also am wondering if in List view, if Canvas + Notes is 100vh, so that both can be seen simultaneously?
slide-deck.js
Outdated
]; | ||
|
||
static attrToPropMap = { | ||
'key-control': 'keyControl', | ||
'follow-active': 'followActive', | ||
'full-screen': 'fullScreen', | ||
'slide-view': 'slideView', | ||
'hide-parts': 'hideParts', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this only allows 1, should it just be hide-part
?
slide-deck.js
Outdated
@@ -98,57 +112,68 @@ class slideDeck extends HTMLElement { | |||
|
|||
// dynamic | |||
store = {}; | |||
slides; | |||
slideNotes; | |||
slideCanvas; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think slideNotes
and slideCanvas
should be private.
slide-deck.js
Outdated
this.controlPanel = this.querySelector(`[slot="control-panel"]`) ?? | ||
this.shadowRoot.querySelector(`[part="control-panel"]`); | ||
this.slides = this.querySelectorAll(':scope > :not([slot])'); | ||
this.slideNotes = this.querySelectorAll('[slide-note]'); | ||
this.slideCanvas = this.querySelectorAll('[slide-canvas]:not(:scope > *)'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to assert that the notes and canvas are inside a slide? That there is only a single instance of each inside each slide?
slide-deck.js
Outdated
note.toggleAttribute('hidden', this.hideParts === 'note'); | ||
}); | ||
|
||
this.slideCanvas.forEach((canvas) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this.slideCanvas
is assigned before slide setup is called, the contents of this.slideCanvas
is only the elements the user applied the attribute to, and not all of the ones that web component applied the attribute to in #setupSlides()
.
This means that when you hide canvas, you get this-
Only the slides with notes have their canvases hidden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was intentional, but maybe not the right choice. For slides without separate canvas and notes, hiding the canvas would mean hiding the entire container. That doesn't seem like exactly what we want.
@jamesnw I agree, a view-mode might make sense - and raises some questions about naming. From an API design perspective, I think we want both:
Ideally, consumers would also be able to add their own higher level modes. I tried to expand on some of the common modes I expect in #12 (comment) Maybe we need a UX proposal here? |
slide-deck.css
Outdated
&[blank-slide]::after { | ||
content: ''; | ||
background-color: var(--blank-color, black); | ||
background-color: var(--blank-color); | ||
position: absolute; | ||
inset: 0; | ||
z-index: -1; | ||
} | ||
|
||
&[blank-slide=black] { | ||
--blank-color: var(--color-dark); | ||
--text-color: var(--color-light); | ||
} | ||
|
||
&[blank-slide=white] { | ||
--blank-color: white; | ||
--blank-color: var(--color-light); | ||
--text-color: var(--color-dark); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stacy I think the purpose of the blank slide is hiding what's on the screen - it's a way to temporarily 'pause' the presentation, either with a white or black overlay. Moving the overlay behind the text, and then adding text contrast kinda defeats the purpose, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne that was not clear to me at all, and for some reason the "blank" in the name made me think it was more like we are starting with a blank slate, a default slide instead of the more obvious intention of "this should not show anything and it should be blank or empty" 🤦🏻♀️ . I don't really know what design issues need to be solved in which PRs/Issues right now, and what is a bug vs what isn't yet ready so I feel like I am overthinking things and not being very helpful yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I think right now the biggest design issues are the comment above (UX questions about how this should work - what views should be available) and actually designing the slide templates over on the workshop repo. It's ok for design to be pretty minimal in this repo for now.
@stacyk I pushed some updates to the attributes based on our conversation, to try and help make things more clear for styling. It may require a few changes on your end, but I think it gives you more info to work with.
Let me know if you need any of those to change. |
I privatized a few more things. Here's the remaining public API, but @mirisuzanne I have a few questions- DOM Elements - Should these be public? I don't think we want people setting these values, at the very least. Data- these make sense to have public, even when there is overlap with an attribute. Events - is this the right list? |
@mirisuzanne In f5cdd61, I moved the attribute state to getters, which means we can always use the attribute values as the source of truth, and not have to make sure our internal reflection of that value stays up to date. This does mean we need to declare each one instead of adding dynamically, so I'm open to reverting if you'd prefer the old behavior. |
I didn't get to this one today, but I will look into it tomorrow. Script view definitely isn't ideal for small screens yet. |
@stacyk I think when we merge this, it would be a good time to release a new version and update the workshop repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne I pushed an update here with some CSS to make script view a bit more readable on smaller screens. And I agree it should go into the workshop repo when approved/released.
I didn't do anything with the slide numbers here, but that can be a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stacyk looking great - and yeah, I think numbering can wait. I left some style thoughts, but I'm not sure how much we should stress about style, ha.
slide-deck.css
Outdated
grid-template-columns: repeat(auto-fill, minmax(min(50ch, 100%), 1fr)); | ||
} | ||
|
||
&[slide-view=solo] { | ||
--slide-height: 100svh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be set on the grid instead? eg
grid-auto-rows: minmax(100svh, auto);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne when I played with this, the slides with note don't take up the full height then. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, but I think we should be hiding the notes in that view? And then it will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne It looks like we still need the slide height for the container slide-items (or some additional edits to the CSS). The canvas only items are fine with the grid-rows sizing. Just pushed an update that will make it easier to see if you uncheck the --slide-height on [slide-view=solo] [slide-item]
--slide-height: 100svh; | ||
} | ||
|
||
&[slide-view=script] { | ||
--column-gap: calc(1.25em + 2vw); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this looks like more space than is needed? I think a faint boarder would be more useful than space? This feels like a view where context is more useful than whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirisuzanne how much space are you seeing? I see like, less than pinky width on active slides?
Official measurement device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stacyk Oh oh oh, it's the 5em
row gap that's real large for me. Sorry. I think that could be more like a hairline and something closer to the column gap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started playing with a hairline (it was a little finicky because of the slide item with container and with only canvas are different sizes), but then I wondered if was more than a layout thing that I should apply in a custom theme instead of the default styles in this tool. But I can play with it more in this tool to see if I can get it just right.
Related Issue(s)
Reminder to add related issue(s), if available.
Steps to test/reproduce
There's only one sample slide with notes near the end of the demo. But the control panel (command-k) has buttons for hiding one or the other.
I think this branch raises a few questions:
slide-group
,slide-frame
, andslide-note
. Can we come up with better names?slide-container
andslide-canvas
? Should it beslide-notes
plural?