arandomsite


Snippets


Custom Neocities Thumbnail


<script>
  if (/headless/i.test(window.navigator.userAgent)) {
    window.location.replace("/thumbnail/");
  }
</script>

UPDATE: The above current doesn't work anymore as Neocities changed the way they take screenshots of sites. Thanks for Ongezell for the updated version.

<script>
  const urlParams = new URLSearchParams(window.location.search);
  if (navigator.userAgent.includes('Screenjesus')) {
    window.location.replace("/thumbnail/");
  }
</script>

HTML List Tree View


HTML Code:
<ul>
  <li><div>item</div></li>
  <li><div>container</div>
    <ul>
      <li><div>container child</div></li>
    </ul>
  </li>
  <li><div>item</div></li>
</ul>

CSS Code:
ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
  position: relative;
}

li {
  list-style-type: none;
  border-left: 2px solid #FFF;
}

li ul {
  margin-left: 1em;
}

li div {
  padding-left: 1em;
  position: relative;
}

li div::before {
  content:'';
  position: absolute;
  top: 0;
  left: -2px;
  bottom: 50%;
  width: 0.75em;
  border: 2px solid #FFF;
  border-top: 0 none transparent;
  border-right: 0 none transparent;
}

ul > li:last-child {
  border-left: 2px solid transparent;
}