Skip to content

Commit

Permalink
fix colors
Browse files Browse the repository at this point in the history
  • Loading branch information
tenax66 committed Aug 24, 2024
1 parent 856450f commit 4fb5512
Showing 1 changed file with 48 additions and 7 deletions.
55 changes: 48 additions & 7 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,65 @@ image: /assets/images/ogp_default.png

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

<canvas id="fruitChart" class="fruitChart"></canvas>
<canvas id="fruitChart" class="fruitChart" width="400" height="100"></canvas>

<script>
const lightThemeColors = {
backgroundColor: '',
borderColor: '',
borderColor: '96968C',
color: '#212529',
};

const darkThemeColors = {
backgroundColor: '',
borderColor: '',
gridColor: '#96968C',
textColor: '#E1E1E1',
};

function getThemeColors() {
const isDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;

return isDarkTheme ? darkThemeColors : lightThemeColors;
}

const themeColors = getThemeColors();

const data = {
labels: ['', 'スイカ', '', 'パイナップル', 'バナナ', 'びわ', 'ぶどう', 'ライチ'],
datasets: [{
data: [1, 1, 1, 3, 1, 1, 1, 1],
borderWidth: 0,
backgroundColor: themeColors.backgroundColor,
borderColor: themeColors.borderColor,
borderWidth: 1
}]
};

const config = {
type: 'bar',
data: data,
options: {
scale: {
ticks: {
max: 3,
min: 0,
stepSize: 1
scales: {
y: {
beginAtZero: true,
grid: {
color: themeColors.gridColor,
},
ticks: {
max: 3,
min: 0,
stepSize: 1,
color: themeColors.textColor,
},
},
x: {
grid: {
color: themeColors.gridColor,
},
ticks: {
color: themeColors.textColor,
}
},
},
plugins: {
Expand All @@ -54,6 +93,8 @@ image: /assets/images/ogp_default.png
);
</script>

---

**[青野ゆらぎ](https://x.com/aonoyuragi)**

1. バナナ
Expand Down

0 comments on commit 4fb5512

Please sign in to comment.