Base: Add a test page for CSS transforms

This also acts as a little stress test for flexbox layout :^)
This commit is contained in:
Simon Wanner 2022-03-21 22:26:52 +01:00 committed by Andreas Kling
parent 4f348f1733
commit bc5d39493b
Notes: sideshowbarker 2024-07-17 16:58:14 +09:00
2 changed files with 170 additions and 0 deletions

View File

@ -0,0 +1,169 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
padding: 0;
margin: 0;
}
.container {
display: inline-flex;
flex-direction: column;
width: 60em;
}
.example {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
margin: 4em 5em;
background-color: #ccc;
}
.example > style {
display: block;
font-family: monospace;
margin: 0 3em 0 10em;
}
.box {
display: block;
width: 3em;
height: 3em;
border: solid 1px;
background-color: palegreen;
}
.original {
position: absolute;
left: 0;
top: 0;
opacity: 20%;
}
</style>
</head>
<body>
<p>This is based on the examples for <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin">transform-origin</a>
on MDN</p>
<div class="container">
<div class="example">
<div>
<div id="box1" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box1 {
transform: none;
}</style>
</div>
<div class="example">
<div>
<div id="box2" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box2 {
transform: scale(1.7);
}</style>
</div>
<div class="example">
<div>
<div id="box3" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box3 {
transform: scale(1.7);
transform-origin: 0 0;
}</style>
</div>
<div class="example">
<div>
<div id="box4" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box4 {
transform: scale(1.7);
transform-origin: 100% -30%;
}</style>
</div>
<div class="example">
<div>
<div id="box5" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box5 {
transform: translate(20px, 20px);
}</style>
</div>
<div class="example">
<div>
<div id="box6" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box6 {
transform: translate(50%, 10%);
}</style>
</div>
<div class="example">
<div>
<div id="box7" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box7 {
transform: rotate(30deg);
}</style>
</div>
<div class="example">
<div>
<div id="box8" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box8 {
transform: rotate(30deg);
transform-origin: 0 0;
}</style>
</div>
<div class="example">
<div>
<div id="box9" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box9 {
transform: rotate(30deg);
transform-origin: 100% 100%;
}</style>
</div>
<div class="example">
<div>
<div id="box10" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box10 {
transform: rotate(30deg);
transform-origin: -1em -3em;
}</style>
</div>
<div class="example">
<div>
<div id="box11" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box11 {
transform: skewX(50deg);
transform-origin: 100% -30%;
}</style>
</div>
<div class="example">
<div>
<div id="box12" class="box">&nbsp;</div>
<div class="box original">&nbsp;</div>
</div>
<style>#box12 {
transform: skewY(50deg);
transform-origin: 100% -30%;
}</style>
</div>
</div>
</body>
</html>

View File

@ -124,6 +124,7 @@
<li><a href="clear-1.html">Float clearing</a></li>
<li><a href="overflow.html">Overflow</a></li>
<li><a href="image-rendering.html">image-rendering property</a></li>
<li><a href="transform.html">Transforms</a></li>
<li><h3>Features</h3></li>
<li><a href="css.html">Basic functionality</a></li>
<li><a href="colors.html">css colors</a></li>