Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <link href="https://fonts.googleapis.com/css2?family=Heebo:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<div class="page">
  <div class="frame" id="one">
    <div class="header">
      <div class="role">
        
<!--You can only select one troop type per data card, ensure only 1 troop type is uncommented-->
        
        <!--<div class="hq" title="HQ" alt-text="HQ"></div>-->
        <div class="assault" title="Assault" alt-text="Assault"></div>
        <!--<div class="elites" title="Elites" alt-text="Elites"></div>-->
        <!--<div class="fast-attack" title="Fast Attack" alt-text="Fast Attack"></div>-->
        <!--<div class="dedicated-transport" title="Dedicated Transport" alt-text="Dedicated Transport"></div>-->
        <!--<div class="flyer" title="Flyer" alt-text="Flyer"></div>-->
        <!--<div class="heavy-support" title="Heavy Support" alt-text="Heavy Support"></div>-->
        <!--<div class="fortification" title="Fortification" alt-text="Fortification"></div>-->
        <!--<div class="lord-of-war" title="Lord of War" alt-text="Lord of War"></div>-->
      
      </div>
      <div class="name">Assault Space Marine</div>
    </div>
    <div class="label heading">
      <div class="center" id="label"><div class="m" id="icon" title='Movement' alt-text="Movement"></div></div>
      <div class="center" id="label"><div class="ws" id="icon" title='Weapon Skill' alt-text="Weapon Skill"></div></div>
      <div class="center" id="label"><div class="bs" id="icon" title='Ballistic Skill' alt-text="Ballistic Skill"></div></div>
      <div class="center" id="label"><div class="s" id="icon" title='Strength' alt-text="Strength"></div></div>
      <div class="center" id="label"><div class="t" id="icon" title='Toughness' alt-text="Toughness"></div></div>
      <div class="center" id="label"><div class="w" id="icon" title='Wounds' alt-text="Wounds"></div></div>
      <div class="center" id="label"><div class="a" id="icon" title='Attacks' alt-text="Attacks"></div></div>
      <div class="center" id="label"><div class="ld" id="icon" title='Leadership' alt-text="Leadership"></div></div>
      <div class="center" id="label"><div class="sv" id="icon" title='Save' alt-text="Save"></div></div>
    </div>
    <div class="profile">
      <div class="odd troop">
        <div class="center" id="value">6"</div>
        <div class="center" id="value">3+</div>
        <div class="center" id="value">3+</div>
        <div class="center" id="value">4</div>
        <div class="center" id="value">4</div>
        <div class="center" id="value">2</div>
        <div class="center" id="value">2</div>
        <div class="center" id="value">7</div>
        <div class="center" id="value">3+</div>
      </div>
      <div class="even troop">
        <div class="center" id="value">6"</div>
        <div class="center" id="value">3+</div>
        <div class="center" id="value">3+</div>
        <div class="center" id="value">4</div>
        <div class="center" id="value">4</div>
        <div class="center" id="value">2</div>
        <div class="center" id="value">3</div>
        <div class="center" id="value">8</div>
        <div class="center" id="value">3+</div>
      </div>
    </div>
    <div class="description">4-9 Space Marines and 1 Space Marines Sergeant with: heavy bolter; Imperial Chainsword;</br>frag grenades; krak grenades.</div>
    <div class="weapon heading">
      <div class="left" id="label">WEAPON</div>
      <div class="center" id="label">R</div>
      <div class="center" id="label">TYPE</div>
      <div class="center" id="label">S</div>
      <div class="center" id="label">AP</div>
      <div class="center" id="label">D</div>
    </div>
    <div class="profile">
      <div class="odd weapon">
        <div class="left" id="value">Heavy bolter</div>
        <div class="center" id="value">19"</div>
        <div class="center" id="value">1</div>
        <div class="center" id="value">4</div>
        <div class="center" id="value">-1</div>
        <div class="center" id="value">1</div>
      </div>
      <div class="even weapon">
        <div class="left" id="value">As. Chainsword</div>
        <div class="center" id="value">Melee</div>
        <div class="center" id="value">-</div>
        <div class="center" id="value">-</div>
        <div class="center" id="value">-1</div>
        <div class="center" id="value">1</div>
      </div>
      <div class="even weapon_desc">
        <div class="description">When the bearer fights, it makes 1 additional attack with this weapon.</div>
      </div>
      <div class="odd weapon">
        <div class="left" id="value">Frag Grenade</div>
        <div class="center" id="value">6"</div>
        <div class="center" id="value">D6</div>
        <div class="center" id="value">3</div>
        <div class="center" id="value">0</div>
        <div class="center" id="value">1</div>
      </div>
      <div class="even weapon">
        <div class="left" id="value">Krak Grenade</div>
        <div class="center" id="value">6"</div>
        <div class="center" id="value">1</div>
        <div class="center" id="value">6</div>
        <div class="center" id="value">-1</div>
        <div class="center" id="value">D3</div>
      </div>
    </div>
    <div class="footer">
      <p>Imperium, Adept Imperial &lt;chapter&gt; Primaris Space Marine, Blade Guard Veterin</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  height: 533px;
  width: 392px;
}

