Embedding three.js in WordPress 워드프레스에서 three.js 사용

Embedding three.js in WordPress

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

The little piece of code that I added (under the “text” tab in WordPress’ backend) looks like this:

<iframe src="http://3dspace.com/3dassets/experiments/demo1.html" width="700" height="300" scrolling="no"></iframe>

A little bit of explanation of what’s going on in there:

  • src points to where the html file (with the three.js payload) lives on my server. I have to ftp the file into that location – so this isn’t a very “WordPress” solution. But, other than the ftp part, there’s no headaches.
  • the height and width I chose are maximums, as far as the .css is concerned. I’m using the twentysixteen theme, and it nicely keeps the size of the iframe within the device window. Though – you do have to reload the page when you resize the window – the three.js part isn’t able to adapt to new window sizes on the fly.
  • scrolling is an extra argument that gets rid of the scrollbars on the iframe.

And that’s it. Pretty close to a no-brainer. Which, for me is a bit of a relief. I had been monkeying with adding three.js code in WordPress’ backend – but I found that the backend was helpfully adding html mark-up to my javascript, and that the css/layout issues were nontrivial, to say the least.

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
363 웹팩(Webpack) 이란, 웹팩 간단 정리 및 리액트(React) 기본 개발환경 세팅. [1] file 졸리운_곰 2019.11.08 411
362 PHP 로 css/js 보호하기 졸리운_곰 2019.11.08 439
» Embedding three.js in WordPress 워드프레스에서 three.js 사용 졸리운_곰 2019.11.08 517
360 Three.js를 이용한 WebGL: 기본 file 졸리운_곰 2019.11.08 495
359 How to Super Charge your WordPress with Microservices 워드프레스 마이크로서비스 file 졸리운_곰 2019.11.03 374
358 <인터넷, 블로그팁: 마진(margin)과 패딩(padding)의 차이점이 뭘까?> file 졸리운_곰 2019.11.01 504
357 자바스크립트 헬로월드 javascrpt "hello world" file 졸리운_곰 2019.10.06 476
356 2019년 웹/앱 개발의 전망과 화두 file 졸리운_곰 2019.09.25 502
355 Awesome Wasm Awesome file 졸리운_곰 2019.05.18 786
354 Getting started with RabbitMQ and Node.js file 졸리운_곰 2019.05.09 466
353 [Node.js + RabbitMQ] Node.js + socket.io + RabbitMQ 이용한 실시간 메시지 처리 file 졸리운_곰 2019.05.09 352
352 WebGL 기초 file 졸리운_곰 2019.04.16 347
351 javascript contains : JavaScript String includes() Method 졸리운_곰 2019.04.11 623
350 이전 페이지의 주소 받기 졸리운_곰 2019.04.11 580
349 table 태그 총정리 졸리운_곰 2019.04.09 1003
348 textarea 태그에 값을 넣고 뺄때 아니면 개행문자 '\n'이 혼란이 온다 졸리운_곰 2019.04.08 692
347 자바스크립트 뒤로가기 history.back() 메소드 졸리운_곰 2019.04.08 574
346 jQuery ready와 load의 차이 file 졸리운_곰 2019.03.29 733
345 [JavaScript] 시간 지연 함수, 일정 시간 뒤 실행시키기, SetTimeout() {} 졸리운_곰 2019.03.27 472
344 How can I detect if a selector returns null? 졸리운_곰 2019.03.25 454
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED