<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Devs on philipjkim</title><link>https://philipjkim.cc/dev/</link><description>Recent content in Devs on philipjkim</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://philipjkim.cc/dev/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://philipjkim.cc/dev/hoola-calculator/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://philipjkim.cc/dev/hoola-calculator/</guid><description>&lt;!DOCTYPE html&gt;
&lt;html lang="ko"&gt;
&lt;head&gt;
 &lt;meta charset="UTF-8"&gt;
 &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
 &lt;title&gt;훌라 카드 합계 계산기&lt;/title&gt;
 &lt;style&gt;
 body {
 font-family: sans-serif;
 display: flex;
 flex-direction: column;
 align-items: center;
 padding: 20px;
 }
 h1 {
 margin-bottom: 20px;
 font-size: 24px;
 }
 .card-buttons {
 /* 수정된 부분: 3개씩 한 줄에 표시되도록 설정 */
 display: grid;
 grid-template-columns: repeat(3, 1fr); /* 항상 3개의 열 */
 gap: 10px;
 margin-bottom: 20px;
 width: 100%; /* 부모 너비에 맞춤 */
 max-width: 600px; /* 최대 너비 유지 */
 box-sizing: border-box; /* 패딩과 보더가 너비에 포함되도록 */
 padding: 0 10px; /* 좌우 잘림 방지를 위해 약간의 패딩 추가 */
 }
 .card-button {
 padding: 15px;
 border: 1px solid #ccc;
 border-radius: 8px;
 /* background-color: #f0f0f0; */
 text-align: center;
 cursor: pointer;
 font-size: 18px;
 box-sizing: border-box;
 /* 최소 너비 제한을 없애고 1fr로만 관리하여 유연하게 */
 min-width: 0; /* flex/grid 아이템의 기본 min-width를 재정의 */
 }
 .card-button.selected {
 background-color: #ddd;
 }
 .selected-cards {
 margin-bottom: 15px;
 font-size: 16px;
 }
 .result {
 font-weight: bold;
 font-size: 20px;
 margin-bottom: 20px;
 }
 button {
 padding: 12px 25px;
 border: none;
 border-radius: 8px;
 background-color: #7d601c;
 /* color: white; */
 cursor: pointer;
 font-size: 18px;
 }
 button:hover {
 background-color: #4f3d12;
 }
 /* 추가: 화면이 매우 좁을 경우를 위한 미디어 쿼리 (필요시) */
 @media (max-width: 380px) { /* 더 좁은 화면 (예: 아이폰 SE1) */
 .card-buttons {
 gap: 5px; /* 버튼 간격 줄이기 */
 padding: 0 5px; /* 패딩도 줄이기 */
 }
 .card-button {
 font-size: 16px; /* 폰트 사이즈 줄이기 */
 padding: 10px; /* 패딩 줄이기 */
 }
 }
 &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
 &lt;h1&gt;훌라 카드 합계 계산기&lt;/h1&gt;
 &lt;div class="card-buttons"&gt;
 &lt;button class="card-button" data-value="1" data-alt-value="14"&gt;A&lt;/button&gt;
 &lt;button class="card-button" data-value="2"&gt;2&lt;/button&gt;
 &lt;button class="card-button" data-value="3"&gt;3&lt;/button&gt;
 &lt;button class="card-button" data-value="4"&gt;4&lt;/button&gt;
 &lt;button class="card-button" data-value="5"&gt;5&lt;/button&gt;
 &lt;button class="card-button" data-value="6"&gt;6&lt;/button&gt;
 &lt;button class="card-button" data-value="7"&gt;7&lt;/button&gt;
 &lt;button class="card-button" data-value="8"&gt;8&lt;/button&gt;
 &lt;button class="card-button" data-value="9"&gt;9&lt;/button&gt;
 &lt;button class="card-button" data-value="10"&gt;10&lt;/button&gt;
 &lt;button class="card-button" data-value="11"&gt;J&lt;/button&gt;
 &lt;button class="card-button" data-value="12"&gt;Q&lt;/button&gt;
 &lt;button class="card-button" data-value="13"&gt;K&lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="selected-cards"&gt;선택한 카드: &lt;/div&gt;
 &lt;div class="result"&gt;총합: &lt;/div&gt;
 &lt;button id="reset-button"&gt;초기화&lt;/button&gt;

 &lt;script&gt;
 const cardButtons = document.querySelectorAll('.card-button');
 const selectedCardsDiv = document.querySelector('.selected-cards');
 const resultDiv = document.querySelector('.result');
 const resetButton = document.getElementById('reset-button');
 let selectedCards = [];

 cardButtons.forEach(button =&gt; {
 button.addEventListener('click', function() {
 const value = parseInt(this.dataset.value);
 const altValue = this.dataset.altValue ? parseInt(this.dataset.altValue) : null;
 selectedCards.push({ value: value, altValue: altValue, display: this.textContent });
 this.classList.add('selected');
 updateDisplay();
 calculateSum();
 });
 });

 resetButton.addEventListener('click', function() {
 selectedCards = [];
 cardButtons.forEach(button =&gt; button.classList.remove('selected'));
 updateDisplay();
 calculateSum();
 });

 function updateDisplay() {
 selectedCardsDiv.textContent = '선택한 카드: ' + selectedCards.map(card =&gt; card.display).join(', ');
 }

 function calculateSum() {
 if (selectedCards.length === 0) {
 resultDiv.textContent = '총합: ';
 return;
 }

 const hasAce = selectedCards.some(card =&gt; card.display === 'A');

 if (hasAce) {
 let sumWithAas1 = 0;
 let sumWithAas14 = 0;
 selectedCards.forEach(card =&gt; {
 sumWithAas1 += (card.display === 'A' ? 1 : card.value);
 sumWithAas14 += (card.display === 'A' ? 14 : card.value);
 });
 resultDiv.textContent = '총합: ' + sumWithAas1 + ' / ' + sumWithAas14;
 } else {
 const totalSum = selectedCards.reduce((sum, card) =&gt; sum + card.value, 0);
 resultDiv.textContent = '총합: ' + totalSum;
 }
 }
 &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</description></item><item><title/><link>https://philipjkim.cc/dev/polymer-image-slider/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://philipjkim.cc/dev/polymer-image-slider/</guid><description>&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;polymer-image-slider demo&lt;/title&gt;

 &lt;meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"&gt;
 &lt;meta name="mobile-web-app-capable" content="yes"&gt;
 &lt;meta name="apple-mobile-web-app-capable" content="yes"&gt;

 &lt;script src="bower_components/webcomponentsjs/webcomponents-lite.js"&gt;&lt;/script&gt;
 &lt;link rel="shortcut icon" href="./favicon.ico"&gt;
 &lt;link rel="import" href="bower_components/polymer/polymer.html"&gt;
 &lt;link rel="import" href="bower_components/iron-demo-helpers/demo-snippet.html"&gt;
 &lt;link rel="import" href="bower_components/iron-demo-helpers/demo-pages-shared-styles.html"&gt;
 &lt;link rel="import" href="bower_components/paper-styles/color.html"&gt;
 &lt;link rel="import" href="bower_components/polymer-image-slider/polymer-image-slider.html"&gt;
 &lt;style is="custom-style" include="demo-pages-shared-styles"&gt;
 .centered:not([style-scope]):not(.style-scope) {
 max-width: 100%;
 }
 &lt;/style&gt;
