Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

登录界面图片优化 #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/main/webapp/images/a.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/images/b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/images/c.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
943 changes: 941 additions & 2 deletions src/main/webapp/js/bootstrap.min.js

Large diffs are not rendered by default.

3,234 changes: 3,230 additions & 4 deletions src/main/webapp/js/jquery-3.2.1.min.js

Large diffs are not rendered by default.

33 changes: 30 additions & 3 deletions src/main/webapp/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<style type="text/css">
body{
background: url(images/a.jpg)repeat;
}
body {
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
#login-box {
/*border:1px solid #F00;*/
padding: 35px;
Expand All @@ -22,6 +24,31 @@
}

</style>
<script>
$(document).ready(function() {
var images = {
'morning': 'images/a.jpg',
'afternoon': 'images/b.jpg',
'evening': 'images/c.jpg'
};
var currentTime = new Date();
var hour = currentTime.getHours();
var backgroundImage;

if (hour < 8) {
// Morning time
backgroundImage = images.morning;
} else if (hour < 18) {
// Afternoon time
backgroundImage = images.afternoon;
} else {
// Evening time
backgroundImage = images.evening;
}

$('body').css('background-image', 'url(' + backgroundImage + ')');
});
</script>
</head>
<body>
<div class="container" id="top">
Expand Down