Skip to content
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

fix: 外部スタイルの影響を受けにくくなるように修正 #150

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- 外部 CSS の影響を受けにくくなるように修正

## [1.6.5] - 2022-07-06

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ <h4>タイトル</h4>
--figni-viewer-prompt-hand: #9deaf0;
--figni-viewer-error: #ff0080;
}
* {
font-size: 10px;
}
:root {
height: 3000px;
}
Expand Down
34 changes: 17 additions & 17 deletions src/figni-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,8 @@ export default class FigniViewerElement extends HTMLElement {
cursor.style.top = `${y}px`
cursor.style.left = `${x}px`
cursor.style.opacity = 0.075
cursor.style.width = '8rem'
cursor.style.height = '8rem'
cursor.style.width = '8em'
cursor.style.height = '8em'
}

#deleteCursor(cursor) {
Expand Down Expand Up @@ -1004,34 +1004,34 @@ export default class FigniViewerElement extends HTMLElement {
panel.style.maxWidth = `${baseWidth / 2}px`
panel.style.maxHeight = `calc(${
(baseHeight - hotspotHeight) / 2
}px - 1rem)`
}px - 1em)`
} else if (v === 'top' && (h === 'left' || h === 'right')) {
panel.style.maxWidth = `calc(${
(baseWidth - hotspotWidth) / 2
}px - 0.5rem)`
}px - 0.5em)`
panel.style.maxHeight = `calc(${
(baseHeight - hotspotHeight) / 2
}px - 2.25rem)`
}px - 2.25em)`
} else if (v === 'middle' && h == 'center') {
panel.style.maxWidth = `${baseWidth / 2}px`
panel.style.maxHeight = `calc(${baseHeight}px - 4rem)`
panel.style.maxHeight = `calc(${baseHeight}px - 4em)`
} else if (v === 'middle' && (h === 'left' || h === 'right')) {
panel.style.maxWidth = `calc(${
(baseWidth - hotspotWidth) / 2
}px - 1.5rem)`
panel.style.maxHeight = `calc(${baseHeight}px - 4rem)`
}px - 1.5em)`
panel.style.maxHeight = `calc(${baseHeight}px - 4em)`
} else if (v === 'bottom' && h == 'center') {
panel.style.maxWidth = `${baseWidth / 2}px`
panel.style.maxHeight = `calc(${
(baseHeight - hotspotHeight) / 2
}px - 1rem)`
}px - 1em)`
} else if (v === 'bottom' && (h === 'left' || h === 'right')) {
panel.style.maxWidth = `calc(${
(baseWidth - hotspotWidth) / 2
}px - 0.5rem)`
}px - 0.5em)`
panel.style.maxHeight = `calc(${
(baseHeight - hotspotHeight) / 2
}px - 2.25rem)`
}px - 2.25em)`
}
panel.classList.remove('figni-viewer-panel-hide')
} else {
Expand Down Expand Up @@ -1486,7 +1486,7 @@ export default class FigniViewerElement extends HTMLElement {
// 矢印アイコンを追加
const btnArrow = document.createElement('span')
btnArrow.innerHTML = SVG_HELP_ARROW
btnArrow.style.height = '1.25rem'
btnArrow.style.height = '1.25em'
titleHolder.appendChild(btnArrow)
// クリックイベントを設定
helpBtn.onclick = () => {
Expand All @@ -1513,7 +1513,7 @@ export default class FigniViewerElement extends HTMLElement {
// はてなアイコンを追加
const btnIcon = document.createElement('span')
btnIcon.innerHTML = SVG_HELP_UNKNOWN_ICON
btnIcon.style.height = '1.75rem'
btnIcon.style.height = '1.75em'
unknownBtn.appendChild(btnIcon)
// テキストを追加
const btnText = document.createElement('h4')
Expand All @@ -1537,7 +1537,7 @@ export default class FigniViewerElement extends HTMLElement {
figniLogo.setAttribute('target', '_blank')
figniLogo.innerHTML = SVG_FIGNI_LOGO
figniLogo.style.display = 'block'
figniLogo.style.width = '3rem'
figniLogo.style.width = '3em'
footer.appendChild(figniLogo)
page.appendChild(footer)
}
Expand Down Expand Up @@ -1615,7 +1615,7 @@ export default class FigniViewerElement extends HTMLElement {
// はてなアイコンを追加
const btnIcon = document.createElement('span')
btnIcon.innerHTML = SVG_HELP_UNKNOWN_ICON
btnIcon.style.height = '1.75rem'
btnIcon.style.height = '1.75em'
unknownBtn.appendChild(btnIcon)
// テキストを追加
const btnText = document.createElement('h4')
Expand Down Expand Up @@ -1673,7 +1673,7 @@ export default class FigniViewerElement extends HTMLElement {
// はてなアイコンを追加
const btnIcon = document.createElement('span')
btnIcon.innerHTML = SVG_HELP_UNKNOWN_ICON
btnIcon.style.height = '1.75rem'
btnIcon.style.height = '1.75em'
unknownBtn.appendChild(btnIcon)
// テキストを追加
const btnText = document.createElement('h4')
Expand Down Expand Up @@ -1751,7 +1751,7 @@ export default class FigniViewerElement extends HTMLElement {
// はてなアイコンを追加
const btnIcon = document.createElement('span')
btnIcon.innerHTML = SVG_HELP_UNKNOWN_ICON
btnIcon.style.height = '1.75rem'
btnIcon.style.height = '1.75em'
unknownBtn.appendChild(btnIcon)
// テキストを追加
const btnText = document.createElement('h4')
Expand Down
Loading