&lt;/head&gt;
&lt;body unresolved&gt;
&lt;div class="vertical-section-container centered"&gt;
 &lt;h3&gt;paper-sliders have &lt;code&gt;images&lt;/code&gt; attribute,
 and dynamically change images by modifying the attribute value.&lt;/h3&gt;
 &lt;demo-snippet&gt;
 &lt;template&gt;
 &lt;!--
 max-width is adjustable via CSS variable `--image-slider-max-width`.
 --&gt;
 &lt;style is="custom-style"&gt;
 #slider {
 --image-slider-max-width: 300px;
 }
 &lt;/style&gt;

 &lt;!--
 Use single-quotes for `images` attribute - the value should be a valid JSON string.

 &lt;image-slider id="slider" images='["1.jpg","2.jpg"]'&gt;&lt;/image-slider&gt;
 --&gt;
 &lt;image-slider id="slider" images='["1.jpg","2.jpg"]'&gt;&lt;/image-slider&gt;

 &lt;!-- Manipulation using JS --&gt;
 &lt;button id="btn-change" onclick="changeImages();"&gt;Change images&lt;/button&gt;
 &lt;button id="btn-bullet" onclick="toggleBullet();"&gt;Show/hide bullets&lt;/button&gt;

 &lt;script&gt;
 function changeImages() {
 var imageSet1 = ["1.jpg","2.jpg"];
 var imageSet2 = ["3.jpg","4.jpg","5.jpg"];
 var images = document.querySelector('#slider').images;
 if (images.length == 2) {
 document.querySelector('#slider').images = imageSet2;
 } else {
 document.querySelector('#slider').images = imageSet1;
 }
 }

 function toggleBullet() {
 var noBullets = document.querySelector('#slider').noBullets;
 document.querySelector('#slider').noBullets = !noBullets;
 }
 &lt;/script&gt;
 &lt;/template&gt;
 &lt;/demo-snippet&gt;

 &lt;h3&gt;If you want to show images in actual size,
 set &lt;code&gt;--image-slider-max-width&lt;/code&gt; to &lt;code&gt;none&lt;/code&gt;.&lt;/h3&gt;
 &lt;demo-snippet&gt;
 &lt;template&gt;
 &lt;style is="custom-style"&gt;
 #slider2 {
 --image-slider-max-width: none;
 }
 &lt;/style&gt;

 &lt;image-slider id="slider2" images='["1.jpg","2.jpg"]'&gt;&lt;/image-slider&gt;
 &lt;/template&gt;
 &lt;/demo-snippet&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</description></item><item><title/><link>https://philipjkim.cc/dev/vue2-flip-countdown/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://philipjkim.cc/dev/vue2-flip-countdown/</guid><description>&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
 &lt;meta charset="utf-8" /&gt;
 &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
 &lt;meta name="viewport" content="width=device-width,initial-scale=1" /&gt;
 &lt;link rel="icon" href="./favicon.ico" /&gt;
 &lt;title&gt;Demo: vue2-flip-countdown&lt;/title&gt;
 &lt;link href="./css/app.30f70602.css" rel="preload" as="style" /&gt;
 &lt;link href="./js/app.4cf28f45.js" rel="preload" as="script" /&gt;
 &lt;link href="./js/chunk-vendors.0e314190.js" rel="preload" as="script" /&gt;
 &lt;link href="./css/app.30f70602.css" rel="stylesheet" /&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;noscript
 &gt;&lt;strong
 &gt;We're sorry but demo doesn't work properly without JavaScript enabled.
 Please enable it to continue.&lt;/strong
 &gt;&lt;/noscript
 &gt;
 &lt;div id="app"&gt;&lt;/div&gt;
 &lt;script src="./js/chunk-vendors.0e314190.js"&gt;&lt;/script&gt;
 &lt;script src="./js/app.4cf28f45.js"&gt;&lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;</description></item></channel></rss>