forked from laysense/laysense.cn
19 lines
672 B
JavaScript
19 lines
672 B
JavaScript
'use strict';
|
|
|
|
const homeHero = document.querySelector('#main-content > .hero-home');
|
|
const homeTitle = homeHero?.querySelector('.hero-copy h1');
|
|
if (homeTitle) {
|
|
const cursor = document.createElement('span');
|
|
cursor.className = 'home-cursor';
|
|
cursor.setAttribute('aria-hidden', 'true');
|
|
cursor.textContent = '_';
|
|
homeTitle.append(cursor);
|
|
}
|
|
|
|
const homeImage = homeHero?.querySelector('.hero-visual > img');
|
|
if (homeImage && new URL(homeImage.src).pathname === HOME_IMAGE_PATH) {
|
|
homeImage.insertAdjacentHTML('afterend', HOME_MOTION_SVG);
|
|
}
|
|
|
|
document.querySelector('#main-content > .hero-home ~ #about')?.setAttribute('data-moment', 'iris-opens');
|