this was my code for a portifolio project I incremented the code used here for the clock logo:
setInterval( function clock() {
const v1 = new Date
const v2 = v5(v1.getHours())
const v3 = v5(v1.getMinutes())
const v4 = v5(v1.getSeconds())
const vX5 = v5x(v1.getMilliseconds())
document.getElementById('clock').textContent = v2 + ':' + v3 + ':' + v4 + ':' + vX5
}, 100);
function v5x(y, z){
if( y <100){
y = '0' + y
}
if ( z <10){
z = '0' + z
}
return z , y
}
function v5(x){
if( x <10){
x = '0' + x;
}
return x
}
var svg = document.getElementById('logoo');
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation);
if(mutation.type == "attributes" && mutation.attributeName == "data-source") {
console.log(mutation);
document.getElementById('logoo').style.display = 'none'
document.getElementById('clock').style.top = '20px'
document.getElementById('clock').style.left = '15px'
}
});
});
observer.observe(svg, {attributes: true});
html : <div class="UAGSh" id="clockDiv"> <div class="OISnsepAr sU" id="separator-x1"></div> <span class="aoiJS dKj" id="jsClockSpan-title">Clock </span><span class="aoiJS dkj" id="jsClockSpan-titlePt"> Relogio</span> <br> <span class="clock" id="clock"></span> <logo class="aUSlogo" id="logo"> <path class="a"> <svg class="USLogo" id="logoo" data-source='ILUOSHDJISMDksdloiadadlçaksd sdapokOPAD Sdkaidjsd adlkiada sod89asoia' ></svg> </path> </logo> </div>
You can do it, but I don’t think it’ll be worth it. As javascript runs on the client, you can’t rely on it just for data validation.
– André Ribeiro
If the person disables the browser’s JS, it’s gone...
– MarceloBoni
But if you have the means, the answer is welcome. I know that if you disable javascript everything goes into space. Except if logins and the like are via ajax, then the guy is required to enable javascript :)
– Wallace Maxters