Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
josephernest authored Aug 6, 2022
1 parent ab6c40b commit f9ed751
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions demo2/footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script src="../swap.js"></script>
<script>
Swap.loaders['.screen2'] = () => {
console.log("screen2 loaded");
let screen2_interval = setInterval(() => { console.log("screen2 repeat every 1000 ms"); }, 1000);
return () => { console.log("screen2 clear"); clearInterval(screen2_interval); }; // unloader function
}
Swap.loaders['.screen3'] = () => {
console.log("screen3 loaded");
let screen3_interval = setInterval(() => { console.log("screen3 repeat every 200 ms"); }, 200);
return () => { console.log("screen3 clear"); clearInterval(screen3_interval); }; // unloader function
}
</script>
</body>
</html>
8 changes: 8 additions & 0 deletions demo2/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<a href="index.php" swap-target="body" swap-history="true">Index</a>
<a href="screen2.php" swap-target="#container2" swap-history="true">Go to screen2</a>
<a href="screen3.php" swap-target="#container3" swap-history="true">Go to screen3</a>
<a href="javascript:history.back();">History back</a>
6 changes: 6 additions & 0 deletions demo2/screen2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php include "header.php" ?>

<div id="container2" class="screen2">Screen2</div>
<div id="container3">CONTAINER3</div>

<?php include "footer.php" ?>
6 changes: 6 additions & 0 deletions demo2/screen3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php include "header.php" ?>

<div id="container2">CONTAINER2</div>
<div id="container3" class="screen3">Screen3</div>

<?php include "footer.php" ?>

0 comments on commit f9ed751

Please sign in to comment.