Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jrlarano committed Mar 22, 2024
1 parent 311588e commit 9a2e619
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 64 deletions.
62 changes: 0 additions & 62 deletions lib/kits/core-ui/page-decorations.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,68 +26,6 @@

.sgn-pagedecoration-hidden
display none


.sgn-pagedecoration-hotspot
position absolute
z-index 99
box-shadow unset
border 0
opacity 1

.sgn-pagedecoration-hotspot-link
text-decoration none
font-size 14px



.sgn-pagedecoration-hotspot-link-label
outline 0
background-color #fff
color #3e3e3e
border-radius 12px
padding 8px
box-shadow rgba(0, 0, 0, 0.4) 0px 5px 16px, rgba(0, 0, 0, 0.2) 0px 0px 1px
white-space nowrap
overflow hidden
text-overflow ellipsis
margin-left auto
margin-right auto
opacity 0

.sgn-pagedecoration-hotspot-link-content
display flex
align-items flex-end
padding 0.5rem

&:hover
background-color rgba(#fff, 0.1)
box-shadow 0 0 15px rgba(#000, 0.3)
border-radius 4px
border 2px solid rgba(#fff, 0.8)

.sgn-pagedecoration-hotspot-link-label
animation-name sgn-animate-pagedecoration
animation-timing-function ease
animation-duration .1s
opacity 1

.sgn-pagedecoration-hotspot-link-icon
position absolute
right 4px
top 4px
color #3e3e3e
border-radius 6px
padding 6px
background-color #fff
box-shadow rgba(0, 0, 0, 0.4) 0px 5px 16px, rgba(0, 0, 0, 0.2) 0px 0px 1px

svg
width 20px





@keyframes sgn-animate-pagedecoration
0%
Expand Down
4 changes: 2 additions & 2 deletions lib/kits/paged-publication/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class Bootstrapper {
});
}

transformPageDecrationHotspots(pageDecorations: V2PageDecoration[]) {
transformPageDecorationHotspots(pageDecorations: V2PageDecoration[]) {
const filteredPageDecorations = pageDecorations?.filter(
(pageDecoration) => pageDecoration.hotspots?.length
);
Expand Down Expand Up @@ -89,7 +89,7 @@ export default class Bootstrapper {

if (pageDecorations?.length) {
pageDecorationHotspots =
this.transformPageDecrationHotspots(pageDecorations);
this.transformPageDecorationHotspots(pageDecorations);

if (pageDecorationHotspots.length) {
hotspots = hotspots.concat(pageDecorationHotspots);
Expand Down
55 changes: 55 additions & 0 deletions lib/kits/paged-publication/viewer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,61 @@
&:hover
opacity 1

.sgn-pagedecoration-hotspot
position absolute
z-index 99
box-shadow unset
border 0
opacity 1

.sgn-pagedecoration-hotspot-link
text-decoration none
font-size 14px

.sgn-pagedecoration-hotspot-link-label
outline 0
background-color #fff
color #3e3e3e
border-radius 12px
padding 8px
box-shadow rgba(0, 0, 0, 0.4) 0px 5px 16px, rgba(0, 0, 0, 0.2) 0px 0px 1px
white-space nowrap
overflow hidden
text-overflow ellipsis
margin-left auto
margin-right auto
opacity 0

.sgn-pagedecoration-hotspot-link-content
display flex
align-items flex-end
padding 0.5rem

&:hover
background-color rgba(#fff, 0.1)
box-shadow 0 0 15px rgba(#000, 0.3)
border-radius 4px
border 2px solid rgba(#fff, 0.8)

.sgn-pagedecoration-hotspot-link-label
animation-name sgn-animate-pagedecoration
animation-timing-function ease
animation-duration .1s
opacity 1

.sgn-pagedecoration-hotspot-link-icon
position absolute
right 4px
top 4px
color #3e3e3e
border-radius 6px
padding 6px
background-color #fff
box-shadow rgba(0, 0, 0, 0.4) 0px 5px 16px, rgba(0, 0, 0, 0.2) 0px 0px 1px

svg
width 20px

@media (pointer: coarse)
.sgn-pp__hotspot
opacity 0 !important
Expand Down

0 comments on commit 9a2e619

Please sign in to comment.