Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Oct 9, 2022
1 parent 62d7c75 commit 4327959
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
38 changes: 12 additions & 26 deletions packages/ui/src/components/Setting.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const activeCls = $.css('display: block;')

export const setting = $.css({
'z-index': '98',
'max-height': '78%',
'max-height': '75%',
'border-radius': '3px',
'font-size': '14px',
display: 'block',
Expand All @@ -26,23 +26,15 @@ export const setting = $.css({
},

// panel
'& > div': {
display: 'none'
},
'& > div': { display: 'none' },

// active panel
[`& > div.${activeCls}`]: {
display: 'block'
}
[`& > div.${activeCls}`]: { display: 'block' }
})

export const panelCls = $.css(`
min-width: 220px;
`)
export const panelCls = $.css('min-width: 220px;')

export const subPanelCls = $.css(`
min-width: 150px;
`)
export const subPanelCls = $.css('min-width: 150px;')

// √
export const yesIcon = $.css(`
Expand Down Expand Up @@ -98,36 +90,30 @@ export const nextLabelText = $.css(`
export const settingItemCls = $.css({
height: '35px',
cursor: 'pointer',
color: '#eee',
color: '#fff',
'justify-content': 'space-between',
'align-items': 'center',
padding: '0 10px',
'line-height': '1',
display: 'flex',
overflow: 'hidden',

'& > *': {
'pointer-events': 'none'
},
'& > *': { 'pointer-events': 'none' },

'&:hover': {
'background-color': 'rgba(255, 255, 255, 0.1)'
},

[`&[data-selected='true']`]: {
'background-color': 'rgba(255, 255, 255, 0.1)',
color: '#fff',
[`& .${yesIcon}`]: { display: 'block' },
[`&[data-index]`]: {
'background-color': 'rgba(255, 255, 255, 0.1)'
},

[`& .${switcherCls}`]: {
'background-color': 'var(--primary-color)',

'&:before': {
transform: 'translateX(16px)'
}
},

[`& .${yesIcon}`]: {
display: 'block'
'&:before': { transform: 'translateX(16px)' }
}
}
})
Expand Down
4 changes: 1 addition & 3 deletions packages/ui/src/components/Setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ function createPanel(
}

optionPanel.$ref.addEventListener('click', (e) => {
const target = (<HTMLDivElement>e.target) as HTMLDivElement
const index = +target.getAttribute('data-index')!
optionPanel.select!(index)
optionPanel.select!(+(e.target as HTMLDivElement).getAttribute('data-index')!)
})
}
} else {
Expand Down

1 comment on commit 4327959

@vercel
Copy link

@vercel vercel bot commented on 4327959 Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

oplayer – ./

oplayer-git-main-shiyiya.vercel.app
oplayer-shiyiya.vercel.app
oplayer.vercel.app

Please sign in to comment.