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

              
                <div class="btn-rot">
  <a href="#">周るように光るボタン</a>
</div>
              
            
!

CSS

              
                /*** ボタンブロック ***/
.btn-rot{
  text-align: center;
  margin: 2rem;
  overflow: hidden; /*必須*/
}

/* ボタン(リンク)部分 */
.btn-rot a{
  text-decoration: none; /*下線削除*/
  display: inline-block;
  position: relative; /*疑似要素作成用*/
  padding: 0.75em 4em;
  margin: 1rem;
  background: white; /*ボタン色*/
  color: green; /*文字色*/
  font-weight: bold; /*太字*/
}

/*ボタンの枠線*/
.btn-rot a:before{
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 100%;
  height: 100%;
  border: 3px solid green;
  z-index: -2;
}

/*** ボタン線上の光沢 ***/
.btn-rot a:after{
  content: "";
  position: absolute;
  top: -30px;
  left: -100px;
  width: 100px;
  height: 30px;
  background: white; /*光沢の色は背景色*/
  filter: blur(12px); /*ぼかし*/
  animation: 3s arround-circle linear infinite; /*枠線場を周るアニメーション*/
  z-index: -1;
}

/*** 線上を回るアニメーション ***/
@keyframes arround-circle{
  /**************
  0%~40%:左上から右上
  40%~50%:右上から右下
  50%~90%:右下から左下
  90%~100%:左下から左上
  **************/
  0%{
    top: -30px;
    left: -100px;
  }
  40%{
    top: -30px;
    left: 100%;/*右まで移動*/
  }
  50%{
    top: 100%; /*下まで移動*/
    left: 100%;
  }
  90%{
    top: 100%;
    left: -100px; /*左まで移動*/
  }
  100%{
    top: -30px; /*元の位置*/
    left: -100px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console