-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable heatmap in mobile device as it display terribly.
- Loading branch information
1 parent
f533eb2
commit 2dd1e08
Showing
1 changed file
with
57 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,61 @@ | ||
<!-- credit to https://blog.douchi.space/hugo-blog-heatmap/ --> | ||
<div> | ||
<div style="display: flex; justify-content: center; align-items: center"> | ||
<p style="margin-right: 15px; margin-bottom: 0; color: #333; padding: 8px"> | ||
{{ default "Article Activity" (.Get "title_text") }} | ||
</p> | ||
<select | ||
id="yearSelector" | ||
style=" | ||
padding: 8px 12px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
cursor: pointer; | ||
transition: border-color 0.3s ease, box-shadow 0.3s ease; | ||
" | ||
> | ||
<!-- Years will be dynamically added here --> | ||
</select> | ||
</div> | ||
<div | ||
id="heatmap" | ||
style=" | ||
display: block; | ||
height: 150px; | ||
width: 75%; | ||
padding: 2px; | ||
margin: 0 auto; | ||
text-align: center; | ||
" | ||
></div> | ||
</div> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Responsive Heatmap</title> | ||
<style> | ||
/* Default styles */ | ||
.heatmap-container { | ||
display: block; | ||
} | ||
|
||
/* For mobile phones and iPads */ | ||
@media only screen and (max-width: 1024px) { | ||
.heatmap-container { | ||
display: none; | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="heatmap-container"> | ||
<div> | ||
<div style="display: flex; justify-content: center; align-items: center"> | ||
<p style="margin-right: 15px; margin-bottom: 0; color: #333; padding: 8px"> | ||
{{ default "Article Activity" (.Get "title_text") }} | ||
</p> | ||
<select | ||
id="yearSelector" | ||
style=" | ||
padding: 8px 12px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
cursor: pointer; | ||
transition: border-color 0.3s ease, box-shadow 0.3s ease; | ||
" | ||
> | ||
<!-- Years will be dynamically added here --> | ||
</select> | ||
</div> | ||
<div | ||
id="heatmap" | ||
style=" | ||
display: block; | ||
height: 150px; | ||
width: 75%; | ||
padding: 2px; | ||
margin: 0 auto; | ||
text-align: center; | ||
" | ||
></div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script> | ||
<script type="text/javascript"> | ||
var chartDom = document.getElementById('heatmap'); | ||
|