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

              
                <h1>H2R Graphics custom 3D text effects with CSS</h1>
<div class="time">05:20</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap');

/* Reset */

* {
  margin: 0;
  padding: 0;
}

/* Better border sizing - https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */

html {
  box-sizing: border-box
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* Generic styles for codepen */

html {
  font: 16px/1.5 "Fira Sans", sans-serif;
}

body, table, option, form, th, td, label, input, textarea {
  font: inherit;
}

body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lets get on with it */

@function make_textshadow($loop1, $loop2, $loop1_color, $loop2_color) {

  $shadow: '';
  $s1: '';
  $s2: '';
  
  $offset_top: 0.1vw;
  $offset_left: 0.01vw;
  $blur_size: 0.01vw;
  $blur_size_large: 0.12vw;
  
  @for $i from 1 through $loop1 {
 
    $s1: $i;
    $line: $offset_left calc( #{$i} * #{$offset_top}) $blur_size $loop1_color;

    $shadow: #{$shadow}, #{$line};
 
  }
  
   @for $j from 1 through $loop2 {
 
     $s2: $j;
     $line: $offset_left calc( #{$s1+$j} * #{$offset_top}) calc(#{$j+$s1} * #{$blur_size_large}) $loop2_color;

     $shadow: #{$shadow}, #{$line};
 
  }
  
  @return $shadow;
}

:root {
    --fg-shadow-color: #DDD;
    --bg-shadow-color: rgba(60,60,60,0.1);
    --body_spacing: 3rem;
}

body {
  background: #444;
  color: #FFF;
  flex-direction: column;
}

h1 {
  font-size: 7vw;
  font-weight: 900;
  line-height: 1.2;
  position: absolute;
  top: 2vw;
  left: 5vw;
  text-shadow: make_textshadow(5, 6, var(--fg-shadow-color), var(--bg-shadow-color));
}

.time {
  font-family: "Fira Code", monospace;
  font-weight: 900;
  font-size: 14vw;
  line-height: 1;
  letter-spacing: -0.07em;
  text-shadow: make_textshadow(8, 9, var(--fg-shadow-color), var(--bg-shadow-color));
  padding: 2vw 0vw 2.5vw;
  position: absolute;
  bottom: 2vw;
  left: 5vw;
  
  &:after {
    display: block;
    content: '';
    position: absolute;
    z-index: -1;
    top: -1vw;
    left: -6vw;
    right: -6vw;
    bottom: -1vw;
    background-color: rgba(0,0,0,0.1);
    border-radius: 10vw;
    filter: blur(3vw);
  }
}
              
            
!

JS

              
                /*

This Pen contains the styling for a theme for "H2R Graphics" app

https://h2r.graphics/
Run your entire graphics workflow through one app

---

My name is Konstantin Dankov and I am NOT affiliated with H2R Graphics
I just like the app and use it. Decided to share my work so that others can benefit from it.

If you want to support me or say thanks you can get me a coffee ;) - https://www.paypal.com/paypalme/konstantindankov
If you like to ask me a question you can find me in Discord - Koko#7207 or Twitter - @kdankov

*/
              
            
!
999px

Console