| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1, user-scalable=no"
- />
- <title>Hero animation</title>
- <script type="module" src="./index.js"></script>
- <style>
- {
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- }
- html,
- body {
- height: 100%;
- margin: 0;
- }
- body {
- background: #fff;
- font-family: sans-serif;
- }
- .page-container {
- width: 100%;
- position: relative;
- background: #fff;
- }
- @media (min-width: 28em), @media (min-height: 38em) {
- body {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background: #aaaaaa;
- position: relative;
- }
- .page-container {
- box-shadow: 0 0 1em rgba(0, 0, 0, 0.5);
- width: 28em;
- min-height: 38em;
- height: 38em;
- }
- }
- .page {
- background: #fff;
- transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
- width: 100%;
- height: 100%;
- }
- h2 {
- font-size: 1.1em;
- margin: 0.2em 0;
- }
- .header {
- height: 3.5em;
- background: #1293ea;
- overflow: hidden;
- }
- .header-content {
- width: 100%;
- box-sizing: border-box;
- padding: 0.4em 0.8em;
- color: #fff;
- display: flex;
- align-items: center;
- position: absolute;
- transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
- }
- .header h1 {
- font-weight: normal;
- margin: 0;
- font-size: 1.5em;
- line-height: 1.8em;
- }
- .header-title {
- color: #fff;
- font-size: 1.5em;
- line-height: 1.8em;
- transition: transform 0.4s ease-in-out;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .header .rank {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 2.7em;
- height: 2.7em;
- margin-right: 0.5em;
- position: relative;
- }
- .header .rank-circle {
- position: absolute;
- background: #fff;
- width: 2.7em;
- height: 2.7em;
- border-radius: 1.35em;
- margin-right: 0.5em;
- transition: transform 0.4s ease-in-out;
- top: 0;
- left: 0;
- }
- .header-rank {
- z-index: 2;
- color: #1293ea;
- font-size: 1.5em;
- }
- .header .close {
- line-height: 1.8em;
- cursor: pointer;
- text-align: center;
- width: 1.8em;
- height: 1.8em;
- border-radius: 0.9em;
- background: rgba(0, 0, 0, 0.5);
- transition: transform 0.4s ease-in-out;
- }
- .hero {
- transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
- }
- .page-content {
- position: relative;
- overflow: hidden;
- width: 100%;
- height: calc(100% - 3.5em);
- }
- .list {
- position: absolute;
- width: 100%;
- transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
- }
- .desc {
- position: absolute;
- transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
- padding: 1em;
- }
- .spacer {
- flex: 1;
- }
- .row {
- cursor: pointer;
- box-sizing: border-box;
- padding: 1em;
- }
- .row:not(:first-child) {
- border-top: 1px solid #eeeeee;
- }
- .row div {
- display: inline-block;
- }
- .row > div:nth-child(1) {
- text-align: center;
- margin-right: 1em;
- width: 1em;
- }
- </style>
- </head>
- <body>
- <div id="container"></div>
- </body>
- </html>
|