.page {
  display: grid;
  position: relative;
  place-items: center;
  height: 533px;
  width: 392px;
  background-color: #606060;
}

.frame {
  display: block;
  height: 498px;
  width: 354px;
  -webkit-border-radius: 17px;
  border-radius: 17px;
  background-color: #e2e2dd;
}

.header {
  display: block;
  height: 69px;
  margin: 0 15px;
}

.role {
  position: relative;
  float: left;
  width: 54px;
  height: 69px;
}

.role div {
  height: 60px;
  width: 60px;
  /*margin: auto 0;*/
  position: absolute;
  bottom: 0;
}

#icon {
  display: block;
  height: 20px;
  width: 20px;
  margin: 0 auto;
  background-repeat: no-repeat;

}


.hq {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/HQ.svg");}
.assault {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Troops.svg");}
.elites {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Elites.svg");}
.fast-attack {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Fast-Attack.svg");}
.dedicated-transport {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Dedicated-Transport.svg");}
.flyer {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Flyer.svg");}
.heavy-support {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Heavy-Support.svg");}
.fortification {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Fortification.svg");}
.lord-of-war {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Lord-of-War.svg");}

.m {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Move.svg");}
.ws {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/WeaponSkill.svg");}
.bs {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/BallisticSkill.svg");}
.s {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Strength.svg");}
.t {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Toughness.svg");}
.w {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Wounds.svg");}
.a {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Attacks.svg");}
.ld {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Leadership.svg");}
.sv {background-image: url("https://raw.githubusercontent.com/Locequen/40k-Data-Card/master/src/svg/Save.svg");}




.name {
  float: right;
  width: 255px;
  height: 56px;
  padding: 12px 0 0 0;
  border-bottom: 3px solid #000;
  line-height: 28px;
  text-transform: uppercase;
  vertical-align: middle;
  font-family: 'Heebo', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -2px;
  border-bottom: 3px solid #000;
}

.heading {
  display: grid;
  background: #b6beba;
  margin: 12px 15px 0 15px;
  grid-template-rows: 30px;
  vertical-align: middle;
  border-bottom: 2px solid #777273;
}

.label {
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
}

.weapon {
  grid-template-columns: 130px 50px 50px 30px 30px 30px;
}

.weapon #value {
  font-size: 16px;
}

.weapon_desc #desc {
  padding: 0 12px;
}

.left {
  text-align: left;
  padding-left: 8px;
}

.center {
  display: grid;
  place-items: center;
  justify-content: center;
}

#label {
 /* vertical-align: middle;
  font-family: 'Heebo', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -1px;*/

}

.profile {
  border-bottom: 2px solid #777273;
  margin: 0 15px;
}

.troop {
  display: grid;
  width: 9fr;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
  text-align: centre;
  vertical-align: middle;
  font-weight: 600;
}

.weapon {
  display: grid;
  width: 9fr;
  text-align: centre;
  vertical-align: middle;
  font-weight: 600;
}

.odd {
  background: #fff;
}

.even {
  background: #dee3e0;
}

#value {
  vertical-align: middle;
  font-family: 'Heebo', sans-serif;
  font-size: 18px;
  letter-spacing: -1px;
}

.description {
  background: #dee3e0;
  margin: 4px 15px;
  padding: 0 8px;
  vertical-align: middle;
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  font-weight: 700px;
  text-align: justify;
  letter-spacing: -1px;
  word-spacing: -1px;
  line-height: 20px;
}

.footer {
  position: absolute;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  left: 0;
  bottom: 15px;
  width: 354px;
  text-align: center;
  margin: 0 15px;
}

body {
  font-family: system-ui, sans-serif;
}
              
            
!

JS

              
                
              
            
!
999px

Console