- node.js のインストール
- npm のインストール
- Gulp グローバルへインストール
npm install -g gulp
- Gulp ローカルへインストール(nodemoduleフォルダ) npm install --save-dev gulp
- package.jsonファイルを生成 npm init -y
<?php | |
phpinfo(); | |
?> |
<span class="tel_link">090-5555-6666</span> |
<div id="pagetop"><a href="#">ページの先頭へ</a></div> |
// スムーズスクロール | |
$('a[href^=#]').click(function() { | |
var speed = 400; // ミリ秒 | |
var href= $(this).attr("href"); | |
var target = $(href == "#" || href == "" ? 'html' : href); | |
var position = target.offset().top; | |
$('body,html').animate({scrollTop:position}, speed, 'swing'); | |
return false; | |
}); |
function writeHeader(rootDir){ | |
$.ajax({ | |
url: rootDir + "/header.html", //パスはcommon.jsが読み込まれたHTMLファイルが基準 | |
cache: false, //キャッシュを利用するか( | |
async: false, //非同期で読み込むか | |
success: function(html){ | |
html = html.replace(/\{\$root\}/g, rootDir); | |
document.write(html); | |
} |
/* Google Analytics用コード */ | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'トラッキングIDをここに書く!', 'auto'); | |
ga('require', 'displayfeatures'); | |
ga('send', 'pageview'); |
var cp=new Date(); | |
var now=cp.getFullYear(); | |
document.write('Copyright © '+now+' ウェブデザインカンパニー All Rights Reserved.'); |
const gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
postcss = require('gulp-postcss'), | |
autoprefixer = require('autoprefixer'), // postcssの一部 | |
mqpacker = require('css-mqpacker'), // postcssの一部 | |
cssdeclsort = require('css-declaration-sorter'), // postcssの一部(並び替え) | |
pug = require('gulp-pug'), | |
plumber = require("gulp-plumber"), // 監視継続 | |
notify = require('gulp-notify'), // 通知 | |
imagemin = require("gulp-imagemin"), |
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css" media="all"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> |