-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
<meta charset="utf-8"> | ||
<meta name="viewport" | ||
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> | ||
<style> | ||
html, | ||
body, | ||
#root, | ||
.app { | ||
position: relative; | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
color: #333; | ||
background: #fdfdfd; | ||
} | ||
|
||
.app { | ||
transform-style: preserve-3d; | ||
} | ||
|
||
.viewer { | ||
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.viewport { | ||
width: 600px; | ||
height: 800px; | ||
/* height: 600px; */ | ||
border: 1px solid #eee; | ||
box-sizing: border-box; | ||
} | ||
|
||
.reset { | ||
position: absolute !important; | ||
background: #333; | ||
width: 30px; | ||
height: 30px; | ||
z-index: 1; | ||
border-right: 1px solid #444; | ||
border-bottom: 1px solid #444; | ||
box-sizing: border-box; | ||
cursor: pointer; | ||
} | ||
|
||
.guides { | ||
position: absolute !important; | ||
top: 0; | ||
left: 0; | ||
transform: translateZ(1px); | ||
} | ||
|
||
.guides.horizontal { | ||
left: 30px; | ||
width: calc(100% - 30px); | ||
height: 30px !important; | ||
} | ||
|
||
.guides.vertical { | ||
top: 30px; | ||
height: calc(100% - 30px); | ||
width: 30px !important; | ||
} | ||
|
||
/* | ||
.scena-vertical .scena-guide { | ||
height: calc(100% + 30px)!important; | ||
top: -30px; | ||
} | ||
.scena-horizontal .scena-guide { | ||
width: calc(100% + 30px)!important; | ||
top: -30px; | ||
} */ | ||
.viewer { | ||
position: absolute !important; | ||
left: 30px; | ||
top: 30px; | ||
width: calc(100% - 30px); | ||
height: calc(100% - 30px); | ||
} | ||
|
||
.viewport { | ||
text-align: center; | ||
} | ||
|
||
.viewport p { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.buttons { | ||
padding: 5px; | ||
} | ||
|
||
.button { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
border: 2px solid #333; | ||
color: #333; | ||
font-weight: bold; | ||
text-decoration: none; | ||
font-size: 14px; | ||
letter-spacing: 1px; | ||
margin: 2px; | ||
} | ||
|
||
.viewport p.description { | ||
text-align: left; | ||
padding: 5px 20px; | ||
box-sizing: border-box; | ||
} | ||
|
||
.component { | ||
display: inline-block; | ||
padding: 5px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.component p { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.component .logo { | ||
position: relative; | ||
width: 150px; | ||
height: 150px; | ||
} | ||
|
||
.component img { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
width: 100%; | ||
height: auto; | ||
max-height: 100%; | ||
transform: translate(-50%, -50%); | ||
box-sizing: border-box; | ||
} | ||
|
||
.component a { | ||
color: black; | ||
font-weight: bold; | ||
} | ||
</style> | ||
<div class="app"> | ||
<div class="reset"></div> | ||
<div class="guides horizontal"></div> | ||
<div class="guides vertical"></div> | ||
|
||
</div> | ||
<script src ="../../dist/guides.js"></script> | ||
<script> | ||
|
||
const horizontalGuides = new Guides(document.querySelector(".guides.horizontal"), { | ||
snapThreshold: 5, | ||
snaps: [0, 300, 600], | ||
displayDragPos: true, | ||
dragPosFormat: v => `${v}px`, | ||
}).on("changeGuides", ({ guides }) => { | ||
console.log("ho", guides); | ||
// moveable.horizontalGuidelines = guides; | ||
}); | ||
|
||
const verticalGuides = new Guides(document.querySelector(".guides.vertical"), { | ||
type: "vertical", | ||
snapThreshold: 5, | ||
snaps: [0, 200, 400], | ||
displayDragPos: true, | ||
dragPosFormat: v => `${v}px`, | ||
}).on("changeGuides", ({ guides }) => { | ||
console.log("ver", guides); | ||
}); | ||
|
||
</script> |