Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vtbag/website. The @vtbag website. ⭐️ Please star to support this work! ⭐️
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180---import AnimatedSvg from "@/components/AnimatedSvg.astro";---
<p> Cross-document navigation with the View Transition API (Level 2) enables smooth transitions between pages, bringing the seamless look and feel of single-page applications to your multi-page app.</p>
<div class="animations"> <video width="200" height="112.5" controls loop autoplay playsinline> <source src="/video.mp4" type="video/mp4" />Your browser does not support the video tag.</video > <AnimatedSvg /></div>
<p> Some HTML elements on your page may change their internal state over time or in response to user interactions. However, when transitioning to the next page, this dynamic state is typically lost and reverts to the static values defined in the HTML.</p>
<p> This can affect: <ul> <li> Element properties, such as the open or closed state of detail elements (e.g., those in the navigation bar), and specific CSS classes like <code id="light">light</code ><code id="dark">dark</code>. </li> <li>CSS properties, such as the user's preferred color scheme.</li> <li>The position of scrollbars, e.g. in long navigation bars</li> <li> The current playback time of media elements, including audio and video. </li> <li> The current playback time of CSS animations, transitions and animated SVGs. </li> <li>The state and content of input fields.</li> <li>The content of iframes.</li> </ul></p> ```
<form id="exampleForm"> <div class="form-group"> <label for="name">Name:</label> <input type="text" id="name" name="name" placeholder="Enter your name" required /> </div> <div class="form-group"> <label for="gender">Gender:</label> <select id="gender" name="gender"> <option value="male" selected>Male</option> <option value="female">Female</option> <option value="other">Other</option> </select> </div> <div class="form-group"> <label>Interests:</label> <div> <input type="checkbox" id="interest1" name="interests" value="coding" checked /> <label for="interest1">Coding</label> </div> <div> <input type="checkbox" id="interest2" name="interests" value="music" /> <label for="interest2">Music</label> </div> <div> <input type="checkbox" id="interest3" name="interests" value="sports" /> <label for="interest3">Sports</label> </div> </div> <div class="form-group"> <label>Subscription:</label> <div> <input type="radio" id="subscribeYes" name="subscribe" value="yes" checked /> <label for="subscribeYes">Yes</label> </div> <div> <input type="radio" id="subscribeNo" name="subscribe" value="no" /> <label for="subscribeNo">No</label> </div> </div> <div class="form-group"> <label for="comments">Comments:</label> <textarea id="comments" name="comments" placeholder="Enter your comments" >This is a sample comment.</textarea > </div></form>
<style is:global> .animations { display: flex; flex-direction: row; justify-content: space-around; margin-bottom: 20px; }
.animations > * { border: inset 10px #8888; }
#dark, #light { display: none; } :root.dark #dark, :root:not(.dark) #light { display: inline; } form { max-width: 600px; margin: 0 auto; padding: 1rem; background-color: var(--accent-background-color); border: 1px solid #8888; border-radius: 8px; }
.form-group { margin-bottom: 1rem; display: flex; }
label { display: inline; margin-right: 2.5rem; font-weight: bold; }
input[type="text"], input[type="email"], input[type="password"], select, textarea { width: 100%; padding: 0.5rem; border: 1px solid #8888; border-radius: 4px; box-sizing: border-box; }
input[type="checkbox"], input[type="radio"] { margin-right: 0.5rem; }
textarea { height: 100px; }
select { appearance: none; }</style>