
<script>
  import { link } from 'svelte-spa-router';
  import Icon from '../components/Icon.svelte';
  import CodeView from '../components/CodeView.svelte';

  let cards = [1,2,3,4];
</script>

<style>

  content {
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    flex: flex-grow;
    flex-basis: 100%;
    grid-column: 1/3;
    --sub-color: #999;
    --title-color: #000;
  }

  main {
    display: flex;
    flex-direction: column;
  }

  header {
    display: flex;
    width: 100%;
    flex-direction: row;
  }

  header nav {
    flex: 1;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  header nav input {
    display: flex;
    flex-grow: 2;
    margin: 1rem;
  }

  header nav logo {
    font-weight: bold;
    font-size: 1rem;
    color: black;
  }

  header nav button {
    background-color: var(--color-bg);
    color: var(--color);
    padding: 0.5rem;
  }

  hr {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  figcaption {
    padding: 1rem;
  }

  figcaption a {
    color: var(--color-secondary);
    font-size: 0.8em;
  }

  figcaption p {
    font-weight: bold;
    margin-top: unset;
  }

  figcaption video-actions {
    color: var(--sub-color);
    font-weight: unset;
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
  }

  card {
    display: flex;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    --img-width: 120px;
    --img-height: 80px;
    --font-size: 0.8em;
  }

  card img {
    width: var(--img-width);
    height: var(--img-height);
  }

  card info {
    display: flex;
    flex-direction: column;
    padding: 0.2rem;
    color: var(--sub-color);
    font-size: var(--font-size);
  }

  card info h4 {
    font-weight: bold;
    color: var(--title-color);
    margin: 0px;
  }

  card.small {
    --img-width: 100px;
    --img-height: 70px;
    --font-size: 0.6em;
  }

  promotion {
    display: flex;
    flex-direction: column;
  }

  promotion card {
    --img-width:4rem;
    --img-height:4rem;
  }

  promotion content {
    border: unset;
    padding-left: 4rem;
  }


  comments nav {
    justify-content: left;
    font-weight: unset;
  }

  comments nav sort {
    color: var(--sub-color);
  }

  comments card {
    color: black;
    --img-width:4rem;
    --img-height:4rem;
    --font-size: 1em;
  }

  comments card p {
    color: black;
  }

  comments card reply {
    color: var(--color);
  }

  lower {
    padding: 1rem;
  }

  nav#vote-nav {
    justify-content: flex-end;
  }

  nav a,a:visited,a:active {
    text-decoration: none;
    color: var(--color-text);
  }
</style>


<content>
  <header>
    <nav>
      <b><a href="/demos/xoracademy" use:link><Icon name="edit-3" color="var(--color-text)" /> Xor.Academy</a></b>
      <input placeholder="Search">
      <ul>
        <li><a href="/demos/login" use:link><button>Log In</button></a></li>
        <li><a>Sign Up</a></li>
      </ul>
    </nav>
  </header>
  <main>
    <figure>
      <img src="https://via.placeholder.com/1280x720?text=Video">
      <figcaption>
        <a>#tag</a> <a>#anothertag</a>
        <p>Title And Stuff</p>
        <video-actions>
          <likes>Likes Other Stats</likes>
          <video-buttons>
            <Icon name="thumbs-up" color="#999" /> 1.1K
              <Icon name="thumbs-down" color="#999" /> 22
                <Icon name="corner-up-right" color="#999" /> SHARE
                <Icon name="menu" color="#999" /> SAVE
                  <Icon name="vertical-more" />
          </video-buttons>
        </video-actions>
      </figcaption>
    </figure>
    <lower>
      <promotion>
      <nav>
        <card>
        <img src="https://via.placeholder.com/64x64?text=ME">
        <info>
        <h4>Zed A. Shaw</h4>
        <subs>1 subscriber</subs>
        </card>
        <button id="subscribe">SUBSCRIBE</button>
      </nav>

      <content>
        Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur
      </content>
      </promotion>
      <hr>

      <comments>
      <nav>
        <span>125 Comments</span> <sort><Icon name="bar-chart" color="var(--sub-color)" /> SORT BY</sort>
      </nav>

      {#each cards as card}
        <card>
        <img src="https://via.placeholder.com/64x64?text=Person">
        <info>
        <h4>Guys</h4>
        <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque</p>
        <nav id="vote-nav">
          <Icon name="thumbs-up" color="var(--sub-color)" /> 233
        </nav>
        <reply><Icon name="chevron-down" /> View replies</reply>
        </info>
        </card>
      {/each}
      </comments>
    </lower>
  </main>
</content>

<CodeView source="/code/XorAcademyWatch.svelte" />
