rotate.uvue 1.9 KB
Newer Older
1 2
<template>
  <scroll-view class="page">
3 4 5 6
    <view class="trace">
      <view class="base reserve">
        <text class="reserve-text">rotate(20deg)</text>
        <text class="reserve-text">转变前位置</text>
7
      </view>
8 9 10
      <view class="base reserve">
        <text class="reserve-text">rotateX(50deg)</text>
        <text class="reserve-text">转变前位置</text>
11
      </view>
12 13 14
      <view class="base reserve">
        <text class="reserve-text">rotateY(50deg)</text>
        <text class="reserve-text">转变前位置</text>
15
      </view>
16 17 18
      <view class="base reserve">
        <text class="reserve-text">rotateZ(50deg)</text>
        <text class="reserve-text">转变前位置</text>
19
      </view>
20
    </view>
21

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    <view class="base transform" style="transform: rotate(20deg)">
      <text>rotate(20deg)</text>
      <text>转变后位置</text>
    </view>
    <view class="base transform" style="transform: rotateX(50deg)">
      <text>rotateX(50deg)</text>
      <text>转变后位置</text>
    </view>
    <view class="base transform" style="transform: rotateY(50deg)">
      <text>rotateY(50deg)</text>
      <text>转变后位置</text>
    </view>
    <view class="base transform" style="transform: rotateZ(50deg)">
      <text>rotateZ(50deg)</text>
      <text>转变后位置</text>
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    </view>
  </scroll-view>
</template>

<style>
  .page {
    flex: 1;
    align-items: center;
  }

  .trace {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    align-items: center;
  }

  .base {
    margin: 10px;
    width: 150px;
    height: 150px;
    align-items: center;
    justify-content: center;
  }

  .reserve {
    border: 1px dotted #588;
65
    background-color: #ddd;
66 67 68
  }

  .reserve-text {
69
    color: #ccc;
70 71 72
  }

  .transform {
73
    border: 1px solid #00f;
74 75
    background-color: rgba(0, 255, 255, 0.5);
  }
DCloud-yyl's avatar
DCloud-yyl 已提交
76
</style>