banner
泽泽社长

泽泽社长

青空之下,人间未满,为言为空,不止摸鱼

Add Rem and Ram to xLog.

html and css#

I have previously written a plugin that adds gif animations of Rem and Ram to Typecho and WordPress. The core source code is as follows:
HTML code:

<div class="remram">
  <div class="rem"></div>
  <div class="ram"></div>
</div>

CSS code:

.remram {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    display: flex;
    position: fixed;
    justify-content: space-between;
}
/*Load image material in high resolution*/
@media (min-width: 1420px){
.remram div {
    background-repeat:no-repeat;
    background-size: 250px;
    background-image: url('./remram.gif') !important;
    width: 125px;
}
.remram .rem{
    background-position: -125px bottom;
}
.remram .ram{
    background-position: 0 bottom;
}
}

Image material:
remram

Add Rem and Ram to xLog#

Because xLog can currently only customize CSS and cannot insert custom div blocks, we can only find a workaround. I found a <div id="site-aplayer"></div> in the xLog structure, which should be prepared for the music player, but it doesn't seem to be used yet, so we can do some fancy operations on it. After being reminded, I found that adding it directly to .xlog-page is fine. I optimized the writing and reduced the amount of CSS needed.

Custom CSS as follows:

/*Load image material in high resolution*/
@media (min-width: 1280px){
.xlog-page::before, .xlog-page::after {
    position: fixed;
    top: 0;
    bottom: 0;
    content: ' ';
    background-repeat: no-repeat;
    background-size: 250px;
    background-image: url(https://xlog.app/cdn-cgi/image/width=1080,quality=75,format=auto,onerror=redirect/https://ipfs.xlog.app/ipfs/bafybeieoif32ybcbt22enk4ikytzvu4oxudlc27egg3j3t5mqgg2f6cs5i) !important;
    width: 125px;
    background-position: -125px bottom;
}
.xlog-page::after {
    background-position: 0 bottom;
    right: 0;
}
}
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.