Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
18
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@k_ui

console.log で画像表示

dunxrion/console.image みて面白いなーと思ったので、コア部分のアイディアだけメモ。

こんな感じ:

var url = 'http://qiita.com/favicon.png';
console.log('%c+', 'font-size: 0px; padding: 8px; color: transparent; background: url(' + url + ');');

スクリーンショット:
実行例のスクリーンショット

JavaScript - console.log でログに色付けたり枠付けたり - Qiita の応用で:

  • 対象の画像を背景画像に
  • パディングを画像サイズに
  • 中身の文字を透明ゼロサイズに

でできる。

しかしこれ、何に使うんだ・・・
18
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
18
Help us understand the problem. What is going on with this article?