Skip to content

Instantly share code, notes, and snippets.

View zakihiro's full-sized avatar

ざきひー zakihiro

View GitHub Profile
@zakihiro
zakihiro / cdt2.js
Last active March 16, 2021 10:13
【Javascript】開始日時と終了日時を指定できるカウントダウンタイマー 2つ目
// ▼ 2つ目のカウントダウンタイマー
function CDT2() {
var myD = Date.now(); // 1970/1/1午前0時から現在までのミリ秒
var start = new Date('2021-12-15T00:00+09:00'); // 開始日時の指定
var myS = start.getTime(); // 1970/1/1午前0時からの開始日時までのミリ秒
var end = new Date('2022-12-15T23:59+09:00'); // 終了日時の指定
var myE = end.getTime(); // 1970/1/1午前0時から終了日時までのミリ秒
// 今日が開始日前か期間中か終了日後かの判別
if (myS <= myD && myE >= myD) {
@zakihiro
zakihiro / cdt_multiple.html
Last active March 16, 2021 10:19
【Javascript】開始日時と終了日時を指定できるカウントダウンタイマー 2つ目
<!-- 1つ目のカウントダウンタイマー -->
<div class="cdt_wrapper">
<div class="cdt">
<span class="cdt_txt" id="cdt_txt"></span>
<span class="cdt_date" id="cdt_date"></span>
</div>
</div>
<br>
<!-- 2つ目のカウントダウンタイマー -->
<div class="cdt_wrapper">
@zakihiro
zakihiro / card_pt5_entry.html
Created January 24, 2020 17:25
楽天カード利用でP5倍のエントリーURLを自動で書き換える方法
<a href="https://event.rakuten.co.jp/campaign/card/pointday/" target="_blank" class="card_pt5_entry">
<img src="banner.jpg">
</a>
@zakihiro
zakihiro / card_pt5_entry.js
Last active January 25, 2020 18:12
楽天カード利用でP5倍のエントリーURLを自動で書き換える方法
var today = new Date,
day = today.getDate(),
month = today.getMonth() + 1,
nextmonth = today.getMonth() + 2,
year = today.getFullYear(),
nextyear = today.getFullYear() + 1,
// 5日のセール終了から10日のセール開始まで
startDay1 = 6,
endDay1 = 10,
@zakihiro
zakihiro / horizontal_scroll_ranking_style.css
Last active January 17, 2020 16:39
Horizontal scroll ranking decoration.
/* Title */
.slider_ttl {
color: #333;
text-align: inherit;
width: 100%;
height: 40px;
line-height: 40px;
padding: inherit;
margin: 0 0 20px 0;
background-color: #e5e5e5;
@zakihiro
zakihiro / horizontal_scroll.css
Last active January 16, 2020 17:02
CSS for horizontal scrolling
.horizontal_scroll {
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
padding: 0 0 12px 8px;
display : -ms-flexbox ;
display: flex; }
/* Cancel horizontal scrolling when screen width is 768px or more */
@media screen and (min-width: 768px) {
.horizontal_scroll {
@zakihiro
zakihiro / horizontal_scroll.html
Created January 13, 2020 16:50
HTML for horizontal scrolling
<ul class="horizontal_scroll">
<li>
<a href=""><img src=""></a>
< div > caption </ div >
</li>
<!- After that, repeat any number of <li> </ li> ->
</ul>
@zakihiro
zakihiro / bottom_bnr.css
Last active October 16, 2019 15:20
楽天市場のPCページ下部にバナーを貼る
#bottom_bnr {
z-index: 9001;
position: fixed;
bottom: 0;
width: 100%
}
#bottom_bnr label {
display: block;
z-index: 9002;
@zakihiro
zakihiro / bottom_bnr.html
Last active October 16, 2019 15:22
楽天市場のPCページ下部にバナーを貼る
<div id="bottom_bnr">
<input id="toggle" type="checkbox">
<label class="toggle-switch" for="toggle"></label>
<div>
<a href="リンク先URL"><img src="バナー画像URL" alt="..."></a>
</div>
</div>
@zakihiro
zakihiro / fivezeroday.html
Created October 6, 2019 13:26
5と0のつく日に表示するJavaScript
<div class="fivezeroday">
<img src="xxxxx.jpg">
</div>