I've got this media query that checks if the device is mobile.
@media only screen and (hover: none) and (pointer: coarse) {
body {
font-size: 40px;
color: purple; /*added this for debugging */
}
#navbar {
justify-content: center;
}
#nav-left {
display: none;
}
#nav-right {
font-size: 0.75em;
}
#projects {
grid-template-columns: 400px 400px;
grid-template-rows: 400px 400px /*400px 400px*/;
}
.project-wrapper {
height: auto;
width: auto;
pointer-events: none;
cursor: default;
text-decoration: none;
}
.project-tile:hover .project-wrapper {
animation-name: delay_link;
animation-fill-mode: forwards;
animation-duration: 0.7s;
}
@keyframes delay_link {
90% {
pointer-events: none;
}
100% {
pointer-events: auto;
}
}
}
It fires when I emulate a mobile device in Chrome DevTools. Notice the text turning purple.
However, if I open the page on my phone it won't work. How comes that the emulated device is different from the actual device?
My full code: https://codepen.io/julian-sz/pen/vYxOLQx?editors=1101
My full code (debug view): https://cdpn.io/julian-sz/debug/vYxOLQx/dXkqBaPZYZPM
My Chrome version: 91.0.4472.77 (Official build) (64-Bit) (cohort: 91_Win_77)
My Chrome version on Android (Xiaomi Mi A2 Lite): 90.0.4430.210