<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>円形 アーカイブ - nyanblog ~にゃんぶろぐ~</title>
	<atom:link href="https://nyanblog2222.com/tag/%E5%86%86%E5%BD%A2/feed/" rel="self" type="application/rss+xml" />
	<link>https://nyanblog2222.com/tag/円形/</link>
	<description>ちょっとしたことを調べているよ</description>
	<lastBuildDate>Fri, 27 Aug 2021 11:28:06 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7</generator>

<image>
	<url>https://nyanblog2222.com/wp-content/uploads/2021/09/cropped-favicon-32x32.png</url>
	<title>円形 アーカイブ - nyanblog ~にゃんぶろぐ~</title>
	<link>https://nyanblog2222.com/tag/円形/</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>【JavaScript】簡単に文字をカーブ状に配置するプラグイン【Arctext.js】</title>
		<link>https://nyanblog2222.com/programming/javascript/1233/</link>
					<comments>https://nyanblog2222.com/programming/javascript/1233/#respond</comments>
		
		<dc:creator><![CDATA[nyan2222]]></dc:creator>
		<pubDate>Fri, 12 Jun 2020 09:00:00 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[プログラミング]]></category>
		<category><![CDATA[Arctext]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[カーブ]]></category>
		<category><![CDATA[円形]]></category>
		<guid isPermaLink="false">https://nyanblog2222.com/?p=1233</guid>

					<description><![CDATA[<p><img src="https://nyanblog2222.com/wp-content/uploads/2022/11/79.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://nyanblog2222.com/wp-content/uploads/2022/11/79.png 1280w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-300x157.png 300w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-1024x536.png 1024w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-768x402.png 768w" sizes="(max-width: 1280px) 100vw, 1280px" />文字をカーブさせるためには、CSSやJavaScriptで一から作成するのはかなり難しいです。今回は、JavaScriptのプラグインを使って、簡単に文字をカーブ状に配置する方法をご紹介します。 目次 プラグインの設定A [&#8230;]</p>
<p>投稿 <a href="https://nyanblog2222.com/programming/javascript/1233/">【JavaScript】簡単に文字をカーブ状に配置するプラグイン【Arctext.js】</a> は <a href="https://nyanblog2222.com">nyanblog ~にゃんぶろぐ~</a> に最初に表示されました。</p>
]]></description>
										<content:encoded><![CDATA[<img src="https://nyanblog2222.com/wp-content/uploads/2022/11/79.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" srcset="https://nyanblog2222.com/wp-content/uploads/2022/11/79.png 1280w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-300x157.png 300w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-1024x536.png 1024w, https://nyanblog2222.com/wp-content/uploads/2022/11/79-768x402.png 768w" sizes="(max-width: 1280px) 100vw, 1280px" />
<p>文字をカーブさせるためには、CSSやJavaScriptで一から作成するのはかなり難しいです。<br>今回は、JavaScriptのプラグインを使って、簡単に文字をカーブ状に配置する方法をご紹介します。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">プラグインの設定</a><ol><li><a href="#toc2" tabindex="0">Arctext.jsのファイルをダウンロード</a></li><li><a href="#toc3" tabindex="0">script参照の設定</a></li></ol></li><li><a href="#toc4" tabindex="0">HTML</a></li><li><a href="#toc5" tabindex="0">CSS</a></li><li><a href="#toc6" tabindex="0">JavaScript</a></li><li><a href="#toc7" tabindex="0">Arctext.jsのオプション</a></li><li><a href="#toc8" tabindex="0">デモ</a></li><li><a href="#toc9" tabindex="0">まとめ</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">プラグインの設定</span></h2>



<h3 class="wp-block-heading"><span id="toc2">Arctext.jsのファイルをダウンロード</span></h3>



<p>こちらのページ<strong><a rel="noopener" class="link" href="http://tympanus.net/codrops/2012/01/24/arctext-js-curving-text-with-css3-and-jquery/" target="_blank">[Arctext.js – Curving Text with CSS3 and jQuery]</a></strong>のページから<strong><span style="color:#b78d4a" class="has-inline-color">「Download Source」</span></strong>をクリックしてダウンロードすることができます。<br>このプラグインはCDNには設置されていないので、ダウンロードしてファイルを配置してください。</p>



<p>また、このプラグインはJqueryを使用していますので、CDN設置のアドレスを設定するか、事前にダウンロードして用意してください。</p>



<h3 class="wp-block-heading"><span id="toc3">script参照の設定</span></h3>



<p>先ほどダウンロードしたファイルをhtmlでscript要素で参照設定します。</p>



<pre class="wp-block-code"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js">&lt;/script>
&lt;script src="js/jquery.arctext.js">&lt;/script>
&lt;script src="js/script.js">&lt;/script></code></pre>



<h2 class="wp-block-heading"><span id="toc4">HTML</span></h2>



<p>HTMLでカーブ状にしたい要素に対してidを設定していきます。<br>具体的な設定はJavaScriptで設定します。</p>



<pre class="wp-block-code"><code>&lt;body>
    &lt;p id="sample1">nyanblog javascript&lt;/p>
    &lt;p id="sample2">簡単にカーブにできるよ&lt;/p>
    &lt;p id="sample3">よかったら試してみてね&lt;/p>
    &lt;p id="sample4">文字をまっすぐにできるよ&lt;/p>
&lt;/body></code></pre>



<h2 class="wp-block-heading"><span id="toc5">CSS</span></h2>



<p>CSSで少しスタイルも編集しています。</p>



<pre class="wp-block-code"><code>p {
    text-align: center;
    color: #D09B4A;
    margin: 5rem auto;
    font-weight: bold;
    font-size: 1.6rem;
}

#sample3 {
    margin-top: 16rem;
}</code></pre>



<h2 class="wp-block-heading"><span id="toc6">JavaScript</span></h2>



<p>HTMLで設定したh1~h6要素やp要素に設定したidに対して、arctext関数を使って文字列をどのようにカーブ状にするか、設定します。</p>



<p>この設定は「script.js」ファイルに記述しています。</p>



<pre class="wp-block-code"><code>$(function() {
    $("#sample1").arctext({
        radius : 200,
    });
    
    $("#sample2").arctext({
        radius : 150,
    });
    
    $("#sample3").arctext({
        radius : 150,
        dir: -1,
    });
    
    $("#sample4").arctext({
        radius : 200,
        rotate: false,
    });
});</code></pre>



<h2 class="wp-block-heading"><span id="toc7">Arctext.jsのオプション</span></h2>



<p>オプションを設定について、こちらの表を参考に設定してみてください。</p>



<figure class="wp-block-table">
    <table>
        <tbody>
            <tr>
                <th class="text-aline-center">オプション</th>
                <th class="text-aline-center">説明</th>
            </tr>
            <tr>
                <th>radius</th>
                <td>サークルの半径（デフォルト：0）</td>
            </tr>
            <tr>
                <th>dir</th>
                <td>方向：1:下にカーブ、-1:上にカーブ（デフォルト：1）</td>
            </tr>
            <tr>
                <th>rotate</th>
                <td>true：文字が中央を向く、false：文字がまっすぐのまま。（デフォルト：true）</td>
            </tr>
            <tr>
                <th>fitText</th>
                <td>[fitText]プラグインを使用する場合、true（デフォルト：false）</td>
            </tr>
        </tbody>
    </table>
</figure>



<h2 class="wp-block-heading"><span id="toc8">デモ</span></h2>



<p>ソースコードに記述している<strong><a class="link" href="https://nyanblog2222.com/demo/arctext/" target="_blank">「デモページはこちら」</a></strong>です。</p>



<figure class="wp-block-image size-large"><img decoding="async" width="325" height="502" src="https://nyanblog2222.com/wp-content/uploads/2020/06/c593493fb54c5efe411e6adc3316c991.png" alt="デモページのイメージ" class="wp-image-1262" srcset="https://nyanblog2222.com/wp-content/uploads/2020/06/c593493fb54c5efe411e6adc3316c991.png 325w, https://nyanblog2222.com/wp-content/uploads/2020/06/c593493fb54c5efe411e6adc3316c991-194x300.png 194w" sizes="(max-width: 325px) 100vw, 325px" /></figure>



<h2 class="wp-block-heading"><span id="toc9">まとめ</span></h2>



<p>いかがでしたでしょうか。<br>今回はJavaScriptのプラグインで簡単に文字をカーブ状に表現することができました。<br>これを使うとロゴも簡単にできちゃいそうですね！</p>
<p>投稿 <a href="https://nyanblog2222.com/programming/javascript/1233/">【JavaScript】簡単に文字をカーブ状に配置するプラグイン【Arctext.js】</a> は <a href="https://nyanblog2222.com">nyanblog ~にゃんぶろぐ~</a> に最初に表示されました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nyanblog2222.com/programming/javascript/1233/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
