Page transition
How do I make an page transition?
What is a page transition? How do you make a page transition? This script and codes were developed by Tomoyuki Kashiro on 19 January 2023, Thursday.
Page transition - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>page transition</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class="view list-view"> <ul class="list"> <li class="list-item">page1</li> <li class="list-item">page2</li> <li class="list-item">page3</li> <li class="list-item">page4</li> <li class="list-item">page5</li> <li class="list-item">page6</li> <li class="list-item">page7</li> <li class="list-item">page8</li> <li class="list-item">page9</li> <li class="list-item">page10</li> <li class="list-item">page11</li> <li class="list-item">page12</li> <li class="list-item">page13</li> <li class="list-item">page14</li> <li class="list-item">page15</li> <li class="list-item">page16</li> <li class="list-item">page17</li> <li class="list-item">page18</li> <li class="list-item">page19</li> <li class="list-item">page20</li> </ul> </div> <div class="view data-view"> <h1>data view</h1> <button class="back">Back</button> </div>
</div> <script src="js/index.js"></script>
</body>
</html>
Page transition - Script Codes CSS Codes
.container { width: 100%; height: 100%; max-width: 400px; max-height: 600px; overflow: hidden; position: relative;
}
.container.change-view .list-view { -webkit-transform: translateX(-100%); transform: translateX(-100%);
}
.container.change-view .data-view { -webkit-transform: translateX(0); transform: translateX(0);
}
.view { width: 100%; -webkit-overflow-scrolling: touch; position: absolute; top: 0; left: 0; will-change: transform; -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.465, 0.183, 0.153, 0.946); transition: -webkit-transform 0.3s cubic-bezier(0.465, 0.183, 0.153, 0.946); transition: transform 0.3s cubic-bezier(0.465, 0.183, 0.153, 0.946); transition: transform 0.3s cubic-bezier(0.465, 0.183, 0.153, 0.946), -webkit-transform 0.3s cubic-bezier(0.465, 0.183, 0.153, 0.946);
}
.view.list-view { overflow: scroll; position: relative; max-height: 600px; width: 100%;
}
.view.data-view { -webkit-transform: translateX(100%); transform: translateX(100%);
}
.list-item { box-sizing: border-box; border-bottom: 1px solid #CCC; padding: 0 30px; line-height: 50px;
}
.list-item:nth-child(1) { border-top: 1px solid #CCC;
}
Page transition - Script Codes JS Codes
(function(){ 'use strict'; document.addEventListener('DOMContentLoaded', function(){ var openCls = 'change-view', container = document.querySelectorAll('.container')[0], list = document.querySelectorAll('.list-view')[0], back = document.querySelectorAll('.back')[0]; list.addEventListener('click', function(e){ var el = e.target; if(e.target.tagName=='LI'){ transition(); } }, false); back.addEventListener('click', function(e){ transition(); }, false); function transition(){ var isOpened = container.classList.contains(openCls); if(isOpened){ container.classList.remove(openCls); }else{ container.classList.add(openCls); } } });
})();
Developer | Tomoyuki Kashiro |
Username | Tkashiro |
Uploaded | January 19, 2023 |
Rating | 3 |
Size | 2,767 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Mostly fluid | 2,386 Kb |
CSS Slideshow | 2,721 Kb |
Spotlight Effect | 2,723 Kb |
Shadow Dom Test | 2,204 Kb |
Css resolution | 2,218 Kb |
Manage Async Animation by using jQuery.DeferredPipeline | 4,751 Kb |
Auto complete | 1,872 Kb |
3 lines menu button | 3,564 Kb |
Responsive image srcset | 3,093 Kb |
Quick sort algorithm in JavaScrip | 1,823 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS3 Animated buttons | Cguillou | 3,737 Kb |
Drag and Drop Quiz | Cgspicer | 3,837 Kb |
CSS background-size - GSAP | Jonathan | 2,209 Kb |
Halo 5 REQ Guide Bookmarklet | Cwacht | 3,993 Kb |
Expandable Left Side Bar with jQuery animate | Retrofuturistic | 2,483 Kb |
Simple personal profile | Miroot | 2,856 Kb |
Starfield old school style | Bolloxim | 5,214 Kb |
Custom checkbox example | Capelo | 3,495 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Learning FlexBox | Alex_rodrigues | 2,821 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!