Skip to content

Instantly share code, notes, and snippets.

@piyo7
Last active July 23, 2017 16:35
Show Gist options
  • Save piyo7/029a1ce1612a07d5de4c6dab63d7910e to your computer and use it in GitHub Desktop.
Save piyo7/029a1ce1612a07d5de4c6dab63d7910e to your computer and use it in GitHub Desktop.
ゆるふわチャット小説をGitHubで構築しましたので╭( ・ㅂ・)و ̑ 〜初めてのフロントエンド編〜 ref: http://qiita.com/piyo7/items/f9217292fd8224f7e9f2
.voice-left, .voice-right {
border-radius: 1em;
}
.voice-left {
border-top-left-radius: 0;
}
.voice-right {
border-top-right-radius: 0;
}
.telephone {
border: 2px solid #808080;
border-radius: 0;
}
.char05 { background-color: hsl(330, 100%, 85%); }
.char06 { background-color: hsl(210, 50%, 85%); }
.char07 { background-color: hsl( 0, 100%, 85%); }
.char08 { background-color: hsl(255, 75%, 85%); }
.char09 { background-color: hsl( 90, 100%, 85%); }
font-family: sans-serif;
font-family: arial, "Mplus 1p", sans-serif;
font-family: arial, メイリオ, "Mplus 1p", sans-serif;
<div class="chapter hoverable">
<div class="badges">
<div class="badge char06"></div>
<div class="badge char01"></div>
<div class="badge char05"></div>
<div class="badge char02"></div>
<div class="badge char07"></div>
</div>
<p><a href="chapter-02">灼け焦がれた涙</a></p>
</div>
<div class="chapter hoverable">
<div class="badges">
<div class="badge char06"></div>
<div class="badge char01"></div>
<div class="badge char05"></div>
<div class="badge char02"></div>
<div class="badge char07"></div>
</div>
<p><a href="chapter-02">灼け焦がれた涙</a></p>
</div>
$('.hoverable').on('mouseenter', function () {
$(this).addClass('hover');
}).on('mouseleave', function () {
$(this).removeClass('hover');
}).on('touchstart', function () {
$(this).addClass('hover');
$('.hoverable').not(this).removeClass('hover');
});
$(window).on('scroll', function () {
$('.hoverable').removeClass('hover');
});
<meta name="viewport" content="width=480">
$('.hoverable').on('mouseenter', function () {
$(this).addClass('hover');
}).on('mouseleave', function () {
$(this).removeClass('hover');
}).on('touchstart', function () {
$(this).addClass('hover');
$('.hoverable').not(this).removeClass('hover');
});
$(window).on('scroll', function () {
$('.hoverable').removeClass('hover');
});
<meta name="viewport" content="width=480">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment