Skip to content

Commit 156a2d8

Browse files
committed
Update: optimize layout, added more animation
1 parent 659480b commit 156a2d8

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

static/css/animate.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!--Import materialize.css-->
88
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> -->
99
<link type="text/css" rel="stylesheet" href="static/css/materialize.min.css" media="screen,projection"/>
10+
<link type="text/css" rel="stylesheet" href="static/css/animate.min.css" media="screen,projection"/>
1011
</head>
1112
<body onload="loaded()">
1213
<script type="text/javascript" src="static/js/materialize.min.js"></script>
@@ -37,30 +38,31 @@
3738
}
3839
function onUpdate(jsonObject){
3940
M.Toast.dismissAll();
40-
M.toast({html: '<span style="width:5em;height:5em;"> '+
41+
M.toast({html: '<span style="width:5em;height:5em;z-index:5;"> '+
4142
'<img src="' + jsonObject.picUrl + '" style="width:5em;height:5em;"> '+
4243
'</span> '+
43-
'<div style="padding-left:1em;" class="valign-wrapper center-align"> '+
44-
'<font style="padding-right:1em;padding-bottom:0.5em;line-height: 60%;"> '+
45-
'<h5 style="margin: 0;"> '+
46-
jsonObject.name + ' - ' + jsonObject.artists+
47-
'</h4> '+
48-
'<br/> '+
49-
jsonObject.album_name+
44+
'<div style="padding-left:1em;padding-right:1em;z-index:3;width:100%;max-width:100%;" class="valign-wrapper truncate"> '+
45+
'<font style="line-height: 1.5em;" class="animate__animated animate__fadeInRight animate__fast truncate"> '+
46+
'<font class="teal-text accent-4" id="artists" style="font-weight: 500;">' + jsonObject.artists + '</font><br/>' +
47+
'<h5 style="margin: 0;" class="truncate"> '+
48+
jsonObject.name +
49+
'</h5> '+
5050
'</font> '+
5151
'<div>',
52-
classes: 'blue-grey darken-4 z-depth-3 blue-text text-lighten-5 right', displayLength: 300000});
52+
classes: 'blue-grey darken-4 z-depth-3 blue-text text-lighten-5', displayLength: 600000});
5353
}
5454
</script>
5555
<style>
5656
#toast-container {
5757
margin-right: 0;
58-
max-width: 30%;
58+
width: 20%;
59+
max-width: 20%;
5960
}
6061

6162
#toast-container > div.toast {
6263
padding:0;
6364
margin:0;
65+
font-weight: 300;
6466
}
6567
</style>
6668
</body>

0 commit comments

Comments
 (0)