Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jirlong committed Oct 25, 2023
1 parent 0239557 commit 965513b
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions as2/css/as2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1{
color:red;
}
13 changes: 13 additions & 0 deletions as2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<title>AS2</title>
<link rel="stylesheet" type="text/css" href="css/as2.css">
<meta charset="utf-8">
<meta viewport="width=device-width, initial-scale=1.0">
</head>
<body>
<div>
<h1>AS2</h1>
</div>
</body>
</html>
3 changes: 3 additions & 0 deletions as3/as3.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1{
color:skyblue;
}
14 changes: 14 additions & 0 deletions as3/as3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<title>AS3</title>
<link rel="stylesheet" type="text/css" href="as3.css">
<meta charset="utf-8">
<meta viewport="width=device-width, initial-scale=1.0">
</head>
<body>
<div>
<h1>AS3</h1>
<img src="imgs/gojo.webp" alt="AS3">
</div>
</body>
</html>
Binary file added as3/imgs/gojo.webp
Binary file not shown.
Binary file added sticky-top-testing/gojo.webp
Binary file not shown.
69 changes: 69 additions & 0 deletions sticky-top-testing/horizontal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sticky Top Testing</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
</head>

<body>
<img src="gojo.webp" alt="gojo" style="height:50vh;position:fixed;left:50vw;top:50px;transform: translateX(-50%);">
<div class="row" style="height:1000vh">
<div class="sticky-top col-6" style="height:100vh;overflow:hidden;">
<div id="horizon1" style="height:100vh;width:300vw;position:absolute;left:-200vw">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:160vw;top:50px;opacity:1">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:170vw;top:50px;opacity:0.9">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:180vw;top:50px;opacity:0.8">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:190vw;top:50px;opacity:0.7">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:200vw;top:50px;opacity:0.6">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:210vw;top:50px;opacity:0.5">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:220vw;top:50px;opacity:0.4">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:230vw;top:50px;opacity:0.3">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:240vw;top:50px;opacity:0.2">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;right:250vw;top:50px;opacity:0.1">
</div>
</div>
<div class="sticky-top col-6" style="height:100vh;overflow:hidden;">
<div id="horizon2" style="height:100vh;width:300vw;position:absolute;left:0">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:200vw;top:50px;opacity:0.1">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:190vw;top:50px;opacity:0.2">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:180vw;top:50px;opacity:0.3">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:170vw;top:50px;opacity:0.4">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:160vw;top:50px;opacity:0.5">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:150vw;top:50px;opacity:0.6">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:140vw;top:50px;opacity:0.7">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:130vw;top:50px;opacity:0.8">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:120vw;top:50px;opacity:0.9">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:110vw;top:50px;opacity:1.0">
</div>
</div>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>

<script>
$(document).ready(function(){
var max_scroll = $(document).height();
console.log(max_scroll);
console.log($(document).height());
console.log("win height:"+$(window).height());
var max_w = $("#horizon1").width() - $(window).width();
// console.log(max_w);
$(window).scroll(function(){
var scroll = $(window).scrollTop();
var new_left = scroll / max_scroll * max_w;
console.log(new_left);
$("#horizon1").css("left", -max_w + new_left);
$("#horizon2").css("left", -1*new_left);
})
});
</script>




<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>

</html>
68 changes: 68 additions & 0 deletions sticky-top-testing/sticky.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Sticky Top Testing</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
</head>
<body>

<div style="height:100vh;width:100vw;background-color:skyblue"></div>
<div style="height:1000vh;width:100vw">
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.1">
</div>
</div>

<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.2">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.3">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.4">
</div>
</div>
<div style="height:50vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.5">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.6">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.7">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.8">
</div>
</div>
<div style="height:100vh">
<div class="sticky-top">
<img src="gojo.webp" alt="gojo" style="height:50vh;position:absolute;left:20%;top:100px;opacity:0.9">
</div>
</div>

</div>
<div style="height:100vh;width:100vw;background-color:skyblue"></div>




<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>

0 comments on commit 965513b

Please sign in to comment.